Adjust settings to silence warnings
This commit is contained in:
parent
0a906b944e
commit
67e47d24a8
5 changed files with 118 additions and 39 deletions
26
example/app/migrations/0001_initial.py
Normal file
26
example/app/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9 on 2016-09-22 16:56
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import multiselectfield.db.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Book',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('categories', multiselectfield.db.fields.MultiSelectField(choices=[(1, 'Handbooks and manuals by discipline'), (2, 'Business books'), (3, 'Books of literary criticism'), (4, 'Books about literary theory'), (5, 'Books about literature')], default=1, max_length=9)),
|
||||
('tags', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('sex', 'Sex'), ('work', 'Work'), ('happy', 'Happy'), ('food', 'Food'), ('field', 'Field'), ('boring', 'Boring'), ('interesting', 'Interesting'), ('huge', 'huge'), ('nice', 'Nice')], max_length=54, null=True)),
|
||||
],
|
||||
),
|
||||
]
|
0
example/app/migrations/__init__.py
Normal file
0
example/app/migrations/__init__.py
Normal file
|
@ -14,12 +14,27 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django import VERSION
|
||||
try:
|
||||
from django.conf.urls import include, patterns, url
|
||||
from django.conf.urls import url
|
||||
|
||||
# Compatibility for Django > 1.8
|
||||
def patterns(prefix, *args):
|
||||
if VERSION < (1, 9):
|
||||
from django.conf.urls import patterns as django_patterns
|
||||
return django_patterns(prefix, *args)
|
||||
elif prefix != '':
|
||||
raise NotImplementedError("You need to update your URLConf for "
|
||||
"Django 1.10, or tweak it to remove the "
|
||||
"prefix parameter")
|
||||
else:
|
||||
return list(args)
|
||||
except ImportError: # Django < 1.4
|
||||
from django.conf.urls.defaults import include, patterns, url
|
||||
from django.conf.urls.defaults import patterns, url
|
||||
|
||||
from .views import app_index
|
||||
|
||||
|
||||
urlpatterns = patterns('app.views',
|
||||
url(r'^$', 'app_index', name='app_index'),
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', app_index, name='app_index'),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue