ContributingRecordsMixin

class squirro_client.topic.ContributingRecordsMixin

Bases: object

Methods Summary

delete_contributing_content_record(type, …)

Deletes a contributing content record and recalculates the fingerprint for the provided parameters.

delete_contributing_items_record(type, …)

Deletes a contributing items record and recalculates the fingerprint for the provided parameters.

update_contributing_content_record(type, …)

Updates a contributing content record and recalculates the fingerprint for the provided parameters.

Methods Documentation

delete_contributing_content_record(type, type_id, name, record_id, created_at=None)

Deletes a contributing content record and recalculates the fingerprint for the provided parameters.

Parameters
  • type – Fingerprint type.

  • type_id – Fingerprint type identifier.

  • name – Fingerprint name.

  • record_id – Contributing record identifier.

  • created_at – Contributing record creation timestamp.

Example:

>>> client.delete_contributing_content_record(
...     'user', 'bgFtu5rkR1STpx1xR2u1UQ', 'default',
...     'M2uyX6aUQVG2J2zcblSFHg')
{}
delete_contributing_items_record(type, type_id, name, record_id, created_at=None)

Deletes a contributing items record and recalculates the fingerprint for the provided parameters.

Parameters
  • type – Fingerprint type.

  • type_id – Fingerprint type identifier.

  • name – Fingerprint name.

  • record_id – Contributing record identifier.

  • created_at – Contributing record creation timestamp.

Example:

>>> client.delete_contributing_items_record(
...     'user', 'bgFtu5rkR1STpx1xR2u1UQ', 'default',
...     '0L5jwLdfTJWRcTFMtBzhGg')
{}
update_contributing_content_record(type, type_id, name, record_id, content, created_at=None)

Updates a contributing content record and recalculates the fingerprint for the provided parameters.

Parameters
  • type – Fingerprint type.

  • type_id – Fingerprint type identifier.

  • name – Fingerprint name.

  • record_id – Contributing record identifier.

  • content – Content data which is a dictionary which contains the lang and text keys.

  • created_at – Contributing record creation timestamp.

Example:

>>> data = {'lang': 'en', 'text': 'updated english content'}
>>> client.update_fingerprint_from_content(
...     'user', 'bgFtu5rkR1STpx1xR2u1UQ', 'default',
...     'M2uyX6aUQVG2J2zcblSFHg', data,
...     created_at='2013-07-01T14:08:23')
{}