More changes brought through testing.
This commit is contained in:
parent
40e727f5bf
commit
c22ecf44ec
9 changed files with 149 additions and 11 deletions
18
test_app/models.py
Normal file
18
test_app/models.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from sqlalchemy import Column, String, Integer, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
from crudkit.core.base import CRUDMixin
|
||||
from test_app.db import Base
|
||||
|
||||
class User(CRUDMixin, Base):
|
||||
__tablename__ = 'users'
|
||||
name = Column(String)
|
||||
email = Column(String)
|
||||
supervisor_id = Column(Integer, ForeignKey('users.id'))
|
||||
supervisor = relationship('User', remote_side='User.id')
|
||||
|
||||
class Device(CRUDMixin, Base):
|
||||
__tablename__ = 'devices'
|
||||
name = Column(String)
|
||||
serial = Column(String)
|
||||
assigned_to_id = Column(Integer, ForeignKey('users.id'))
|
||||
assigned_to = relationship('User')
|
||||
Loading…
Add table
Add a link
Reference in a new issue