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.
|
|
1 month ago | |
|---|---|---|
| .. | ||
| migrations | 2 months ago | |
| models | 1 month ago | |
| README.md | 2 months ago | |
| __init__.py | 11 months ago | |
| admin.py | 1 month ago | |
| apps.py | 11 months ago | |
| consumers.py | 10 months ago | |
| model_manager.py | 1 month ago | |
| registry.py | 1 month ago | |
| routing.py | 10 months ago | |
| serializers.py | 5 months ago | |
| signals.py | 1 month ago | |
| tests.py | 11 months ago | |
| utils.py | 1 month ago | |
| views.py | 1 month ago | |
| ws_sender.py | 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.