nowy model

This commit is contained in:
Jędrzej Klepacki 2021-01-01 17:55:17 +01:00
parent a40df66886
commit fcf5db8bb8
4 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# Generated by Django 3.1.4 on 2021-01-01 16:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('homepage', '0003_places'),
]
operations = [
migrations.CreateModel(
name='Ocena',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comm', models.TextField(default='', max_length=40)),
('ocena_jedn', models.FloatField(default='', max_length=40)),
('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]

View File

@ -29,3 +29,8 @@ class Product(models.Model):
class Places(models.Model): class Places(models.Model):
city = models.TextField(max_length=40, blank=False, default="") city = models.TextField(max_length=40, blank=False, default="")
woj_city = models.TextField(max_length=40, blank=False, default="") woj_city = models.TextField(max_length=40, blank=False, default="")
class Ocena(models.Model):
user_iden = models.ForeignKey(User, on_delete=models.CASCADE)
comm = models.TextField(max_length=40, blank=False, default="")
ocena_jedn = models.FloatField(max_length=40, blank=False, default="")