1 from django.db import models
2 from django.contrib.contenttypes.models import ContentType
3 from django.contrib.auth.models import User
4 from south.db import db
15 Book = db.mock_model(model_name='Book', db_table='catalogue_book', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField)
16 db.create_table('catalogue_book', (
17 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
18 ('title', models.CharField(_('title'), max_length=120)),
19 ('slug', models.SlugField(_('slug'), max_length=120, unique=True, db_index=True)),
20 ('description', models.TextField(_('description'), blank=True)),
21 ('created_at', models.DateTimeField(_('creation date'), auto_now=True)),
22 ('_short_html', models.TextField(_('short HTML'), editable=False)),
23 ('parent_number', models.IntegerField(_('parent number'), default=0)),
24 ('xml_file', models.FileField(_('XML file'), blank=True)),
25 ('html_file', models.FileField(_('HTML file'), blank=True)),
26 ('pdf_file', models.FileField(_('PDF file'), blank=True)),
27 ('odt_file', models.FileField(_('ODT file'), blank=True)),
28 ('txt_file', models.FileField(_('TXT file'), blank=True)),
29 ('parent', models.ForeignKey(Book, blank=True, null=True, related_name='children')),
33 Fragment = db.mock_model(model_name='Fragment', db_table='catalogue_fragment', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField)
34 db.create_table('catalogue_fragment', (
35 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
36 ('text', models.TextField()),
37 ('short_text', models.TextField(editable=False)),
38 ('_short_html', models.TextField(editable=False)),
39 ('anchor', models.CharField(max_length=120)),
40 ('book', models.ForeignKey(Book, related_name='fragments')),
44 Tag = db.mock_model(model_name='Tag', db_table='catalogue_tag', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField)
45 db.create_table('catalogue_tag', (
46 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
47 ('name', models.CharField(_('name'), max_length=50, db_index=True)),
48 ('slug', models.SlugField(_('slug'), max_length=120, unique=True, db_index=True)),
49 ('sort_key', models.SlugField(_('sort key'), max_length=120, db_index=True)),
50 ('category', models.CharField(_('category'), max_length=50, blank=False, null=False, db_index=True)),
51 ('description', models.TextField(_('description'), blank=True)),
52 ('main_page', models.BooleanField(_('main page'), default=False, db_index=True, help_text=_('Show tag on main page'))),
53 ('user', models.ForeignKey(User, blank=True, null=True)),
54 ('book_count', models.IntegerField(_('book count'), default=0, blank=False, null=False)),
58 TagRelation = db.mock_model(model_name='TagRelation', db_table='catalogue_tag_relation', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField)
59 db.create_table('catalogue_tag_relation', (
60 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
61 ('tag', models.ForeignKey(Tag, verbose_name=_('tag'), related_name='items')),
62 ('content_type', models.ForeignKey(ContentType, verbose_name=_('content type'))),
63 ('object_id', models.PositiveIntegerField(_('object id'), db_index=True)),
66 db.send_create_signal('catalogue', ['Book','Fragment'])
69 db.delete_table('catalogue_tag_relation')
70 db.delete_table('catalogue_tag')
71 db.delete_table('catalogue_fragment')
72 db.delete_table('catalogue_book')