Splits DBManager in parent and child classes so a UserDBManager can be implemented

- DBManager preserves the basic methods, while the appointment related ones have been moved to AppointmentDBM.
- AppointmentDBM handles json loads and dumps for appointments and trackers, so the corresponding methods can be removed from their classes.
- Updates docs.
This commit is contained in:
Sergi Delgado Segura
2020-04-01 17:13:20 +02:00
parent 0e392d1f2a
commit 7031b552f7
8 changed files with 490 additions and 444 deletions

View File

@@ -81,19 +81,6 @@ class Appointment:
return appointment
def to_json(self):
"""
Exports an appointment as a deterministic json encoded string.
This method ensures that multiple invocations with the same data yield the same value. This is the format used
to store appointments in the database.
Returns:
:obj:`str`: A json-encoded str representing the appointment.
"""
return json.dumps(self.to_dict(), sort_keys=True, separators=(",", ":"))
def serialize(self):
"""
Serializes an appointment to be signed.