1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 08:00:00 +00:00

More E501 line too long - multiple files

nyaa/backend.py:75
nyaa/forms.py:129,175
nyaa/models.py:88
This commit is contained in:
sharkykh 2017-05-14 11:14:47 +03:00 committed by Kfir Hadas
parent a3be6ee89f
commit 5e60847cb6
3 changed files with 9 additions and 5 deletions

View file

@ -72,7 +72,8 @@ def handle_torrent_upload(upload_form, uploading_user=None):
models.UserLevelType.TRUSTED) if uploading_user else False
# Set category ids
torrent.main_category_id, torrent.sub_category_id = upload_form.category.parsed_data.get_category_ids()
torrent.main_category_id, torrent.sub_category_id = \
upload_form.category.parsed_data.get_category_ids()
# print('Main cat id: {0}, Sub cat id: {1}'.format(
# torrent.main_category_id, torrent.sub_category_id))

View file

@ -126,7 +126,8 @@ class DisabledSelectField(SelectField):
class EditForm(FlaskForm):
display_name = TextField('Torrent display name', [
Length(min=3, max=255,
message='Torrent display name must be at least %(min)d characters long and %(max)d at most.')
message='Torrent display name must be at least %(min)d characters long '
'and %(max)d at most.')
])
category = DisabledSelectField('Category')
@ -172,7 +173,8 @@ class UploadForm(FlaskForm):
display_name = TextField('Torrent display name (optional)', [
Optional(),
Length(min=3, max=255,
message='Torrent display name must be at least %(min)d characters long and %(max)d at most.')
message='Torrent display name must be at least %(min)d characters long and '
'%(max)d at most.')
])
# category = SelectField('Category')

View file

@ -85,8 +85,9 @@ class Torrent(db.Model):
main_category = db.relationship('MainCategory', uselist=False,
back_populates='torrents', lazy="joined")
sub_category = db.relationship('SubCategory', uselist=False, backref='torrents', lazy="joined",
primaryjoin="and_(SubCategory.id == foreign(Torrent.sub_category_id), "
"SubCategory.main_category_id == Torrent.main_category_id)")
primaryjoin=(
"and_(SubCategory.id == foreign(Torrent.sub_category_id), "
"SubCategory.main_category_id == Torrent.main_category_id)"))
info = db.relationship('TorrentInfo', uselist=False, back_populates='torrent')
filelist = db.relationship('TorrentFilelist', uselist=False, back_populates='torrent')
stats = db.relationship('Statistic', uselist=False, back_populates='torrent', lazy='joined')