Skip to content

Commit

Permalink
Fix #17
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Posselt committed Jun 25, 2016
1 parent e6c8028 commit 0581c4a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
6 changes: 5 additions & 1 deletion docs/restapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ This route will return all releases to display inside Nextcloud's apps admin are
}
],
"recommendations": 100,
"featured": false,
"userDocs": "http://127.0.0.1:8000/user",
"adminDocs": "http://127.0.0.1:8000/admin",
"developerDocs": "http://127.0.0.1:8000/dev",
Expand Down Expand Up @@ -135,7 +136,10 @@ checksum
The checksum is generated by running sha256sum over the downloaded archive.

recommendations
Who many users recommend the app
How many users recommend the app

featured
Simple boolean flag which will be presented to the user as "hey take a look at this app". Does not imply that it has been reviewed or we recommend it officially

.. _api-delete-app:

Expand Down
2 changes: 1 addition & 1 deletion nextcloudappstore/core/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Meta:
fields = (
'id', 'categories', 'user_docs', 'admin_docs', 'developer_docs',
'issue_tracker', 'website', 'created', 'last_modified', 'releases',
'screenshots', 'translations', 'recommendations'
'screenshots', 'translations', 'recommendations', 'featured'
)

def get_recommendations(self, obj):
Expand Down
27 changes: 14 additions & 13 deletions nextcloudappstore/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-24 15:09
# Generated by Django 1.9.7 on 2016-06-25 16:08
from __future__ import unicode_literals

from django.conf import settings
Expand Down Expand Up @@ -28,10 +28,11 @@ class Migration(migrations.Migration):
('website', models.URLField(blank=True, max_length=256, verbose_name='Homepage')),
('created', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
('last_modified', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
('featured', models.BooleanField(default=False, verbose_name='Featured')),
],
options={
'verbose_name': 'App',
'verbose_name_plural': 'Apps',
'verbose_name': 'App',
},
bases=(parler.models.TranslatableModelMixin, models.Model),
),
Expand All @@ -50,9 +51,9 @@ class Migration(migrations.Migration):
('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='releases', to='core.App', verbose_name='App')),
],
options={
'verbose_name_plural': 'App Releases',

This comment has been minimized.

Copy link
@jancborchardt

jancborchardt Jun 27, 2016

Member

Btw @BernhardPosselt since I saw it here – we always only capitalize the first character of a title. Here it would be »App releases« and that also goes for the other verbose name versions. :)

This comment has been minimized.

Copy link
@BernhardPosselt

BernhardPosselt Jun 27, 2016

Member

This string is only rendered as title of a section in the admin interface atm, that's why its capitalized ;)

This comment has been minimized.

Copy link
@jancborchardt

jancborchardt Jun 27, 2016

Member

Especially there too we only capitalize the first character/word. ;)

'verbose_name': 'App Release',
'ordering': ['-version'],
'verbose_name_plural': 'App Releases',
},
),
migrations.CreateModel(
Expand All @@ -65,9 +66,9 @@ class Migration(migrations.Migration):
('master', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='core.App')),
],
options={
'verbose_name': 'App Translation',
'db_tablespace': '',
'managed': True,
'verbose_name': 'App Translation',
'db_table': 'core_app_translation',
'default_permissions': (),
},
Expand All @@ -80,8 +81,8 @@ class Migration(migrations.Migration):
('last_modified', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
],
options={
'verbose_name': 'Category',
'verbose_name_plural': 'Categories',
'verbose_name': 'Category',
},
bases=(parler.models.TranslatableModelMixin, models.Model),
),
Expand All @@ -95,9 +96,9 @@ class Migration(migrations.Migration):
('master', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='core.Category')),
],
options={
'verbose_name': 'Category Translation',
'db_tablespace': '',
'managed': True,
'verbose_name': 'Category Translation',
'db_table': 'core_category_translation',
'default_permissions': (),
},
Expand All @@ -109,8 +110,8 @@ class Migration(migrations.Migration):
('name', models.CharField(help_text='Database name which will be presented to the user', max_length=128, verbose_name='Name')),
],
options={
'verbose_name': 'Database',
'verbose_name_plural': 'Databases',
'verbose_name': 'Database',
},
),
migrations.CreateModel(
Expand All @@ -122,8 +123,8 @@ class Migration(migrations.Migration):
('database', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='releasedependencies', to='core.Database', verbose_name='Database')),
],
options={
'verbose_name': 'Database Dependency',
'verbose_name_plural': 'Database Dependencies',
'verbose_name': 'Database Dependency',
},
),
migrations.CreateModel(
Expand All @@ -133,8 +134,8 @@ class Migration(migrations.Migration):
('name', models.CharField(help_text='License name which will be presented to the user', max_length=128, verbose_name='Name')),
],
options={
'verbose_name': 'License',
'verbose_name_plural': 'Licenses',
'verbose_name': 'License',
},
),
migrations.CreateModel(
Expand All @@ -143,8 +144,8 @@ class Migration(migrations.Migration):
('id', models.CharField(help_text='e.g. libxml', max_length=128, primary_key=True, serialize=False, unique=True, verbose_name='PHP extension')),
],
options={
'verbose_name': 'PHP Extension',
'verbose_name_plural': 'PHP Extensions',
'verbose_name': 'PHP Extension',
},
),
migrations.CreateModel(
Expand All @@ -156,8 +157,8 @@ class Migration(migrations.Migration):
('php_extension', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='releasedependencies', to='core.PhpExtension', verbose_name='PHP Extension')),
],
options={
'verbose_name': 'PHP Extension Dependency',
'verbose_name_plural': 'PHP Extension Dependencies',
'verbose_name': 'PHP Extension Dependency',
},
),
migrations.CreateModel(
Expand All @@ -169,9 +170,9 @@ class Migration(migrations.Migration):
('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='screenshots', to='core.App', verbose_name='App')),
],
options={
'verbose_name_plural': 'Screenshots',
'verbose_name': 'Screenshot',
'ordering': ['ordering'],
'verbose_name_plural': 'Screenshots',
},
),
migrations.CreateModel(
Expand All @@ -180,8 +181,8 @@ class Migration(migrations.Migration):
('name', models.CharField(help_text='Name of a required shell command, e.g. grep', max_length=128, primary_key=True, serialize=False, unique=True, verbose_name='Shell Command')),
],
options={
'verbose_name': 'Shell Command',
'verbose_name_plural': 'Shell Commands',
'verbose_name': 'Shell Command',
},
),
migrations.AddField(
Expand Down
3 changes: 2 additions & 1 deletion nextcloudappstore/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.contrib.auth.models import User # type: ignore
from django.db.models import ManyToManyField, ForeignKey, \
URLField, IntegerField, CharField, CASCADE, TextField, \
DateTimeField, Model # type: ignore
DateTimeField, Model, BooleanField # type: ignore
from django.utils.translation import ugettext_lazy as _ # type: ignore
from parler.models import TranslatedFields, TranslatableModel # type: ignore

Expand Down Expand Up @@ -40,6 +40,7 @@ class App(TranslatableModel):
recommendations = ManyToManyField(settings.AUTH_USER_MODEL, blank=True,
verbose_name=_('Recommendations'),
related_name='recommended_apps')
featured = BooleanField(verbose_name=_('Featured'), default=False)

class Meta:
verbose_name = _('App')
Expand Down

0 comments on commit 0581c4a

Please sign in to comment.