Commit fd5e2b1d by Daniel Hahler

Sort imports

`isort taggit/**.py tests/**.py`
parent 9b0c9d46
from __future__ import unicode_literals from __future__ import unicode_literals
from django.contrib import admin from django.contrib import admin
from taggit.models import Tag, TaggedItem from taggit.models import Tag, TaggedItem
......
from __future__ import unicode_literals from __future__ import unicode_literals
from django import forms from django import forms
from django.utils.translation import ugettext as _
from django.utils import six from django.utils import six
from django.utils.translation import ugettext as _
from taggit.utils import parse_tags, edit_string_for_tags from taggit.utils import edit_string_for_tags, parse_tags
class TagWidget(forms.TextInput): class TagWidget(forms.TextInput):
......
from __future__ import unicode_literals from __future__ import unicode_literals
from operator import attrgetter from operator import attrgetter
from django import VERSION from django import VERSION
try:
from django.contrib.contenttypes.fields import GenericRelation
except ImportError: # django < 1.7
from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.db import models, router from django.db import models, router
from django.db.models.fields import Field from django.db.models.fields import Field
from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation from django.db.models.fields.related import (add_lazy_relation, ManyToManyRel,
RelatedField)
from django.db.models.related import RelatedObject from django.db.models.related import RelatedObject
from django.utils import six
from django.utils.text import capfirst from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils import six from taggit.forms import TagField
from taggit.models import GenericTaggedItemBase, TaggedItem
from taggit.utils import require_instance_manager
try:
from django.contrib.contenttypes.fields import GenericRelation
except ImportError: # django < 1.7
from django.contrib.contenttypes.generic import GenericRelation
try: try:
from django.db.models.related import PathInfo from django.db.models.related import PathInfo
except ImportError: except ImportError:
pass # PathInfo is not used on Django < 1.6 pass # PathInfo is not used on Django < 1.6
from taggit.forms import TagField
from taggit.models import TaggedItem, GenericTaggedItemBase
from taggit.utils import require_instance_manager
def _model_name(model): def _model_name(model):
......
from __future__ import unicode_literals from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError, models, transaction
from django.db.models.query import QuerySet
from django.template.defaultfilters import slugify as default_slugify
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext
try: try:
from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError: # django < 1.7 except ImportError: # django < 1.7
from django.contrib.contenttypes.generic import GenericForeignKey from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models, IntegrityError, transaction
from django.db.models.query import QuerySet
from django.template.defaultfilters import slugify as default_slugify
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.encoding import python_2_unicode_compatible
try: try:
......
from __future__ import unicode_literals from __future__ import unicode_literals
from django.utils import six
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.functional import wraps from django.utils.functional import wraps
from django.utils import six
def parse_tags(tagstring): def parse_tags(tagstring):
......
...@@ -3,8 +3,7 @@ from __future__ import unicode_literals ...@@ -3,8 +3,7 @@ from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.views.generic.list import ListView from django.views.generic.list import ListView
from taggit.models import Tag, TaggedItem
from taggit.models import TaggedItem, Tag
def tagged_object_list(request, slug, queryset, **kwargs): def tagged_object_list(request, slug, queryset, **kwargs):
......
from __future__ import unicode_literals, absolute_import from __future__ import absolute_import, unicode_literals
from django import forms, VERSION from django import forms, VERSION
from .models import Food, DirectFood, CustomPKFood, OfficialFood from .models import CustomPKFood, DirectFood, Food, OfficialFood
fields = None fields = None
if VERSION >= (1, 6): if VERSION >= (1, 6):
......
...@@ -2,10 +2,9 @@ from __future__ import unicode_literals ...@@ -2,10 +2,9 @@ from __future__ import unicode_literals
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible from django.utils.encoding import python_2_unicode_compatible
from taggit.managers import TaggableManager from taggit.managers import TaggableManager
from taggit.models import (TaggedItemBase, GenericTaggedItemBase, TaggedItem, from taggit.models import (GenericTaggedItemBase, Tag, TagBase, TaggedItem,
TagBase, Tag) TaggedItemBase)
# Ensure that two TaggableManagers with custom through model are allowed. # Ensure that two TaggableManagers with custom through model are allowed.
......
from __future__ import unicode_literals, absolute_import from __future__ import absolute_import, unicode_literals
from unittest import TestCase as UnitTestCase from unittest import TestCase as UnitTestCase
try:
from unittest import skipIf, skipUnless
except:
from django.utils.unittest import skipIf, skipUnless
import django import django
from django.conf import settings from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core import serializers from django.core import serializers
from django.db import connection from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.test import TestCase, TransactionTestCase from django.test import TestCase, TransactionTestCase
from django.utils import six
from django.utils.encoding import force_text from django.utils.encoding import force_text
from taggit.managers import _model_name, _TaggableManager, TaggableManager
from taggit.models import Tag, TaggedItem
from taggit.utils import edit_string_for_tags, parse_tags
from django.contrib.contenttypes.models import ContentType from .forms import CustomPKFoodForm, DirectFoodForm, FoodForm, OfficialFoodForm
from .models import (Article, CustomManager, CustomPKFood, CustomPKHousePet,
CustomPKPet, DirectFood, DirectHousePet, DirectPet, Food,
HousePet, Movie, OfficialFood, OfficialHousePet,
OfficialPet, OfficialTag, OfficialThroughModel, Pet,
Photo, TaggedCustomPKFood, TaggedCustomPKPet, TaggedFood,
TaggedPet)
from taggit.managers import TaggableManager, _TaggableManager, _model_name try:
from taggit.models import Tag, TaggedItem from unittest import skipIf, skipUnless
from .forms import (FoodForm, DirectFoodForm, CustomPKFoodForm, except ImportError:
OfficialFoodForm) from django.utils.unittest import skipIf, skipUnless
from .models import (Food, Pet, HousePet, DirectFood, DirectPet,
DirectHousePet, TaggedFood, CustomPKFood, CustomPKPet, CustomPKHousePet,
TaggedCustomPKFood, OfficialFood, OfficialPet, OfficialHousePet,
OfficialThroughModel, OfficialTag, Photo, Movie, Article, CustomManager)
from taggit.utils import parse_tags, edit_string_for_tags
class BaseTaggingTest(object): class BaseTaggingTest(object):
......
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 sign in to comment