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 models.UserLevelType.TRUSTED) if uploading_user else False
# Set category ids # 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( # print('Main cat id: {0}, Sub cat id: {1}'.format(
# torrent.main_category_id, torrent.sub_category_id)) # torrent.main_category_id, torrent.sub_category_id))

View File

@ -126,7 +126,8 @@ class DisabledSelectField(SelectField):
class EditForm(FlaskForm): class EditForm(FlaskForm):
display_name = TextField('Torrent display name', [ display_name = TextField('Torrent display name', [
Length(min=3, max=255, 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') category = DisabledSelectField('Category')
@ -172,7 +173,8 @@ class UploadForm(FlaskForm):
display_name = TextField('Torrent display name (optional)', [ display_name = TextField('Torrent display name (optional)', [
Optional(), Optional(),
Length(min=3, max=255, 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') # category = SelectField('Category')

View File

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