add goal to campaign
This commit is contained in:
parent
39e5127f3f
commit
0b78e121a2
1 changed files with 5 additions and 1 deletions
|
|
@ -19,8 +19,12 @@ class Campaign(db.Model):
|
|||
id = Column('id', INTEGER(), primary_key=True)
|
||||
title = Column('title', TEXT(), nullable=False)
|
||||
active = Column('active', Boolean(), nullable=False, default=True)
|
||||
goal = Column('goal', INTEGER(), default=0)
|
||||
|
||||
def get_donations(self):
|
||||
from app.main.models import Donation
|
||||
return Donation.query.filter_by(campaign_id=self.id).all()
|
||||
|
||||
# donations = db.relationship('Donation', backref='campaign', lazy='dynamic')
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"{self.id} - {self.title}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue