Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-taggit
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fd5e2b1d
authored
Aug 10, 2014
by
Daniel Hahler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort imports
`isort taggit/**.py tests/**.py`
parent
9b0c9d46
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
46 deletions
+44
-46
taggit/admin.py
+0
-1
taggit/forms.py
+2
-3
taggit/managers.py
+12
-9
taggit/models.py
+7
-5
taggit/utils.py
+1
-1
taggit/views.py
+1
-2
tests/forms.py
+2
-3
tests/models.py
+2
-3
tests/tests.py
+17
-19
No files found.
taggit/admin.py
View file @
fd5e2b1d
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
...
...
taggit/forms.py
View file @
fd5e2b1d
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
):
...
...
taggit/managers.py
View file @
fd5e2b1d
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
):
...
...
taggit/models.py
View file @
fd5e2b1d
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
:
...
...
taggit/utils.py
View file @
fd5e2b1d
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
):
...
...
taggit/views.py
View file @
fd5e2b1d
...
@@ -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
):
...
...
tests/forms.py
View file @
fd5e2b1d
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
):
...
...
tests/models.py
View file @
fd5e2b1d
...
@@ -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
,
GenericTaggedItem
Base
,
TaggedItem
,
from
taggit.models
import
(
GenericTaggedItemBase
,
Tag
,
Tag
Base
,
TaggedItem
,
TagBase
,
Tag
)
TaggedItemBase
)
# Ensure that two TaggableManagers with custom through model are allowed.
# Ensure that two TaggableManagers with custom through model are allowed.
...
...
tests/tests.py
View file @
fd5e2b1d
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment