-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from igorkramaric/django-1.9
Django 1.9
- Loading branch information
Showing
18 changed files
with
326 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from jsonate.utils import jsonate | ||
from . import monkey_patches | ||
from .utils import jsonate | ||
|
||
default_app_config = 'jsonate.apps.JsonateAppConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.apps import AppConfig | ||
|
||
class JsonateAppConfig(AppConfig): | ||
name = 'jsonate' | ||
|
||
def ready(self): | ||
# from . import monkey_patches | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import django | ||
django_19 = (django.VERSION >= (1,9)) | ||
django_18 = (django.VERSION >= (1,8)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
#!/usr/bin/env python | ||
import os | ||
|
||
try: | ||
import settings # Assumed to be in the same directory. | ||
|
||
except ImportError: | ||
import sys | ||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) | ||
sys.exit(1) | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings") | ||
|
||
try: | ||
from django.core.management import execute_from_command_line | ||
execute_from_command_line() | ||
|
||
except ImportError: | ||
from django.core.management import execute_manager | ||
execute_manager(settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9 on 2015-12-15 14:16 | ||
from __future__ import unicode_literals | ||
|
||
import datetime | ||
from decimal import Decimal | ||
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), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='MyModel', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('normal_field1', models.CharField(default=b'field1', max_length=25)), | ||
('normal_field2', models.CharField(default=b'field2', max_length=25)), | ||
('sensitive_field1', models.CharField(default=b'sensitive', max_length=25)), | ||
('datetime_field', models.DateTimeField(default=datetime.datetime(2011, 1, 11, 11, 11, 11))), | ||
('date_field', models.DateField(default=datetime.date(2011, 1, 11))), | ||
('decimal_field', models.DecimalField(decimal_places=2, default=Decimal('32.25'), max_digits=10)), | ||
('float_field', models.FloatField(default=32.25)), | ||
('file_field', models.FileField(upload_to=b'files')), | ||
('image_field', models.ImageField(upload_to=b'images')), | ||
('boolean_field', models.BooleanField(default=True)), | ||
('null_field', models.NullBooleanField(default=None)), | ||
('foreign_key', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
test_project/test_app/migrations/0002_mymodelwithjsonatefield.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
import jsonate.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('test_app', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='MyModelWithJsonateField', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('some_name', models.CharField(max_length=255)), | ||
('some_json_data', jsonate.fields.JsonateField(null=True, blank=True)), | ||
], | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
test_project/test_app/migrations/0003_withjsonatefieldexpectinglist.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
import jsonate.fields | ||
import test_app.models | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('test_app', '0002_mymodelwithjsonatefield'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='WithJsonateFieldExpectingList', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('some_name', models.CharField(max_length=255)), | ||
('some_json_data', jsonate.fields.JsonateField(default=list, validators=[test_app.models.validate_list])), | ||
], | ||
), | ||
] |
Empty file.
Oops, something went wrong.