[copr] master: Rawhide should be formatted differently (6d5c287)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6d5c287d32c4bd7e6ddfcc24b95ec2a6f9ed3fb3
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 15:22:19 2013 +0100
Rawhide should be formatted differently
>---------------------------------------------------------------
coprs_frontend/coprs/filters.py | 8 +++++---
coprs_frontend/coprs/templates/coprs/show.html | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/coprs_frontend/coprs/filters.py b/coprs_frontend/coprs/filters.py
index cfcdcfe..b0d689c 100644
--- a/coprs_frontend/coprs/filters.py
+++ b/coprs_frontend/coprs/filters.py
@@ -13,9 +13,11 @@ def perm_type_from_num(num):
# this should probably be stored in DB with the whole mock_chroot...
@app.template_filter('os_name_short')
-def os_name_short(os_name):
+def os_name_short(os_name, os_version):
+ if os_version == 'rawhide':
+ return os_version
if os_name == 'fedora':
- return 'fc'
+ return 'fc.{0}'.format(os_version)
elif os_name == 'epel':
- return 'el'
+ return 'el'.format(os_version)
return os_name
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index b6f9737..0b98ed1 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -23,7 +23,7 @@
<p>{{ copr.description_or_not_filled }}</p>
<p class="repos">
{% for mock_chroot in copr.mock_chroots %}
- {{ mock_chroot.os_release|os_name_short }}{{ mock_chroot.os_version }}.{{ mock_chroot.arch }}{% if not loop.last %}, {% endif %}
+ {{ mock_chroot.os_release|os_name_short(mock_chroot.os_version) }}.{{ mock_chroot.arch }}{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
</div>
11 years, 3 months
[copr] master: Actually display the chroots in copr list (a157e3a)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit a157e3a2968f11a4486fdf3ec32b5276d992b803
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 15:06:06 2013 +0100
Actually display the chroots in copr list
>---------------------------------------------------------------
coprs_frontend/coprs/filters.py | 9 +++++++++
coprs_frontend/coprs/templates/coprs/show.html | 6 +++++-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/filters.py b/coprs_frontend/coprs/filters.py
index b166bde..cfcdcfe 100644
--- a/coprs_frontend/coprs/filters.py
+++ b/coprs_frontend/coprs/filters.py
@@ -10,3 +10,12 @@ def date_from_secs(secs):
@app.template_filter('perm_type_from_num')
def perm_type_from_num(num):
return helpers.PermissionEnum.key(num)
+
+# this should probably be stored in DB with the whole mock_chroot...
+(a)app.template_filter('os_name_short')
+def os_name_short(os_name):
+ if os_name == 'fedora':
+ return 'fc'
+ elif os_name == 'epel':
+ return 'el'
+ return os_name
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 7b4d3c9..b6f9737 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -21,7 +21,11 @@
<div class="copr">
<a href="{{ url_for('coprs_ns.copr_detail', username = copr.owner.name, coprname = copr.name) }}">{{ copr.owner.name }}/{{ copr.name }}</a>
<p>{{ copr.description_or_not_filled }}</p>
- <p class="repos">F18 blah blah</p>
+ <p class="repos">
+ {% for mock_chroot in copr.mock_chroots %}
+ {{ mock_chroot.os_release|os_name_short }}{{ mock_chroot.os_version }}.{{ mock_chroot.arch }}{% if not loop.last %}, {% endif %}
+ {% endfor %}
+ </p>
</div>
{% else %}
<p>No coprs...</p>
11 years, 3 months
[copr] master: Add logic to retrieve coprs with mock chroots (6c0b204)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6c0b2049aa91a979fa974e40aaf582b77fc235f2
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 15:05:39 2013 +0100
Add logic to retrieve coprs with mock chroots
>---------------------------------------------------------------
coprs_frontend/coprs/logic/coprs_logic.py | 4 ++++
.../coprs/views/coprs_ns/coprs_general.py | 5 ++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/logic/coprs_logic.py b/coprs_frontend/coprs/logic/coprs_logic.py
index c8daebf..917bf6e 100644
--- a/coprs_frontend/coprs/logic/coprs_logic.py
+++ b/coprs_frontend/coprs/logic/coprs_logic.py
@@ -26,6 +26,7 @@ class CoprsLogic(object):
def get_multiple(cls, user, **kwargs):
user_relation = kwargs.get('user_relation', None)
username = kwargs.get('username', None)
+ with_mock_chroots = kwargs.get('with_mock_chroots')
query = db.session.query(models.Copr).\
join(models.Copr.owner).\
@@ -38,6 +39,9 @@ class CoprsLogic(object):
filter(models.CoprPermission.copr_builder == helpers.PermissionEnum.num('approved')).\
join(aliased_user, models.CoprPermission.user).\
filter(aliased_user.openid_name == models.User.openidize_name(username))
+ if with_mock_chroots:
+ query = query.join(*models.Copr.mock_chroots.attr).\
+ options(db.contains_eager(*models.Copr.mock_chroots.attr))
return query
@classmethod
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index c2369d3..80a8be2 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -28,7 +28,10 @@ def coprs_show(page = 1):
@coprs_ns.route('/owned/<username>/', defaults = {'page': 1})
@coprs_ns.route('/owned/<username>/<int:page>/')
def coprs_by_owner(username = None, page = 1):
- query = coprs_logic.CoprsLogic.get_multiple(flask.g.user, user_relation = 'owned', username = username)
+ query = coprs_logic.CoprsLogic.get_multiple(flask.g.user,
+ user_relation='owned',
+ username=username,
+ with_mock_chroots=True)
paginator = helpers.Paginator(query, query.count(), page)
coprs = paginator.sliced_query
11 years, 3 months
[copr] master: Use association proxy for copr<->mock_chroot relation (ba77b9a)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit ba77b9a438c8f4e39b6e0262b6c8705665bc62f5
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 14:44:30 2013 +0100
Use association proxy for copr<->mock_chroot relation
>---------------------------------------------------------------
coprs_frontend/coprs/models.py | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 49e8aee..8b99942 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -1,5 +1,7 @@
import datetime
+from sqlalchemy.ext.associationproxy import association_proxy
+
from coprs import constants
from coprs import db
from coprs import helpers
@@ -116,6 +118,7 @@ class Copr(db.Model, Serializer):
# relations
owner_id = db.Column(db.Integer, db.ForeignKey('user.id'))
owner = db.relationship('User', backref = db.backref('coprs'))
+ mock_chroots = association_proxy('copr_chroots', 'mock_chroot')
@property
def repos_list(self):
@@ -129,18 +132,6 @@ class Copr(db.Model, Serializer):
def instructions_or_not_filled(self):
return self.instructions or 'Instructions not filled in by author.'
- @property
- def mock_chroots(self):
- if not hasattr(self, '_mock_chroots'):
- self._mock_chroots = MockChroot.query.join(CoprChroot).\
- filter(CoprChroot.copr_id==self.id).\
- filter(MockChroot.is_active==True).all()
- self._mock_chroots.sort(cmp=lambda x,y: cmp(x.chroot_name, y.chroot_name))
-
- return self._mock_chroots
-
- __mapper_args__ = {'order_by': id.desc()}
-
class CoprPermission(db.Model, Serializer):
# 0 = nothing, 1 = asked for, 2 = approved
# not using enum, as that translates to varchar on some DBs
11 years, 3 months
[copr] master: Improve the gitignore to ignore .pyo and .swp files (ba4bf02)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit ba4bf02f6a4fe7580c5ab8a237b4450d83bdad8e
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 10:06:27 2013 +0100
Improve the gitignore to ignore .pyo and .swp files
>---------------------------------------------------------------
.gitignore | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0d20b64..0c750bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
*.pyc
+*.pyo
+*.swp
11 years, 3 months
[copr] master: Enable copr description and instructions (b5c7889)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b5c7889abe4516d37f145fba04843e26516ae48d
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 10:04:56 2013 +0100
Enable copr description and instructions
>---------------------------------------------------------------
.../3c3cce7a5fe0_add_copr_desc_and_instruct.py | 28 ++++++++++++++++++++
coprs_frontend/coprs/forms.py | 2 +
coprs_frontend/coprs/models.py | 10 +++++++
.../coprs/templates/coprs/_coprs_forms.html | 6 +++-
.../coprs/templates/coprs/detail/.builds.html.swp | Bin 12288 -> 0 bytes
.../coprs/templates/coprs/detail/overview.html | 4 +-
coprs_frontend/coprs/templates/coprs/show.html | 2 +-
.../coprs/views/coprs_ns/coprs_general.py | 4 +++
8 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/coprs_frontend/alembic/versions/3c3cce7a5fe0_add_copr_desc_and_instruct.py b/coprs_frontend/alembic/versions/3c3cce7a5fe0_add_copr_desc_and_instruct.py
new file mode 100644
index 0000000..a2ec329
--- /dev/null
+++ b/coprs_frontend/alembic/versions/3c3cce7a5fe0_add_copr_desc_and_instruct.py
@@ -0,0 +1,28 @@
+"""empty message
+
+Revision ID: 3c3cce7a5fe0
+Revises: 2fa80e062525
+Create Date: 2013-01-22 09:42:39.037642
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '3c3cce7a5fe0'
+down_revision = '2fa80e062525'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ ### commands auto generated by Alembic - please adjust! ###
+ op.add_column('copr', sa.Column('description', sa.Text(), nullable=True))
+ op.add_column('copr', sa.Column('instructions', sa.Text(), nullable=True))
+ ### end Alembic commands ###
+
+
+def downgrade():
+ ### commands auto generated by Alembic - please adjust! ###
+ op.drop_column('copr', 'instructions')
+ op.drop_column('copr', 'description')
+ ### end Alembic commands ###
diff --git a/coprs_frontend/coprs/forms.py b/coprs_frontend/coprs/forms.py
index cfca500..e5038f2 100644
--- a/coprs_frontend/coprs/forms.py
+++ b/coprs_frontend/coprs/forms.py
@@ -75,6 +75,8 @@ class CoprFormFactory(object):
validators = [wtf.Required(),
wtf.Regexp(re.compile(r'^[\w.-]+$'), message='Name must contain only letters, digits, underscores, dashes and dots.'),
CoprUniqueNameValidator()])
+ description = wtf.TextAreaField('Description')
+ instructions = wtf.TextAreaField('Instructions')
repos = wtf.TextAreaField('Repos',
validators = [UrlListValidator()],
filters = [StringListFilter()])
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 573c472..49e8aee 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -108,6 +108,8 @@ class Copr(db.Model, Serializer):
name = db.Column(db.String(100), nullable = False)
repos = db.Column(db.Text)
created_on = db.Column(db.Integer)
+ description = db.Column(db.Text)
+ instructions = db.Column(db.Text)
# duplicate information, but speeds up a lot and makes queries simpler
build_count = db.Column(db.Integer, default = 0)
@@ -120,6 +122,14 @@ class Copr(db.Model, Serializer):
return self.repos.split()
@property
+ def description_or_not_filled(self):
+ return self.description or 'Description not filled in by author.'
+
+ @property
+ def instructions_or_not_filled(self):
+ return self.instructions or 'Instructions not filled in by author.'
+
+ @property
def mock_chroots(self):
if not hasattr(self, '_mock_chroots'):
self._mock_chroots = MockChroot.query.join(CoprChroot).\
diff --git a/coprs_frontend/coprs/templates/coprs/_coprs_forms.html b/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
index 8c7daa7..b3f6742 100644
--- a/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
+++ b/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
@@ -7,6 +7,8 @@
{{ form.csrf_token }}
{{ render_field(form.id, hidden = True) }}
{{ render_field(form.name, label='Copr Name') }}
+ {{ render_field(form.description, rows=5, cols=50) }}
+ {{ render_field(form.instructions, rows=5, cols=50) }}
<dt class="field-label">Chroots</dt>
{% if form._mock_chroots_error %}
<p class="form-error">{{ form._mock_chroots_error }}</p>
@@ -20,9 +22,9 @@
{% endfor %}
</table>
{% endfor %}
- {{ render_field(form.repos, rows = 10, cols = 50) }}
+ {{ render_field(form.repos, rows=5, cols=50) }}
{% if copr is none %}{# we're creating the copr, so display initial builds area #}
- {{ render_field(form.initial_pkgs, rows = 10, cols = 50) }}
+ {{ render_field(form.initial_pkgs, rows=5, cols=50) }}
{% endif %}
<dt><input type="submit" value="{% if copr %}Update{% else %}Create{% endif %}"></dt>
</dl>
diff --git a/coprs_frontend/coprs/templates/coprs/detail/.builds.html.swp b/coprs_frontend/coprs/templates/coprs/detail/.builds.html.swp
deleted file mode 100644
index bfa2ee8..0000000
Binary files a/coprs_frontend/coprs/templates/coprs/detail/.builds.html.swp and /dev/null differ
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html b/coprs_frontend/coprs/templates/coprs/detail/overview.html
index a07d1ff..0d74561 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -3,9 +3,9 @@
{% block detail_body %}
<h2>Description</h2>
- <div class="shift-right">This is a description...</div>
+ <div class="shift-right">{{ copr.description_or_not_filled }}</div>
<h2>Installation Instructions</h2>
- <div class="shift-right">These are installation instructions...</div>
+ <div class="shift-right">{{ copr.instructions_or_not_filled}}</div>
<h2>Active Releases</h2>
<table class="releases">
<tr>
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 08490af..7b4d3c9 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -20,7 +20,7 @@
{% for copr in coprs %}
<div class="copr">
<a href="{{ url_for('coprs_ns.copr_detail', username = copr.owner.name, coprname = copr.name) }}">{{ copr.owner.name }}/{{ copr.name }}</a>
- <p>description blah blah blah</p>
+ <p>{{ copr.description_or_not_filled }}</p>
<p class="repos">F18 blah blah</p>
</div>
{% else %}
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index a88a7b9..c2369d3 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -59,6 +59,8 @@ def copr_new():
form = forms.CoprFormFactory.create_form_cls()()
if form.validate_on_submit():
copr = models.Copr(name = form.name.data,
+ description = form.description.data,
+ instructions = form.instructions.data,
repos = form.repos.data.replace('\n', ' '),
owner = flask.g.user,
created_on = int(time.time()))
@@ -154,6 +156,8 @@ def copr_update(username, coprname):
# we don't change owner (yet)
copr.name = form.name.data
copr.repos = form.repos.data.replace('\n', ' ')
+ copr.description = form.description.data
+ copr.instructions = form.instructions.data
coprs_logic.CoprsChrootLogic.update_from_names(flask.g.user, copr, form.selected_chroots)
coprs_logic.CoprsLogic.update(flask.g.user, copr, check_for_duplicates = False) # form validation checks for duplicates
11 years, 3 months
[copr] master: Linkify user and copr name in copr description (8701f6b)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8701f6b07cb1b08e4c10641c56063cda2a79fa06
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 09:39:21 2013 +0100
Linkify user and copr name in copr description
>---------------------------------------------------------------
coprs_frontend/coprs/templates/coprs/detail.html | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail.html b/coprs_frontend/coprs/templates/coprs/detail.html
index f332f36..ef0f097 100644
--- a/coprs_frontend/coprs/templates/coprs/detail.html
+++ b/coprs_frontend/coprs/templates/coprs/detail.html
@@ -2,7 +2,10 @@
{% block title %}{{ copr.owner.name }}/{{ copr.name }} Copr{% endblock %}
{% block body %}
- <h1>{{ copr.owner.name }} / <strong>{{ copr.name }}</strong></h1>
+ <h1>
+ <a href="{{ url_for('coprs_ns.coprs_by_owner', username=copr.owner.name) }}">{{ copr.owner.name }}</a> /
+ <strong><a href="{{ url_for('coprs_ns.copr_detail', username=copr.owner.name, coprname=copr.name) }}">{{ copr.name }}</a></strong>
+ </h1>
<div class="horizontal-menu">
<ul>
<li class="{% block overview_selected %}unselected{% endblock %}">
11 years, 3 months
[copr] master: User image is now href pointing to his owned coprs (dfd129f)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit dfd129f122a6705cfed1fcaf36e8998a3d4c086e
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 09:33:36 2013 +0100
User image is now href pointing to his owned coprs
>---------------------------------------------------------------
coprs_frontend/coprs/templates/coprs/show.html | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 9a72d5d..08490af 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -5,7 +5,9 @@
{% block body %}
{% if g.user %}
<div class="user-info">
- <img src="{{ url_for('static', filename='default_user.png') }}" alt="User Image">
+ <a href="{{ url_for('coprs_ns.coprs_by_owner', username=g.user.name) }}" title="My Coprs">
+ <img src="{{ url_for('static', filename='default_user.png') }}" alt="User Image">
+ </a>
<p>{{ g.user.name }}</p>
<p class="coprs-count">{{ g.user.coprs_count }}</p>
<p class="other-text">coprs</p>
11 years, 3 months
[copr] master: If user logs in from url_root, redirect him to his coprs, else to where he was (8296a76)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8296a76f566f50382c98a7e541a18a4515134df6
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 09:28:11 2013 +0100
If user logs in from url_root, redirect him to his coprs, else to where he was
>---------------------------------------------------------------
coprs_frontend/coprs/views/misc.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/views/misc.py b/coprs_frontend/coprs/views/misc.py
index 9640d8b..4dadce9 100644
--- a/coprs_frontend/coprs/views/misc.py
+++ b/coprs_frontend/coprs/views/misc.py
@@ -61,6 +61,9 @@ def create_or_login(resp):
db.session.commit()
flask.flash(u'Welcome, {0}'.format(user.name))
flask.g.user = user
+ redirect_to = oid.get_next_url()
+ if flask.request.url_root == oid.get_next_url():
+ return flask.redirect(flask.url_for('coprs_ns.coprs_by_owner', username=user.name))
return flask.redirect(oid.get_next_url())
11 years, 3 months
[copr] master: Revert displaying user's coprs by default, it's inconsistent and inconvenient (6486407)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6486407d57e2e86eb39baa3035732137dd1b32b0
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 22 09:27:17 2013 +0100
Revert displaying user's coprs by default, it's inconsistent and inconvenient
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 749c6a8..a88a7b9 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -18,10 +18,7 @@ from coprs.logic import coprs_logic
@coprs_ns.route('/', defaults = {'page': 1})
@coprs_ns.route('/<int:page>/')
def coprs_show(page = 1):
- if flask.g.user:
- query = coprs_logic.CoprsLogic.get_multiple(flask.g.user, user_relation='owned', username=flask.g.user.name)
- else:
- query = coprs_logic.CoprsLogic.get_multiple(flask.g.user)
+ query = coprs_logic.CoprsLogic.get_multiple(flask.g.user)
paginator = helpers.Paginator(query, query.count(), page)
coprs = paginator.sliced_query
11 years, 3 months