Make Grid.gridify() use only pickup addresses
- ensure a `Restaurant` only has one unique `Order.pickup_address` - rework `Grid.gridify()` so that only pickup addresses are assigned into `Pixel`s - include database migrations to ensure the data adhere to these tighter constraints
This commit is contained in:
parent
0c1ff5338d
commit
1bfc7db916
11 changed files with 519 additions and 61 deletions
|
|
@ -34,10 +34,12 @@ class Restaurant(meta.Base):
|
|||
'0 <= estimated_prep_duration AND estimated_prep_duration <= 2400',
|
||||
name='realistic_estimated_prep_duration',
|
||||
),
|
||||
# Needed by a `ForeignKeyConstraint` in `Order`.
|
||||
sa.UniqueConstraint('id', 'address_id'),
|
||||
)
|
||||
|
||||
# Relationships
|
||||
address = orm.relationship('Address', back_populates='restaurant')
|
||||
address = orm.relationship('Address', back_populates='restaurants')
|
||||
orders = orm.relationship('Order', back_populates='restaurant')
|
||||
|
||||
def __repr__(self) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue