From 2f63307cb20f5f1b2c5e2342bab021f3361ee9b9 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sun, 5 Jun 2016 14:25:20 +0200 Subject: [PATCH] Add travis --- .gitignore | 3 ++- .travis.yml | 5 +++++ Makefile | 3 ++- README.md | 3 +++ nextcloudappstore/core/models.py | 30 +++++++++++++++--------------- 5 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index 04f6a42e50..684fb4c8a7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ tests/report/ venv .idea *.iml -nextcloudappstore/local_settings.py \ No newline at end of file +nextcloudappstore/local_settings.py +db.sqlite3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index fa7de71191..65def1244c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,10 @@ python: before_install: - pip install pep8 mypy-lang +install: + - pip install -r requirements.txt + - python manage.py makemigrations + - python manage.py migrate + script: - make test \ No newline at end of file diff --git a/Makefile b/Makefile index 4e98b69db4..33deed9d11 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,3 @@ test: - pep8 nextcloudappstore \ No newline at end of file + pep8 nextcloudappstore + python3 manage.py test \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000..d3f8a666e2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Nextcloud App Store + +[![Build Status](https://travis-ci.org/nextcloud/appstore.svg?branch=master)](https://travis-ci.org/nextcloud/appstore) \ No newline at end of file diff --git a/nextcloudappstore/core/models.py b/nextcloudappstore/core/models.py index e44d658d57..fc18dc81bb 100644 --- a/nextcloudappstore/core/models.py +++ b/nextcloudappstore/core/models.py @@ -3,10 +3,10 @@ from django.utils.translation import ugettext_lazy as _ class App(models.Model): - id = models.CharField(max_length=128, unique=True, + id = models.CharField(max_length=128, unique=True, primary_key=True, help_text=_('app id, same as the folder name')) - categories = models.ManyToManyField(Category) - authors = models.ManyToManyField(Author) + categories = models.ManyToManyField('Category') + authors = models.ManyToManyField('Author') # possible l10n candidates name = models.CharField(max_length=128) description = models.TextField() @@ -22,10 +22,10 @@ class App(models.Model): class AppRelease(models.Model): version = models.CharField(max_length=128, unique=True) - app = models.ForeignKey(App, on_delete=models.CASCADE) + app = models.ForeignKey('App', on_delete=models.CASCADE) # dependencies - libs = models.ManyToManyField(Library, through='LibraryDependency') - databases = models.ManyToManyField(Database, through='DatabaseDependency') + libs = models.ManyToManyField('PhpLibrary', through='LibraryDependency') + databases = models.ManyToManyField('Database', through='DatabaseDependency') php_min = models.CharField(max_length=32) php_max = models.CharField(max_length=32, blank=True) platform_min = models.CharField(max_length=32) @@ -37,7 +37,7 @@ class AppRelease(models.Model): class Screenshot(models.Model): image = models.URLField(max_length=256) - app = models.ForeignKey(App, on_delete=models.CASCADE) + app = models.ForeignKey('App', on_delete=models.CASCADE) class Author(models.Model): @@ -51,28 +51,28 @@ class Command(models.Model): class Category(models.Model): - id = models.CharField(max_length=128, unique=True) + id = models.CharField(max_length=128, unique=True, primary_key=True) # possible l10n name = models.CharField(max_length=128, unique=True) class Database(models.Model): - id = models.CharField(max_length=128, unique=True) + id = models.CharField(max_length=128, unique=True, primary_key=True) class DatabaseDependency(models.Model): - app = models.ForeignKey(AppRelease, on_delete=models.CASCADE) - database = models.ForeignKey(Database, on_delete=models.CASCADE) + app = models.ForeignKey('AppRelease', on_delete=models.CASCADE) + database = models.ForeignKey('Database', on_delete=models.CASCADE) version_min = models.CharField(max_length=32) version_max = models.CharField(max_length=32, blank=True) -class Library(models.Model): - id = models.CharField(max_length=128, unique=True) +class PhpLibrary(models.Model): + id = models.CharField(max_length=128, unique=True, primary_key=True) class LibraryDependency(models.Model): - app_release = models.ForeignKey(AppRelease, on_delete=models.CASCADE) - library = models.ForeignKey(Library, on_delete=models.CASCADE) + app_release = models.ForeignKey('AppRelease', on_delete=models.CASCADE) + library = models.ForeignKey('PhpLibrary', on_delete=models.CASCADE) version_min = models.CharField(max_length=32) version_max = models.CharField(max_length=32, blank=True)