class QuoteSchema(ma.SQLAlchemySchema): class Meta: model = QuoteModel id = ma.auto_field() quote = ma.auto_field() author = ma.Nested(AuthorSchema())
class ProtetorSchema(ma.SQLAlchemySchema): class Meta: model = Protetor id = ma.auto_field() nome = ma.auto_field() animais = ma.Nested(AnimalSchema, many=True)
class CitySchema(ma.SQLAlchemyAutoSchema): class Meta: model = City id = ma.auto_field() estado_id = ma.auto_field() clave = ma.auto_field() nombre = ma.auto_field()
class TagResponseSchema(ma.SQLAlchemySchema): class Meta: model = TagModel id = ma.auto_field() name = ma.auto_field() author = ma.Nested(UserResponseSchema)
class StateSchema(ma.SQLAlchemyAutoSchema): class Meta: model = State id = ma.auto_field() clave = ma.auto_field() nombre = ma.auto_field() abrev = ma.auto_field() activo = ma.auto_field()
class UserSchema(ma.SQLAlchemySchema): class Meta: model = User id = ma.auto_field() name = ma.auto_field() entries = ma.auto_field() email = ma.auto_field()
class AccountSchema(ma.SQLAlchemySchema): class Meta: model = Account user_id = ma.auto_field() user_name = ma.auto_field() email = ma.auto_field() mobile_number = ma.auto_field() email_auth_yn = ma.auto_field()
class RadioAssignmentSchema(ma.SQLAlchemySchema): class Meta: model = RadioAssignment uuid = ma.auto_field() search_id = ma.auto_field() call_sign = ma.auto_field() tetra_number = ma.auto_field() name = ma.auto_field()
class InventarioSchema(ma.SQLAlchemySchema): class Meta: model = Inventario include_fk = True include_relationships = True id = ma.auto_field() parte = ma.Nested(ParteSchema) cantidad = ma.auto_field()
class ReparacionDetalleSchema(ma.SQLAlchemySchema): class Meta: model = ReparacionDetalle include_fk = True id = ma.auto_field() parte = ma.Nested(ParteSchema) reparacion_id = ma.auto_field() cantidad = ma.auto_field()
class TagResponseSchema(ma.SQLAlchemySchema): class Meta: model = TagModel """ Валидационная схема выходных данных """ id = ma.auto_field() name = ma.auto_field() author = ma.Nested(UserResponseSchema)
class NoteResponseSchema(ma.SQLAlchemySchema): class Meta: model = NoteModel id = ma.auto_field() note = ma.auto_field() private = ma.auto_field() date = ma.auto_field() archive = ma.auto_field() author = ma.Nested(UserResponseSchema()) tags = ma.Nested(TagResponseSchema(many=True))
class UsuarioSchema(ma.SQLAlchemySchema): class Meta: model = Usuario include_fk = True include_relationships = True id = ma.auto_field() nombre_usuario = ma.auto_field() tipo_usuario = ma.Nested( TipoUsuarioSchema(exclude=('descripcion', 'usuarios'))) empleado = ma.Nested(EmpleadoSchema(exclude=('usuario', )))
class ParteSchema(ma.SQLAlchemySchema): class Meta: model = Parte include_fk = True include_relationships = True id = ma.auto_field() nombre_parte = ma.auto_field() tipo_parte = ma.Nested( TipoParteSchema(exclude=('descripcion_tipo_parte', 'partes'))) descripcion_parte = ma.auto_field() precio = ma.auto_field()
class UserSchema(ma.SQLAlchemyAutoSchema): class Meta: model = UserModel fields = ('id', 'username') id = ma.auto_field() username = ma.auto_field() _links = ma.Hyperlinks({ 'self': ma.URLFor('userresource', values=dict(user_id="<id>")), 'collection': ma.URLFor('userslistresource') })
class ReparacionSchema(ma.SQLAlchemySchema): class Meta: model = Reparacion include_fk = True include_relationships = True id = ma.auto_field() fecha_realizacion = ma.auto_field() usuario = ma.Nested(UsuarioSchema) cliente = ma.Nested(ClienteSchema) garantia = ma.Nested(GarantiaSchema(exclude=('reparaciones', ))) reparaciones_detalle = ma.Nested( ReparacionDetalleSchema(exclude=('reparacion_id', )), many=True) total = ma.auto_field()
class NoteResponseSchema(ma.SQLAlchemySchema): class Meta: model = NoteModel """ Валидационная схема выходных данных """ id = ma.auto_field() note = ma.auto_field() private = ma.auto_field() date = ma.auto_field() archive = ma.auto_field() author = ma.Nested(UserResponseSchema()) tags = ma.Nested(TagResponseSchema(many=True))
class MessageSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Message id = ma.auto_field() first_name = ma.auto_field() last_name = ma.auto_field() email = ma.auto_field() city_id = ma.auto_field() state_id = ma.auto_field() message_type = ma.auto_field() body = ma.auto_field() date_recieved = ma.auto_field()
class BreedImageSchema(ma.SQLAlchemyAutoSchema): class Meta: model = BreedImage include_relationships = True include_fk = True url_image = ma.auto_field()
class NoteSchema(ma.SQLAlchemySchema): class Meta: model = NoteModel id = ma.auto_field() text = ma.auto_field() private = ma.auto_field() author = ma.Nested(UserSchema()) tags = ma.Nested(TagSchema(many=True)) _links = ma.Hyperlinks({ 'self': ma.URLFor('noteresource', values=dict(note_id="<id>")), 'collection': ma.URLFor('noteslistresource') })
class SearchTeamSchema(ma.SQLAlchemySchema): class Meta: model = SearchTeam uuid = ma.auto_field() search_id = ma.auto_field() team_leader = ma.auto_field() name = ma.auto_field() medic = ma.auto_field() responder_1 = ma.auto_field() responder_2 = ma.auto_field() responder_3 = ma.auto_field()
class TagSchema(ma.SQLAlchemySchema): class Meta: model = TagModel name = ma.auto_field() _links = ma.Hyperlinks({ 'self': ma.URLFor('tagresource', values=dict(tag_id="<id>")), 'collection': ma.URLFor('tagslistresource') })
class BeerSchema(ma.SQLAlchemySchema): class Meta: model = Beer id = ma.auto_field() name = ma.auto_field() price = ma.auto_field() url = ma.auto_field() image = ma.auto_field() supplier = ma.auto_field() brewery = ma.auto_field()
class SearchLogSchema(ma.SQLAlchemySchema): class Meta: model = SearchLog uuid = ma.auto_field() search_id = ma.auto_field() team = ma.auto_field() area = ma.auto_field() start_time = ma.auto_field() end_time = ma.auto_field() notes = ma.auto_field()
class CommsLogSchema(ma.SQLAlchemySchema): class Meta: model = CommsLog uuid = ma.auto_field() search_id = ma.auto_field() time = ma.auto_field() call_sign = ma.auto_field() message = ma.auto_field() action = ma.auto_field()
class BreedSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Breed include_relationships = True id = ma.auto_field() name = ma.auto_field() origin = ma.auto_field() temperament = ma.auto_field() description = ma.auto_field() image = ma.auto_field()
class AnimalSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Animal include_fk = True id = ma.auto_field() nome = ma.auto_field() classe = ma.auto_field() ordem = ma.auto_field() especie = ma.auto_field() protetor_id = ma.auto_field()
class ClienteSchema(ma.SQLAlchemySchema): class Meta: model = Cliente include_relationships = True id = ma.auto_field() nombre = ma.auto_field() apellidos = ma.auto_field() email = ma.auto_field() telefono = ma.auto_field() fecha_registro = ma.auto_field() vehiculo = ma.Nested(VehiculoSchema(exclude=('cliente_id', )))
class VehiculoSchema(ma.SQLAlchemySchema): class Meta: model = Vehiculo include_fk = True include_relationships = True id = ma.auto_field() modelo = ma.auto_field() fecha_fabricacion = ma.auto_field() cliente_id = ma.auto_field() descripcion = ma.auto_field() fecha_registro = ma.auto_field()
class UserSchema(ma.SQLAlchemySchema): class Meta: model = User uuid = ma.auto_field() first_name = ma.auto_field() last_name = ma.auto_field() email = ma.auto_field() phone = ma.auto_field() active = ma.auto_field() app_role = ma.auto_field() rank = ma.auto_field() first_aid = ma.auto_field() updated_at = ma.auto_field() created_at = ma.auto_field()