Skip to content

Commit

Permalink
style(db.models): Sub: add type hint stubs for foreign keys
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <i@rong.moe>
  • Loading branch information
Rongronggg9 committed Jul 27, 2024
1 parent 8bc1fa4 commit 43454e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ class Sub(Model, Base):
'0=deactivated, 1=activated')
user: fields.ForeignKeyRelation['User'] = \
fields.ForeignKeyField('models.User', related_name='subs', to_field='id', on_delete=fields.CASCADE)
user_id: int # type hint stub
feed: fields.ForeignKeyRelation['Feed'] = \
fields.ForeignKeyField('models.Feed', related_name='subs', to_field='id', on_delete=fields.CASCADE)
feed_id: int # type hint stub
title = fields.CharField(max_length=1024, null=True, description='Sub title, overriding feed title if set')
tags = fields.CharField(max_length=255, null=True, description='Tags of the sub')
interval = fields.SmallIntField(null=True, description='Interval of the sub monitor task, '
Expand Down

0 comments on commit 43454e5

Please sign in to comment.