fix warning about relationship confilicts
Conflict between Consumable.vehicles and Vehicle.consumables resolved by making the Consumable.vehicles a read only relationship since we add consumables only to vehicles. Consumable.vehicles is used in the admin view to check if a consumable can be deleted safely.
This commit is contained in:
parent
80264f1d02
commit
0791a23d8c
@ -164,7 +164,7 @@ class Consumable(db.Model):
|
||||
name = db.Column(db.String(255), unique=True)
|
||||
unit = db.Column(db.String(255))
|
||||
|
||||
vehicles = db.relationship("Vehicle", secondary=vehicles_consumables)
|
||||
vehicles = db.relationship("Vehicle", secondary=vehicles_consumables, viewonly=True)
|
||||
|
||||
def __init__(self, name, unit):
|
||||
self.name = name
|
||||
|
Loading…
Reference in New Issue
Block a user