diff --git a/nextcloudappstore/core/fixtures/categories.yaml b/nextcloudappstore/core/fixtures/categories.yaml index 8d238f53f2..99766f10e8 100644 --- a/nextcloudappstore/core/fixtures/categories.yaml +++ b/nextcloudappstore/core/fixtures/categories.yaml @@ -1,20 +1,20 @@ - model: core.category - pk: games + pk: tools fields: - name: Games -- model: core.category - pk: multimedia - fields: - name: Multimedia -- model: core.category - pk: pim - fields: - name: PIM + name: Tools - model: core.category pk: productivity fields: name: Productivity - model: core.category - pk: tools + pk: pim fields: - name: Tools + name: PIM +- model: core.category + pk: multimedia + fields: + name: Multimedia +- model: core.category + pk: games + fields: + name: Games diff --git a/nextcloudappstore/core/fixtures/databases.yaml b/nextcloudappstore/core/fixtures/databases.yaml new file mode 100644 index 0000000000..56c32105f9 --- /dev/null +++ b/nextcloudappstore/core/fixtures/databases.yaml @@ -0,0 +1,12 @@ +- model: core.database + pk: sqlite + fields: + name: SQLite +- model: core.database + pk: mysql + fields: + name: MySQL +- model: core.database + pk: pgsql + fields: + name: PostgreSQL diff --git a/nextcloudappstore/core/migrations/0001_initial.py b/nextcloudappstore/core/migrations/0001_initial.py index 5c660355e4..f71c5b876d 100644 --- a/nextcloudappstore/core/migrations/0001_initial.py +++ b/nextcloudappstore/core/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-06-05 18:31 +# Generated by Django 1.9.7 on 2016-06-05 19:33 from __future__ import unicode_literals from django.db import migrations, models @@ -33,7 +33,7 @@ class Migration(migrations.Migration): name='AppRelease', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('version', models.CharField(max_length=128, unique=True)), + ('version', models.CharField(max_length=128)), ('php_min', models.CharField(max_length=32)), ('php_max', models.CharField(blank=True, max_length=32)), ('platform_min', models.CharField(max_length=32)), @@ -56,22 +56,31 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Category', fields=[ - ('id', models.CharField(max_length=128, primary_key=True, serialize=False, unique=True)), - ('name', models.CharField(max_length=128, unique=True)), + ('id', models.CharField(help_text='Category id which is used to identify a category. Used to identify categories when uploading an app', max_length=128, primary_key=True, serialize=False, unique=True)), + ('name', models.CharField(help_text='Category name which will be presented to the user', max_length=128)), ], + options={ + 'verbose_name_plural': 'Categories', + 'verbose_name': 'Category', + }, ), migrations.CreateModel( name='Command', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=128, unique=True)), + ('name', models.CharField(help_text='Name of a required shell command, e.g. grep', max_length=128, unique=True)), ], ), migrations.CreateModel( name='Database', fields=[ - ('id', models.CharField(max_length=128, primary_key=True, serialize=False, unique=True)), + ('id', models.CharField(help_text='Key which is used to identify a database', max_length=128, primary_key=True, serialize=False, unique=True)), + ('name', models.CharField(help_text='Database name which will be presented to the user', max_length=128)), ], + options={ + 'verbose_name_plural': 'Databases', + 'verbose_name': 'Database', + }, ), migrations.CreateModel( name='DatabaseDependency', diff --git a/nextcloudappstore/core/models.py b/nextcloudappstore/core/models.py index b8fafe2345..c74394eabd 100644 --- a/nextcloudappstore/core/models.py +++ b/nextcloudappstore/core/models.py @@ -21,7 +21,7 @@ class App(models.Model): class AppRelease(models.Model): - version = models.CharField(max_length=128, unique=True) + version = models.CharField(max_length=128) app = models.ForeignKey('App', on_delete=models.CASCADE) # dependencies libs = models.ManyToManyField('PhpLibrary', through='LibraryDependency') @@ -48,20 +48,42 @@ class Author(models.Model): class Command(models.Model): - name = models.CharField(max_length=128, unique=True) + name = models.CharField(max_length=128, unique=True, help_text=_( + 'Name of a required shell command, e.g. grep')) class Category(models.Model): - id = models.CharField(max_length=128, unique=True, primary_key=True) + id = models.CharField(max_length=128, unique=True, primary_key=True, + help_text=_( + 'Category id which is used to identify a ' + 'category. Used to identify categories when ' + 'uploading an app')) # possible l10n - name = models.CharField(max_length=128, unique=True) + name = models.CharField(max_length=128, help_text=_( + 'Category name which will be presented to the user')) + + class Meta: + verbose_name = _('Category') + verbose_name_plural = _('Categories') def __str__(self): return self.name class Database(models.Model): - id = models.CharField(max_length=128, unique=True, primary_key=True) + id = models.CharField(max_length=128, unique=True, primary_key=True, + help_text=_( + 'Key which is used to identify a database')) + # possible l10n + name = models.CharField(max_length=128, help_text=_( + 'Database name which will be presented to the user')) + + class Meta: + verbose_name = _('Database') + verbose_name_plural = _('Databases') + + def __str__(self): + return self.name class DatabaseDependency(models.Model):