def _create_instance(self): model_fields = { 'age': fields.IntegerField(), 'name': fields.StringField(), 'number': fields.StringField() } model_content = {'age': 5, 'name': "Jack", 'number': "12345678"} instance = ModelInstance(model_name="Contact", model_fields=model_fields, model_content=model_content) return instance
class RandomModel(model.Model): time = fields.DateTimeField() id_field = fields.StringField(primary=True) number = fields.IntegerField(default=0) obj = fields.ObjectField(Car) json_field = fields.JSONField()
class Message(model.Model): message_id = fields.StringField(primary=True) content = fields.StringField() created = fields.DateTimeField()
class Recipient(model.Model): recipient_id = fields.StringField(primary=True) contact = fields.ForeignKey(Contact) message = fields.ForeignKey(Message)
class Contact(model.Model): model_name = "Contact" contact_id = fields.StringField(primary=True) name = fields.StringField() age = fields.IntegerField(default=0)