update location model
This commit is contained in:
parent
7a7fbfb142
commit
db051986a2
@ -5,7 +5,7 @@ from .models import *
|
||||
@admin.register(Location)
|
||||
class LocationAdmin(admin.ModelAdmin):
|
||||
list_display = ('code', 'name', 'city',)
|
||||
fields = ['code', 'name', 'street', 'plz', 'city', 'phone', 'email', 'url', ]
|
||||
fields = ['users', 'code', 'name', 'street', 'plz', 'city', 'phone', 'email', 'url', ]
|
||||
|
||||
|
||||
@admin.register(Client)
|
||||
|
@ -1,13 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-02-01 12:43
|
||||
# Generated by Django 1.10.5 on 2017-02-04 05:47
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('billard', '0001_initial'),
|
||||
]
|
||||
|
||||
@ -24,6 +26,7 @@ class Migration(migrations.Migration):
|
||||
('phone', models.CharField(blank=True, max_length=64, null=True)),
|
||||
('email', models.EmailField(blank=True, max_length=254, null=True)),
|
||||
('url', models.URLField(blank=True, null=True)),
|
||||
('users', models.ManyToManyField(related_name='locations', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-02-01 17:49
|
||||
# Generated by Django 1.10.5 on 2017-02-04 05:48
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-02-01 19:08
|
||||
# Generated by Django 1.10.5 on 2017-02-04 05:48
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
@ -24,5 +24,8 @@ class Migration(migrations.Migration):
|
||||
('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='billard.Client')),
|
||||
('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='billard.Location')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-time_from'],
|
||||
},
|
||||
),
|
||||
]
|
||||
|
@ -1,5 +1,6 @@
|
||||
import uuid
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class LocationData(models.Model):
|
||||
@ -18,6 +19,7 @@ class LocationData(models.Model):
|
||||
|
||||
|
||||
class Location(models.Model):
|
||||
users = models.ManyToManyField(User, related_name='locations')
|
||||
code = models.CharField(max_length=16, unique=True)
|
||||
name = models.CharField(max_length=64, unique=True)
|
||||
street = models.CharField(max_length=64, blank=True, null=True)
|
||||
|
Loading…
Reference in New Issue
Block a user