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
9a736ac8
authored
Mar 02, 2014
by
Florian Apolloner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for Django 1.7 migrations.
parent
92d4cbe1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
139 additions
and
71 deletions
+139
-71
CHANGELOG.txt
+15
-3
docs/conf.py
+2
-2
docs/getting_started.txt
+10
-1
docs/index.txt
+11
-3
setup.py
+1
-1
taggit/__init__.py
+1
-1
taggit/migrations/0001_initial.py
+39
-60
taggit/south_migrations/0001_initial.py
+60
-0
taggit/south_migrations/0002_unique_tagnames.py
+0
-0
taggit/south_migrations/__init__.py
+0
-0
No files found.
CHANGELOG.txt
View file @
9a736ac8
Changelog
=========
0.12.0 (XX.XX.XXXX)
~~~~~~~~~~~~~~~~~~~
* **Backwards incompatible:** Support for Django 1.7 migrations. South users
have to set ``SOUTH_MIGRATION_MODULES`` to use ``taggit.south_migrations``
for taggit.
* **Backwards incompatible:** Django's new transaction handling is used on
Django 1.6 and newer.
* **Backwards incompatible:** ``Tag.save`` got changed to opportunistically
try to save the tag and if that fails fall back to selecting existing
similar tags and retry -- if that fails too an ``IntegrityError`` is
raised by the database, your app will have to handle that.
0.11.2 (13.12.2013)
~~~~~~~~~~~~~~~~~~~
* Forbid multiple TaggableManagers via generic foreign keys.
...
...
@@ -22,13 +34,13 @@ Changelog
* Support for Django 1.6 and 1.7.
* Python3 support
* *
Backwards incompatible
* Dropped support for Django < 1.4.5.
* *
*Backwards incompatible:*
* Dropped support for Django < 1.4.5.
* Tag names are unique now, use the provided South migrations to upgrade.
0.9.2
~~~~~
* *
Backwards incompatible
* Forms containing a :class:`TaggableManager` by
* *
*Backwards incompatible:*
* Forms containing a :class:`TaggableManager` by
default now require tags, to change this provide ``blank=True`` to the
:class:`TaggableManager`.
* Now works with Django 1.3 (as of beta-1).
...
...
@@ -41,7 +53,7 @@ Changelog
* When displaying tags always join them with commas, never spaces.
* The docs are now available `online <http://django-taggit.readthedocs.org/>`_.
* Custom ``Tag`` models are now allowed.
* *
Backwards incompatible
* Filtering on tags is no longer
* *
*Backwards incompatible:*
* Filtering on tags is no longer
``filter(tags__in=["foo"])``, it is written
``filter(tags__name__in=["foo"])``.
* Added a German locale.
...
...
docs/conf.py
View file @
9a736ac8
...
...
@@ -45,9 +45,9 @@ copyright = u'2010-2013, Alex Gaynor and others.'
# built documents.
#
# The short X.Y version.
version
=
'0.1
0.0
'
version
=
'0.1
2a1
'
# The full version, including alpha/beta/rc tags.
release
=
'0.1
0.0
'
release
=
'0.1
2a1
'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
...
...
docs/getting_started.txt
View file @
9a736ac8
...
...
@@ -9,7 +9,16 @@ To get started using ``django-taggit`` simply install it with
Add ``"taggit"`` to your project's ``INSTALLED_APPS`` setting.
Run `./manage.py syncdb` or `./manage.py migrate taggit` if using South.
Run `./manage.py syncdb` or `./manage.py migrate` if using migrations.
.. note::
If you are using South you'll have to add the following setting, since
taggit uses Django migrations by default::
SOUTH_MIGRATIONS_MODULES = {
'taggit': 'taggit.south_migrations',
}
And then to any model you want tagging on do the following::
...
...
docs/index.txt
View file @
9a736ac8
...
...
@@ -9,11 +9,19 @@ tagging to your project easy and fun.
.. warning::
Since version 0.10.0 taggit uses South for database migrations.
This means that users who are upgrading to 0.10.0 and up will have to fake the initial migration, like so::
This means that users who are upgrading to 0.10.0 and up will have to fake
the initial migration, like this::
python manage.py migrate taggit --fake 0001
python manage.py migrate
Since version 0.12.0 taggit uses Django migrations by default. South users
have to adjust their settings::
SOUTH_MIGRATIONS_MODULES = {
'taggit': 'taggit.south_migrations',
}
For more information, see `south documentation`__
.. toctree::
...
...
setup.py
View file @
9a736ac8
...
...
@@ -7,7 +7,7 @@ f.close()
setup
(
name
=
'django-taggit'
,
version
=
'0.1
1.2
'
,
version
=
'0.1
2a1
'
,
description
=
'django-taggit is a reusable Django application for simple tagging.'
,
long_description
=
readme
,
author
=
'Alex Gaynor'
,
...
...
taggit/__init__.py
View file @
9a736ac8
VERSION
=
(
0
,
12
,
0
,
'alpha'
,
0
)
VERSION
=
(
0
,
12
,
0
,
'alpha'
,
1
)
taggit/migrations/0001_initial.py
View file @
9a736ac8
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
from
django.db
import
models
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Adding model 'Tag'
db
.
create_table
(
'taggit_tag'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'name'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
)),
(
'slug'
,
self
.
gf
(
'django.db.models.fields.SlugField'
)(
unique
=
True
,
max_length
=
100
)),
))
db
.
send_create_signal
(
'taggit'
,
[
'Tag'
])
# Adding model 'TaggedItem'
db
.
create_table
(
'taggit_taggeditem'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'tag'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'taggit_taggeditem_items'
,
to
=
orm
[
'taggit.Tag'
])),
(
'object_id'
,
self
.
gf
(
'django.db.models.fields.IntegerField'
)(
db_index
=
True
)),
(
'content_type'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'taggit_taggeditem_tagged_items'
,
to
=
orm
[
'contenttypes.ContentType'
])),
))
db
.
send_create_signal
(
'taggit'
,
[
'TaggedItem'
])
def
backwards
(
self
,
orm
):
# Deleting model 'Tag'
db
.
delete_table
(
'taggit_tag'
)
# Deleting model 'TaggedItem'
db
.
delete_table
(
'taggit_taggeditem'
)
models
=
{
'contenttypes.contenttype'
:
{
'Meta'
:
{
'ordering'
:
"('name',)"
,
'unique_together'
:
"(('app_label', 'model'),)"
,
'object_name'
:
'ContentType'
,
'db_table'
:
"'django_content_type'"
},
'app_label'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'model'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
},
'taggit.tag'
:
{
'Meta'
:
{
'object_name'
:
'Tag'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'slug'
:
(
'django.db.models.fields.SlugField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'100'
})
},
'taggit.taggeditem'
:
{
'Meta'
:
{
'object_name'
:
'TaggedItem'
},
'content_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'taggit_taggeditem_tagged_items'"
,
'to'
:
"orm['contenttypes.ContentType']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'object_id'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'db_index'
:
'True'
}),
'tag'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'taggit_taggeditem_items'"
,
'to'
:
"orm['taggit.Tag']"
})
}
}
complete_apps
=
[
'taggit'
]
# encoding: utf8
from
django.db
import
models
,
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'contenttypes'
,
'__first__'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Tag'
,
fields
=
[
(
u'id'
,
models
.
AutoField
(
verbose_name
=
u'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'name'
,
models
.
CharField
(
unique
=
True
,
max_length
=
100
,
verbose_name
=
u'Name'
)),
(
'slug'
,
models
.
SlugField
(
unique
=
True
,
max_length
=
100
,
verbose_name
=
u'Slug'
)),
],
options
=
{
u'verbose_name'
:
u'Tag'
,
u'verbose_name_plural'
:
u'Tags'
,
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'TaggedItem'
,
fields
=
[
(
u'id'
,
models
.
AutoField
(
verbose_name
=
u'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'tag'
,
models
.
ForeignKey
(
to
=
'taggit.Tag'
,
to_field
=
u'id'
)),
(
'object_id'
,
models
.
IntegerField
(
verbose_name
=
u'Object id'
,
db_index
=
True
)),
(
'content_type'
,
models
.
ForeignKey
(
to
=
'contenttypes.ContentType'
,
to_field
=
u'id'
,
verbose_name
=
u'Content type'
)),
],
options
=
{
u'verbose_name'
:
u'Tagged Item'
,
u'verbose_name_plural'
:
u'Tagged Items'
,
},
bases
=
(
models
.
Model
,),
),
]
taggit/south_migrations/0001_initial.py
0 → 100644
View file @
9a736ac8
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
from
django.db
import
models
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Adding model 'Tag'
db
.
create_table
(
'taggit_tag'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'name'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
)),
(
'slug'
,
self
.
gf
(
'django.db.models.fields.SlugField'
)(
unique
=
True
,
max_length
=
100
)),
))
db
.
send_create_signal
(
'taggit'
,
[
'Tag'
])
# Adding model 'TaggedItem'
db
.
create_table
(
'taggit_taggeditem'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'tag'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'taggit_taggeditem_items'
,
to
=
orm
[
'taggit.Tag'
])),
(
'object_id'
,
self
.
gf
(
'django.db.models.fields.IntegerField'
)(
db_index
=
True
)),
(
'content_type'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'taggit_taggeditem_tagged_items'
,
to
=
orm
[
'contenttypes.ContentType'
])),
))
db
.
send_create_signal
(
'taggit'
,
[
'TaggedItem'
])
def
backwards
(
self
,
orm
):
# Deleting model 'Tag'
db
.
delete_table
(
'taggit_tag'
)
# Deleting model 'TaggedItem'
db
.
delete_table
(
'taggit_taggeditem'
)
models
=
{
'contenttypes.contenttype'
:
{
'Meta'
:
{
'ordering'
:
"('name',)"
,
'unique_together'
:
"(('app_label', 'model'),)"
,
'object_name'
:
'ContentType'
,
'db_table'
:
"'django_content_type'"
},
'app_label'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'model'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
},
'taggit.tag'
:
{
'Meta'
:
{
'object_name'
:
'Tag'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'slug'
:
(
'django.db.models.fields.SlugField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'100'
})
},
'taggit.taggeditem'
:
{
'Meta'
:
{
'object_name'
:
'TaggedItem'
},
'content_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'taggit_taggeditem_tagged_items'"
,
'to'
:
"orm['contenttypes.ContentType']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'object_id'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'db_index'
:
'True'
}),
'tag'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'taggit_taggeditem_items'"
,
'to'
:
"orm['taggit.Tag']"
})
}
}
complete_apps
=
[
'taggit'
]
taggit/migrations/0002_unique_tagnames.py
→
taggit/
south_
migrations/0002_unique_tagnames.py
View file @
9a736ac8
File moved
taggit/south_migrations/__init__.py
0 → 100644
View file @
9a736ac8
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