Commit 9a736ac8 by Florian Apolloner

Added support for Django 1.7 migrations.

parent 92d4cbe1
Changelog 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) 0.11.2 (13.12.2013)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
* Forbid multiple TaggableManagers via generic foreign keys. * Forbid multiple TaggableManagers via generic foreign keys.
...@@ -22,13 +34,13 @@ Changelog ...@@ -22,13 +34,13 @@ Changelog
* Support for Django 1.6 and 1.7. * Support for Django 1.6 and 1.7.
* Python3 support * 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. * Tag names are unique now, use the provided South migrations to upgrade.
0.9.2 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 default now require tags, to change this provide ``blank=True`` to the
:class:`TaggableManager`. :class:`TaggableManager`.
* Now works with Django 1.3 (as of beta-1). * Now works with Django 1.3 (as of beta-1).
...@@ -41,7 +53,7 @@ Changelog ...@@ -41,7 +53,7 @@ Changelog
* When displaying tags always join them with commas, never spaces. * When displaying tags always join them with commas, never spaces.
* The docs are now available `online <http://django-taggit.readthedocs.org/>`_. * The docs are now available `online <http://django-taggit.readthedocs.org/>`_.
* Custom ``Tag`` models are now allowed. * 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__in=["foo"])``, it is written
``filter(tags__name__in=["foo"])``. ``filter(tags__name__in=["foo"])``.
* Added a German locale. * Added a German locale.
......
...@@ -45,9 +45,9 @@ copyright = u'2010-2013, Alex Gaynor and others.' ...@@ -45,9 +45,9 @@ copyright = u'2010-2013, Alex Gaynor and others.'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.10.0' version = '0.12a1'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.10.0' release = '0.12a1'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
...@@ -9,7 +9,16 @@ To get started using ``django-taggit`` simply install it with ...@@ -9,7 +9,16 @@ To get started using ``django-taggit`` simply install it with
Add ``"taggit"`` to your project's ``INSTALLED_APPS`` setting. 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:: And then to any model you want tagging on do the following::
......
...@@ -9,11 +9,19 @@ tagging to your project easy and fun. ...@@ -9,11 +9,19 @@ tagging to your project easy and fun.
.. warning:: .. warning::
Since version 0.10.0 taggit uses South for database migrations. 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 taggit --fake 0001
python manage.py migrate 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`__ For more information, see `south documentation`__
.. toctree:: .. toctree::
......
...@@ -7,7 +7,7 @@ f.close() ...@@ -7,7 +7,7 @@ f.close()
setup( setup(
name='django-taggit', name='django-taggit',
version='0.11.2', version='0.12a1',
description='django-taggit is a reusable Django application for simple tagging.', description='django-taggit is a reusable Django application for simple tagging.',
long_description=readme, long_description=readme,
author='Alex Gaynor', author='Alex Gaynor',
......
VERSION = (0, 12, 0, 'alpha', 0) VERSION = (0, 12, 0, 'alpha', 1)
# -*- coding: utf-8 -*- # encoding: utf8
import datetime from django.db import models, migrations
from south.db import db
from south.v2 import SchemaMigration
from django.db import models class Migration(migrations.Migration):
dependencies = [
class Migration(SchemaMigration): ('contenttypes', '__first__'),
]
def forwards(self, orm):
# Adding model 'Tag' operations = [
db.create_table('taggit_tag', ( migrations.CreateModel(
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), name='Tag',
('name', self.gf('django.db.models.fields.CharField')(max_length=100)), fields=[
('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=100)), (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')),
db.send_create_signal('taggit', ['Tag']) ('slug', models.SlugField(unique=True, max_length=100, verbose_name=u'Slug')),
],
# Adding model 'TaggedItem' options={
db.create_table('taggit_taggeditem', ( u'verbose_name': u'Tag',
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), u'verbose_name_plural': u'Tags',
('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)), bases=(models.Model,),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='taggit_taggeditem_tagged_items', to=orm['contenttypes.ContentType'])), ),
)) migrations.CreateModel(
db.send_create_signal('taggit', ['TaggedItem']) name='TaggedItem',
fields=[
(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key=True)),
def backwards(self, orm): ('tag', models.ForeignKey(to='taggit.Tag', to_field=u'id')),
# Deleting model 'Tag' ('object_id', models.IntegerField(verbose_name=u'Object id', db_index=True)),
db.delete_table('taggit_tag') ('content_type', models.ForeignKey(to='contenttypes.ContentType', to_field=u'id', verbose_name=u'Content type')),
],
# Deleting model 'TaggedItem' options={
db.delete_table('taggit_taggeditem') u'verbose_name': u'Tagged Item',
u'verbose_name_plural': u'Tagged Items',
},
models = { bases=(models.Model,),
'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']
# -*- 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']
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