Initial content as generated from scaffold
This commit is contained in:
commit
9b0bbb74c2
27 changed files with 748 additions and 0 deletions
12
rattail_tutorial/db/model/__init__.py
Normal file
12
rattail_tutorial/db/model/__init__.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
# -*- coding: utf-8; mode: python; -*-
|
||||
"""
|
||||
Rattail Tutorial data models
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
# bring in all the normal stuff from Rattail
|
||||
from rattail.db.model import *
|
||||
|
||||
# add Rattail Tutorial models
|
||||
from .core import Rattail_tutorialCustomer
|
43
rattail_tutorial/db/model/core.py
Normal file
43
rattail_tutorial/db/model/core.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
# -*- coding: utf-8; mode: python -*-
|
||||
"""
|
||||
Rattail core data model extensions
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
||||
from rattail.db import model
|
||||
from rattail.db.core import uuid_column
|
||||
|
||||
|
||||
class Rattail_tutorialCustomer(model.Base):
|
||||
"""
|
||||
Rattail Tutorial extensions to core Customer model
|
||||
"""
|
||||
__tablename__ = 'rattail_tutorial_customer'
|
||||
__table_args__ = (
|
||||
sa.ForeignKeyConstraint(['uuid'], ['customer.uuid'], name='rattail_tutorial_customer_fk_customer'),
|
||||
)
|
||||
|
||||
uuid = uuid_column(default=None)
|
||||
|
||||
customer = orm.relationship(
|
||||
model.Customer,
|
||||
doc="""
|
||||
Customer to which this extension record pertains.
|
||||
""",
|
||||
backref=orm.backref(
|
||||
'_rattail_tutorial',
|
||||
uselist=False,
|
||||
cascade='all, delete-orphan',
|
||||
doc="""
|
||||
Rattail Tutorial-specific extension record for the customer.
|
||||
"""),
|
||||
)
|
||||
|
||||
mail_list_synced = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
|
||||
Flag indicating whether the customer's email address has been synced to the
|
||||
general mailing list.
|
||||
""")
|
Loading…
Add table
Add a link
Reference in a new issue