def save(self, instance: User): with open(self.filename, 'w') as f: json.dump(instance.to_dict(), f, indent=2)
def save(self, instance: User): data = instance.to_dict() self.db.collection('users').document(str(instance.pk)).set(data)