add repr to class models and exploring relationships
This commit is contained in:
parent
936a88f264
commit
67264b3da6
11 changed files with 155 additions and 17 deletions
|
|
@ -14,7 +14,13 @@ class User(db.Model, UserMixin):
|
|||
email = Column('email', TEXT(), nullable=False, unique=True)
|
||||
password = Column('password', TEXT(), nullable=False)
|
||||
user_type = Column('user_type', TEXT(), nullable=False)
|
||||
donation_id = Column(INTEGER, ForeignKey('donation.id'))
|
||||
donations = db.relationship('Donation', backref='user', lazy='dynamic')
|
||||
|
||||
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"{self.id} - {self.first_name} - {self.last_name}"
|
||||
# donation_id = Column(INTEGER, ForeignKey('donation.id'))
|
||||
|
||||
def get_reset_token(self, expiration=600):
|
||||
reset_token = jwt.encode(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue