diff --git a/src/document/__init__.py b/src/document/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/document/admin.py b/src/document/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..8c38f3f3dad51e4585f3984282c2a4bec5349c1e --- /dev/null +++ b/src/document/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/src/document/apps.py b/src/document/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..fd7bdcbc212e8f61f09df30815616ecc6074ea8a --- /dev/null +++ b/src/document/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class DocumentConfig(AppConfig): + name = 'document' diff --git a/src/document/migrations/0001_initial.py b/src/document/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..1982261b5587cc0c2c527977925709598452aeac --- /dev/null +++ b/src/document/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 2.0.1 on 2018-05-28 15:21 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('account', '0017_auto_20180205_2004'), + ] + + operations = [ + migrations.CreateModel( + name='Document', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('uploaded_at', models.DateTimeField(auto_now_add=True)), + ('name', models.CharField(max_length=150)), + ('description', models.TextField()), + ('file', models.FileField(upload_to='')), + ('uploaded_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='account.Profile')), + ], + ), + ] diff --git a/src/document/migrations/__init__.py b/src/document/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/document/models.py b/src/document/models.py new file mode 100644 index 0000000000000000000000000000000000000000..e2c30e36742be70a2cb4b4f9b429dcde73eab4c5 --- /dev/null +++ b/src/document/models.py @@ -0,0 +1,14 @@ +from django.db import models + +from account.models import Profile + + +class Document(models.Model): + uploaded_by = models.ForeignKey(Profile, on_delete=models.DO_NOTHING) + uploaded_at = models.DateTimeField(auto_now_add=True, editable=False) + name = models.CharField(max_length=150) + description = models.TextField() + file = models.FileField() + + def __str__(self): + return self.name diff --git a/src/document/tests.py b/src/document/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..7ce503c2dd97ba78597f6ff6e4393132753573f6 --- /dev/null +++ b/src/document/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/src/document/views.py b/src/document/views.py new file mode 100644 index 0000000000000000000000000000000000000000..91ea44a218fbd2f408430959283f0419c921093e --- /dev/null +++ b/src/document/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/src/kszkepzes/settings/base.py b/src/kszkepzes/settings/base.py index 277106b310ad176aa7268075d2b0a6e099ff2a22..dd73603a60b94e23ef0f7892f885ff713c32de67 100644 --- a/src/kszkepzes/settings/base.py +++ b/src/kszkepzes/settings/base.py @@ -47,6 +47,7 @@ INSTALLED_APPS = [ 'account', 'stats', 'news', + 'document', ] MIDDLEWARE = [