From c0695cec64b69128e40b7d23fe3aae389f591f7a Mon Sep 17 00:00:00 2001
From: Chif Gergo <chifgeri97@gmail.com>
Date: Mon, 25 Sep 2017 20:41:01 +0200
Subject: [PATCH] stats app letrehozva es 2 osztaly elkezdve: User,
 Kepzes_alkalom

---
 src/kszkepzes/settings.py                     |  1 +
 src/stats/__init__.py                         |  0
 src/stats/admin.py                            |  6 +++
 src/stats/apps.py                             |  5 +++
 src/stats/migrations/0001_initial.py          | 25 +++++++++++
 .../migrations/0002_auto_20170925_1936.py     | 42 +++++++++++++++++++
 .../migrations/0003_auto_20170925_1938.py     | 20 +++++++++
 src/stats/migrations/__init__.py              |  0
 src/stats/models.py                           | 16 +++++++
 src/stats/tests.py                            |  3 ++
 src/stats/views.py                            |  3 ++
 11 files changed, 121 insertions(+)
 create mode 100644 src/stats/__init__.py
 create mode 100644 src/stats/admin.py
 create mode 100644 src/stats/apps.py
 create mode 100644 src/stats/migrations/0001_initial.py
 create mode 100644 src/stats/migrations/0002_auto_20170925_1936.py
 create mode 100644 src/stats/migrations/0003_auto_20170925_1938.py
 create mode 100644 src/stats/migrations/__init__.py
 create mode 100644 src/stats/models.py
 create mode 100644 src/stats/tests.py
 create mode 100644 src/stats/views.py

diff --git a/src/kszkepzes/settings.py b/src/kszkepzes/settings.py
index 71222b1..a1b9ce8 100644
--- a/src/kszkepzes/settings.py
+++ b/src/kszkepzes/settings.py
@@ -39,6 +39,7 @@ INSTALLED_APPS = [
     'django.contrib.staticfiles',
     'django_extensions',
     'rest_framework',
+    'stats'
 ]
 
 MIDDLEWARE = [
diff --git a/src/stats/__init__.py b/src/stats/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/src/stats/admin.py b/src/stats/admin.py
new file mode 100644
index 0000000..2efd55f
--- /dev/null
+++ b/src/stats/admin.py
@@ -0,0 +1,6 @@
+from django.contrib import admin
+from .models import User, Kepzes_alkalom
+
+admin.site.register(User)
+admin.site.register(Kepzes_alkalom)
+# Register your models here.
diff --git a/src/stats/apps.py b/src/stats/apps.py
new file mode 100644
index 0000000..2d09b92
--- /dev/null
+++ b/src/stats/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class StatsConfig(AppConfig):
+    name = 'stats'
diff --git a/src/stats/migrations/0001_initial.py b/src/stats/migrations/0001_initial.py
new file mode 100644
index 0000000..7223baa
--- /dev/null
+++ b/src/stats/migrations/0001_initial.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.5 on 2017-09-24 23:01
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='User',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('user_name', models.CharField(max_length=50)),
+                ('year_of_kepzes', models.IntegerField()),
+                ('megjegyzes', models.TextField()),
+            ],
+        ),
+    ]
diff --git a/src/stats/migrations/0002_auto_20170925_1936.py b/src/stats/migrations/0002_auto_20170925_1936.py
new file mode 100644
index 0000000..635748e
--- /dev/null
+++ b/src/stats/migrations/0002_auto_20170925_1936.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.5 on 2017-09-25 17:36
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('stats', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Kepzes_alkalom',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('idopont', models.DateField()),
+                ('letszam', models.IntegerField()),
+            ],
+        ),
+        migrations.RenameField(
+            model_name='user',
+            old_name='user_name',
+            new_name='felhaszbalo_nev',
+        ),
+        migrations.RenameField(
+            model_name='user',
+            old_name='year_of_kepzes',
+            new_name='kepzes_eve',
+        ),
+        migrations.RemoveField(
+            model_name='user',
+            name='megjegyzes',
+        ),
+        migrations.AddField(
+            model_name='kepzes_alkalom',
+            name='resztvevok',
+            field=models.ManyToManyField(to='stats.User'),
+        ),
+    ]
diff --git a/src/stats/migrations/0003_auto_20170925_1938.py b/src/stats/migrations/0003_auto_20170925_1938.py
new file mode 100644
index 0000000..48c1c7e
--- /dev/null
+++ b/src/stats/migrations/0003_auto_20170925_1938.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.5 on 2017-09-25 17:38
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('stats', '0002_auto_20170925_1936'),
+    ]
+
+    operations = [
+        migrations.RenameField(
+            model_name='user',
+            old_name='felhaszbalo_nev',
+            new_name='felhasznalo_nev',
+        ),
+    ]
diff --git a/src/stats/migrations/__init__.py b/src/stats/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/src/stats/models.py b/src/stats/models.py
new file mode 100644
index 0000000..cc03443
--- /dev/null
+++ b/src/stats/models.py
@@ -0,0 +1,16 @@
+from django.db import models
+
+# Create your models here.
+class User(models.Model):
+    felhasznalo_nev = models.CharField(max_length=50)
+    kepzes_eve = models.IntegerField()
+    email_cim = models.EmailField()
+    profilkep = models.ImageField()
+
+    def __str__(self):
+        return self.felhasznalo_nev
+
+class Kepzes_alkalom(models.Model):
+    idopont = models.DateField()
+    letszam = models.IntegerField()
+    resztvevok = models.ManyToManyField(User)
diff --git a/src/stats/tests.py b/src/stats/tests.py
new file mode 100644
index 0000000..7ce503c
--- /dev/null
+++ b/src/stats/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/src/stats/views.py b/src/stats/views.py
new file mode 100644
index 0000000..91ea44a
--- /dev/null
+++ b/src/stats/views.py
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
-- 
GitLab