You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
padelclub_backend/sync
Laurent 58557c01aa fix sync crash 1 month ago
..
migrations Add Activity status options and fix DataAccess model name 2 months ago
models remove logs 1 month ago
README.md Adds sharable property to BaseModel classes 2 months ago
__init__.py Separate the sync from tournaments by creating a new app 11 months ago
admin.py reorder filters 1 month ago
apps.py Separate the sync from tournaments by creating a new app 11 months ago
consumers.py fixes 10 months ago
model_manager.py remove logs 1 month ago
registry.py fixes sharing/revocations issues 1 month ago
routing.py Adds status page for websockets 10 months ago
serializers.py remove junk and make store_id nullable for DataAccess 5 months ago
signals.py fix sync crash 1 month ago
tests.py Separate the sync from tournaments by creating a new app 11 months ago
utils.py Adds ModelLog creation for DataAccess to be shared between concerned users 1 month ago
views.py Adds ModelLog creation for DataAccess to be shared between concerned users 1 month ago
ws_sender.py fixes sharing/revocations issues 1 month ago

README.md

Synchronization quick ReadMe

  • Data class must extend BaseModel
  • Admin classes must extend SyncedObjectAdmin to have updates saved in the BaseModel properties
  • The SynchronizationApi defines a get and a post service to POST new data, and GET updates. When performing an operation on a data, a ModelLog instance is created with the related information. When performing a GET, we retrieve the list of ModelLogs to sent the new data to the user.
  • routing.py defines the URL of the websocket where messages are sent when updates are made. URL is by user.

Sharing

  • Data can be shared between users. To do that, a new DataAccess object can be created to define the owner, the authorized user, and the object id.
  • By default, the whole hierarchy of objects are shared, from the data parents to all its children.
  • Special data path can be specified for a class by defining a setting

example: SYNC_MODEL_CHILDREN_SHARING = { 'Match': ['team_scores', 'team_registration', 'player_registrations'] } Here when sharing a Match, we also share objects accessed through the names of the properties to get TeamScore, TeamRegistration and PlayerRegistration.

  • It's also possible to exclude a class from being sharable by setting sharable = False in its definition. In PadelClub, Club is the top entity that links all data together, so we don't want the automatic data scanning to share clubs.