calendaring_sync.objects.edit module#
A local edit your application recorded and the server doesn’t have yet.
- class calendaring_sync.objects.edit.EditKind(*values)[source]#
Bases:
StrEnumWhat a local edit does to its object.
- CHANGE = 'change'#
Changes an object the server has.
- DELETE = 'delete'#
Deletes an object the server has.
- CREATE = 'create'#
Creates an object the server doesn’t have yet.
- class calendaring_sync.objects.edit.LocalEdit(kind, content, fingerprint, containers, logical_key, recorded_at)[source]#
Bases:
objectOne pending edit of a record.
- fingerprint#
The fingerprint of
content,Nonefor a delete, or after a fingerprint scheme change until the object is edited again.
- containers#
The containers the object belongs to after the edit.
- logical_key#
The object’s logical key after the edit, if it has one.
- class calendaring_sync.objects.edit.EditFields(fingerprint, containers=frozenset({}), logical_key=None)[source]#
Bases:
objectWhat an edit records about an object beside its content.
An adapter reads these from content the same way for the server’s copy and for an edit, so an edit back to the synced copy cancels, and the server’s copy of your own edit isn’t a conflict. To build them for content you made, such as a
Merge, call the adapter’sedit_fields().- fingerprint#
The content’s fingerprint.
- Type:
- containers#
The containers the object belongs to.
- logical_key#
The object’s logical key, if it has one.
- Raises:
TypeError – If a field has the wrong type.
Examples
>>> from calendaring_sync import EditFields >>> fields = EditFields("fp-a2", frozenset({"work"}), "meeting-1") >>> fields.logical_key 'meeting-1'