Commit b67fda5d authored by Florent Chehab's avatar Florent Chehab
Browse files

Models reorgranization (again)

parent 9e62f092
from .DictModeViewSet import DictModeViewSet # noqa: F401
from .jSONField import JSONField # noqa: F401
from .mySerializerWithJSON import MySerializerWithJSON # noqa: F401
from .jSONField import JSONField
from backend.fields.jSONField import JSONField
from rest_framework import serializers
field_mapping = serializers.ModelSerializer.serializer_field_mapping
......
from .jSONField import JSONField # noqa: F401
# taken from : https://github.com/devkral/django-simple-jsonfield
# inspired by : https://github.com/devkral/django-simple-jsonfield
# MIT license
from django.core.exceptions import ValidationError
from django.db import models
......
This diff is collapsed.
# Generated by Django 2.0.3 on 2018-09-09 13:47
import backend.models.tools.jSONField
import backend.fields.jSONField
from django.db import migrations, models
......@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='campustaggeditem',
name='usefull_links',
field=backend.models.tools.jSONField.JSONField(default=list),
field=backend.fields.jSONField.JSONField(default=list),
),
migrations.AddField(
model_name='citytaggeditem',
......@@ -39,7 +39,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='citytaggeditem',
name='usefull_links',
field=backend.models.tools.jSONField.JSONField(default=list),
field=backend.fields.jSONField.JSONField(default=list),
),
migrations.AddField(
model_name='countrytaggeditem',
......@@ -54,7 +54,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='countrytaggeditem',
name='usefull_links',
field=backend.models.tools.jSONField.JSONField(default=list),
field=backend.fields.jSONField.JSONField(default=list),
),
migrations.AddField(
model_name='universitytaggeditem',
......@@ -69,6 +69,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='universitytaggeditem',
name='usefull_links',
field=backend.models.tools.jSONField.JSONField(default=list),
field=backend.fields.jSONField.JSONField(default=list),
),
]
# Generated by Django 2.0.3 on 2018-09-10 08:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0003_auto_20180909_1547'),
]
operations = [
migrations.AlterUniqueTogether(
name='campustaggeditem',
unique_together={('campus', 'tag', 'importance_level')},
),
migrations.AlterUniqueTogether(
name='citytaggeditem',
unique_together={('city', 'tag', 'importance_level')},
),
migrations.AlterUniqueTogether(
name='countrytaggeditem',
unique_together={('country', 'tag', 'importance_level')},
),
migrations.AlterUniqueTogether(
name='universitytaggeditem',
unique_together={('university', 'tag', 'importance_level')},
),
]
from django.db import models
from backend.models.my_model import MyModelVersionned, MyModelVersionnedSerializer, MyModelVersionnedViewSet
from backend.models.tools import JSONField
from backend.models.abstract.my_model import MyModelVersionned, MyModelVersionnedSerializer, MyModelVersionnedViewSet
from backend.fields import JSONField
from backend.validators.tag import validate_content_against_config
from backend.validators.tag.tags_config import USEFULL_LINKS_CONFIG
......
......@@ -7,7 +7,7 @@ from .myModel import MyModel
from .pendingModeration import PendingModerationSerializer
from backend.utils import get_user_level
from backend.permissions import is_moderation_required
from backend.models.tools import MySerializerWithJSON
from backend.custom import MySerializerWithJSON
CLEANED_MY_MODEL_DATA = {
'moderated_by': None,
......
from backend.models.my_model import MyModel, MyModelSerializer, MyModelViewSet
from backend.models.abstract.my_model import MyModel, MyModelSerializer, MyModelViewSet
from backend.signals import new_revision_saved
from rest_framework import serializers, mixins, viewsets
import reversion
......@@ -7,7 +7,7 @@ from django.contrib.contenttypes.models import ContentType
from django.core.serializers.base import DeserializationError
from django.core import serializers as djangoSerializers
from backend.utils import get_viewset_permissions
from backend.models.tools import MySerializerWithJSON
from backend.custom import MySerializerWithJSON
class MyModelVersionned(MyModel):
......
from .myModelSerializer import MyModelSerializer
from backend.permissions import DEFAULT_VIEWSET_PERMISSIONS
from backend.models.tools import DictModeViewSet
from backend.custom import DictModeViewSet
class MyModelViewSet(DictModeViewSet):
......
......@@ -2,10 +2,10 @@ from django.db import models
from rest_framework import serializers, viewsets
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from backend.models.tools import JSONField
from backend.fields import JSONField
from django.contrib.auth.models import User
from backend.utils import get_viewset_permissions, get_model_config
from backend.models.tools import MySerializerWithJSON
from backend.custom import MySerializerWithJSON
class PendingModeration(models.Model):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment