mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 12:50:01 +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:
parent
a3be6ee89f
commit
5e60847cb6
|
@ -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))
|
||||||
|
|
||||||
|
|
|
@ -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')
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Reference in a new issue