--- a/.hgignore Tue Dec 08 19:49:41 2009 +0100
+++ b/.hgignore Wed Dec 09 12:21:45 2009 +0100
@@ -25,4 +25,6 @@
syntax: regexp
^parts$
syntax: regexp
-^bin$
\ No newline at end of file
+^bin$
+syntax: regexp
+^recreate$
\ No newline at end of file
--- a/.pydevproject Tue Dec 08 19:49:41 2009 +0100
+++ b/.pydevproject Wed Dec 09 12:21:45 2009 +0100
@@ -5,6 +5,6 @@
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/comt/src</path>
+<path>/comt2/src</path>
</pydev_pathproperty>
</pydev_project>
--- a/README.txt Tue Dec 08 19:49:41 2009 +0100
+++ b/README.txt Wed Dec 09 12:21:45 2009 +0100
@@ -25,16 +25,19 @@
------------
- python (GPL compatible license)
- python magic (permissive BSD style license)
+- python development headers (GPL compatible license)
- python setuptools (PSF or ZPL - GPL compatible)
- python uno (GPL)
- pandoc
- headless openoffice
+- git (GPL)
+- libyaml (permissive license)
(all other python dependencies will be downloaded by buildout)
Installation (development install)
============
-1. Install python2.5+ and all required python libraries
- (ubuntu users : 'sudo apt-get install python python-magic python-setuptools python-uno')
+1. Install python2.5+ and all required libraries
+ (ubuntu users : 'sudo apt-get install python python-magic python-setuptools python-uno libyaml-0-1 python-dev git-core')
2. Install pandoc
(ubuntu users : 'sudo apt-get install pandoc')
3. Install openoffice (headless mode) [used for document conversion]
@@ -66,6 +69,7 @@
- edit settings_local.py to suit your settings (search for 'YOUR_SETTINGS' occurrences, those are mandatory settings)
8. Create the database structure (and test your database connection)
- `./bin/django syncdb --settings=settings`
+ - `./bin/django migrate --settings=settings`
9. Create basic right management system
- `./bin/django loaddata roles_generic --settings=settings`
10. Launch development server
@@ -76,6 +80,20 @@
=============
If you'd like to install Comt on a production environment, check out django installation guide at http://www.djangoproject.com/documentation/modpython/
+Upgrade
+=======
+
+Normal upgrade
+--------------
+Upgrading you database should only need one command:
+ - `./bin/django migrate --settings=settings`
+
+Upgrade from alpha releases
+----------------------------
+If your database was created using comt alpha prior to the revision 29, here are the commands you should run:
+ - `./bin/django migrate cm 0001_initial --skip`
+ - `./bin/django migrate migrate`
+
Openoffice
==========
Comt uses openoffice to convert documents from ODT, MS Word, etc. to html.
--- a/buildout.cfg Tue Dec 08 19:49:41 2009 +0100
+++ b/buildout.cfg Wed Dec 09 12:21:45 2009 +0100
@@ -35,6 +35,7 @@
pytz
simplejson
pyyaml
+ south
# psycopg2/mysql should be optional dependencies ... possible with buildout ???
# magic ???????? http://www.jsnp.net/code/magic.py ??? impossible to include this dependency
# utidylib ?????? http://download.berlios.de/utidylib/uTidylib-0.2.zip
--- a/settings_local_sample.py Tue Dec 08 19:49:41 2009 +0100
+++ b/settings_local_sample.py Wed Dec 09 12:21:45 2009 +0100
@@ -5,7 +5,7 @@
YUI_DEBUG = DEBUG # use expanded yui version (i.e. not -min)
YUI_DISTANT = False
-DATABASE_ENGINE = 'postgresql' # YOUR_SETTINGS # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_ENGINE = 'postgresql_psycopg2' # YOUR_SETTINGS # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'db_name' # YOUR_SETTINGS # Or path to database file if using sqlite3.
DATABASE_USER = 'db_user' # YOUR_SETTINGS # Not used with sqlite3.
DATABASE_PASSWORD = 'db_pw' # YOUR_SETTINGS # Not used with sqlite3.
--- a/src/cm/fixtures/test_content.yaml Tue Dec 08 19:49:41 2009 +0100
+++ b/src/cm/fixtures/test_content.yaml Wed Dec 09 12:21:45 2009 +0100
@@ -16,6 +16,7 @@
user: 1
key: "up_key_1"
adminkey: "up_adminkey_1"
+ created: "2009-02-13 04:01:12"
# user2
@@ -32,6 +33,7 @@
user: 2
key: "up_key_2"
adminkey: "up_adminkey_2"
+ created: "2009-02-13 04:01:12"
# user3
@@ -48,6 +50,7 @@
user: 3
key: "up_key_3"
adminkey: "up_adminkey_3"
+ created: "2009-02-13 04:01:12"
# user4
@@ -64,6 +67,7 @@
user: 4
key: "up_key_4"
adminkey: "up_adminkey_4"
+ created: "2009-02-13 04:01:12"
# user5
@@ -81,6 +85,7 @@
user: 5
key: "up_key_5"
adminkey: "up_adminkey_5"
+ created: "2009-02-13 04:01:12"
# user6: pending user
@@ -99,6 +104,7 @@
key: "up_key_6"
adminkey: "up_adminkey_6"
is_suspended: True
+ created: "2009-02-13 04:01:12"
############### texts ###############
--- a/src/cm/media/css/base.css Tue Dec 08 19:49:41 2009 +0100
+++ b/src/cm/media/css/base.css Wed Dec 09 12:21:45 2009 +0100
@@ -42,7 +42,7 @@
/*background: #FFFFFF url(../img/header_bg2.png) repeat-x scroll
top bottom;*/
- height: 45px;
+ height: 25px;
margin: 0 auto 5px;
position: relative;
/*border-color: -moz-use-text-color -moz-use-text-color #BBB;
@@ -55,7 +55,7 @@
}
#header_controls {
- margin-top: 10px;
+ margin-top: 2px;
float: right;
}
@@ -374,7 +374,7 @@
/* jquery custom overrides */
#main-tabs, #text-tabs {
- margin-top: 20px;
+ margin-top: 10px;
border : none ;
padding : 0 ;
}
@@ -389,7 +389,7 @@
#main-tabs .ui-tabs-nav li a, #text-tabs .ui-tabs-nav li a {
- padding:0.4em 2em;
+ padding:0.3em 1.7em;
}
.text-meta {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/migrations/0001_initial.py Wed Dec 09 12:21:45 2009 +0100
@@ -0,0 +1,383 @@
+
+from south.db import db
+from django.db import models
+from cm.models import *
+
+class Migration:
+
+ def forwards(self, orm):
+
+ # Adding model 'Notification'
+ db.create_table('cm_notification', (
+ ('id', orm['cm.Notification:id']),
+ ('key', orm['cm.Notification:key']),
+ ('adminkey', orm['cm.Notification:adminkey']),
+ ('user', orm['cm.Notification:user']),
+ ('name', orm['cm.Notification:name']),
+ ('email', orm['cm.Notification:email']),
+ ('text', orm['cm.Notification:text']),
+ ('type', orm['cm.Notification:type']),
+ ('active', orm['cm.Notification:active']),
+ ))
+ db.send_create_signal('cm', ['Notification'])
+
+ # Adding model 'Activity'
+ db.create_table('cm_activity', (
+ ('id', orm['cm.Activity:id']),
+ ('created', orm['cm.Activity:created']),
+ ('originator_user', orm['cm.Activity:originator_user']),
+ ('text', orm['cm.Activity:text']),
+ ('text_version', orm['cm.Activity:text_version']),
+ ('comment', orm['cm.Activity:comment']),
+ ('user', orm['cm.Activity:user']),
+ ('type', orm['cm.Activity:type']),
+ ('ip', orm['cm.Activity:ip']),
+ ))
+ db.send_create_signal('cm', ['Activity'])
+
+ # Adding model 'Comment'
+ db.create_table('cm_comment', (
+ ('id', orm['cm.Comment:id']),
+ ('key', orm['cm.Comment:key']),
+ ('adminkey', orm['cm.Comment:adminkey']),
+ ('deleted', orm['cm.Comment:deleted']),
+ ('state', orm['cm.Comment:state']),
+ ('user', orm['cm.Comment:user']),
+ ('name', orm['cm.Comment:name']),
+ ('email', orm['cm.Comment:email']),
+ ('modified', orm['cm.Comment:modified']),
+ ('created', orm['cm.Comment:created']),
+ ('text_version', orm['cm.Comment:text_version']),
+ ('reply_to', orm['cm.Comment:reply_to']),
+ ('title', orm['cm.Comment:title']),
+ ('content', orm['cm.Comment:content']),
+ ('content_html', orm['cm.Comment:content_html']),
+ ('format', orm['cm.Comment:format']),
+ ('tags', orm['cm.Comment:tags']),
+ ('start_wrapper', orm['cm.Comment:start_wrapper']),
+ ('end_wrapper', orm['cm.Comment:end_wrapper']),
+ ('start_offset', orm['cm.Comment:start_offset']),
+ ('end_offset', orm['cm.Comment:end_offset']),
+ ))
+ db.send_create_signal('cm', ['Comment'])
+
+ # Adding model 'Configuration'
+ db.create_table('cm_configuration', (
+ ('id', orm['cm.Configuration:id']),
+ ('key', orm['cm.Configuration:key']),
+ ('raw_value', orm['cm.Configuration:raw_value']),
+ ))
+ db.send_create_signal('cm', ['Configuration'])
+
+ # Adding model 'UserRole'
+ db.create_table('cm_userrole', (
+ ('id', orm['cm.UserRole:id']),
+ ('role', orm['cm.UserRole:role']),
+ ('user', orm['cm.UserRole:user']),
+ ('text', orm['cm.UserRole:text']),
+ ))
+ db.send_create_signal('cm', ['UserRole'])
+
+ # Adding model 'Attachment'
+ db.create_table('cm_attachment', (
+ ('id', orm['cm.Attachment:id']),
+ ('key', orm['cm.Attachment:key']),
+ ('adminkey', orm['cm.Attachment:adminkey']),
+ ('data', orm['cm.Attachment:data']),
+ ('text_version', orm['cm.Attachment:text_version']),
+ ))
+ db.send_create_signal('cm', ['Attachment'])
+
+ # Adding model 'Email'
+ db.create_table('cm_email', (
+ ('id', orm['cm.Email:id']),
+ ('created', orm['cm.Email:created']),
+ ('subject', orm['cm.Email:subject']),
+ ('body', orm['cm.Email:body']),
+ ('from_email', orm['cm.Email:from_email']),
+ ('to', orm['cm.Email:to']),
+ ('bcc', orm['cm.Email:bcc']),
+ ('message', orm['cm.Email:message']),
+ ))
+ db.send_create_signal('cm', ['Email'])
+
+ # Adding model 'Text'
+ db.create_table('cm_text', (
+ ('id', orm['cm.Text:id']),
+ ('key', orm['cm.Text:key']),
+ ('adminkey', orm['cm.Text:adminkey']),
+ ('deleted', orm['cm.Text:deleted']),
+ ('state', orm['cm.Text:state']),
+ ('user', orm['cm.Text:user']),
+ ('name', orm['cm.Text:name']),
+ ('email', orm['cm.Text:email']),
+ ('modified', orm['cm.Text:modified']),
+ ('created', orm['cm.Text:created']),
+ ('private_feed_key', orm['cm.Text:private_feed_key']),
+ ('last_text_version', orm['cm.Text:last_text_version']),
+ ('title', orm['cm.Text:title']),
+ ))
+ db.send_create_signal('cm', ['Text'])
+
+ # Adding model 'TextVersion'
+ db.create_table('cm_textversion', (
+ ('id', orm['cm.TextVersion:id']),
+ ('user', orm['cm.TextVersion:user']),
+ ('name', orm['cm.TextVersion:name']),
+ ('email', orm['cm.TextVersion:email']),
+ ('modified', orm['cm.TextVersion:modified']),
+ ('created', orm['cm.TextVersion:created']),
+ ('title', orm['cm.TextVersion:title']),
+ ('format', orm['cm.TextVersion:format']),
+ ('content', orm['cm.TextVersion:content']),
+ ('tags', orm['cm.TextVersion:tags']),
+ ('note', orm['cm.TextVersion:note']),
+ ('mod_posteriori', orm['cm.TextVersion:mod_posteriori']),
+ ('text', orm['cm.TextVersion:text']),
+ ))
+ db.send_create_signal('cm', ['TextVersion'])
+
+ # Adding model 'UserProfile'
+ db.create_table('cm_userprofile', (
+ ('id', orm['cm.UserProfile:id']),
+ ('key', orm['cm.UserProfile:key']),
+ ('adminkey', orm['cm.UserProfile:adminkey']),
+ ('modified', orm['cm.UserProfile:modified']),
+ ('created', orm['cm.UserProfile:created']),
+ ('user', orm['cm.UserProfile:user']),
+ ('allow_contact', orm['cm.UserProfile:allow_contact']),
+ ('preferred_language', orm['cm.UserProfile:preferred_language']),
+ ('is_temp', orm['cm.UserProfile:is_temp']),
+ ('is_email_error', orm['cm.UserProfile:is_email_error']),
+ ('is_suspended', orm['cm.UserProfile:is_suspended']),
+ ))
+ db.send_create_signal('cm', ['UserProfile'])
+
+ # Adding model 'Role'
+ db.create_table('cm_role', (
+ ('id', orm['cm.Role:id']),
+ ('name', orm['cm.Role:name']),
+ ('description', orm['cm.Role:description']),
+ ('global_scope', orm['cm.Role:global_scope']),
+ ('anon', orm['cm.Role:anon']),
+ ))
+ db.send_create_signal('cm', ['Role'])
+
+ # Adding ManyToManyField 'Role.permissions'
+ db.create_table('cm_role_permissions', (
+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+ ('role', models.ForeignKey(orm.Role, null=False)),
+ ('permission', models.ForeignKey(orm['auth.Permission'], null=False))
+ ))
+
+ # Creating unique_together for [role, user, text] on UserRole.
+ db.create_unique('cm_userrole', ['role_id', 'user_id', 'text_id'])
+
+
+
+ def backwards(self, orm):
+
+ # Deleting unique_together for [role, user, text] on UserRole.
+ db.delete_unique('cm_userrole', ['role_id', 'user_id', 'text_id'])
+
+ # Deleting model 'Notification'
+ db.delete_table('cm_notification')
+
+ # Deleting model 'Activity'
+ db.delete_table('cm_activity')
+
+ # Deleting model 'Comment'
+ db.delete_table('cm_comment')
+
+ # Deleting model 'Configuration'
+ db.delete_table('cm_configuration')
+
+ # Deleting model 'UserRole'
+ db.delete_table('cm_userrole')
+
+ # Deleting model 'Attachment'
+ db.delete_table('cm_attachment')
+
+ # Deleting model 'Email'
+ db.delete_table('cm_email')
+
+ # Deleting model 'Text'
+ db.delete_table('cm_text')
+
+ # Deleting model 'TextVersion'
+ db.delete_table('cm_textversion')
+
+ # Deleting model 'UserProfile'
+ db.delete_table('cm_userprofile')
+
+ # Deleting model 'Role'
+ db.delete_table('cm_role')
+
+ # Dropping ManyToManyField 'Role.permissions'
+ db.delete_table('cm_role_permissions')
+
+
+
+ models = {
+ 'auth.group': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'})
+ },
+ 'cm.activity': {
+ 'comment': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.IPAddressField', [], {'default': 'None', 'max_length': '15', 'null': 'True', 'blank': 'True'}),
+ 'originator_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'originator_activity'", 'null': 'True', 'blank': 'True', 'to': "orm['auth.User']"}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.TextVersion']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.attachment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'data': ('django.db.models.fields.files.FileField', [], {'max_length': '1000'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"})
+ },
+ 'cm.comment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'content_html': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'end_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'end_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'reply_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'start_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'start_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'tags': ('tagging.fields.TagField', [], {}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.configuration': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.TextField', [], {}),
+ 'raw_value': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.email': {
+ 'bcc': ('django.db.models.fields.TextField', [], {}),
+ 'body': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'from_email': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'message': ('django.db.models.fields.TextField', [], {}),
+ 'subject': ('django.db.models.fields.TextField', [], {}),
+ 'to': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.notification': {
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.role': {
+ 'anon': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'global_scope': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']"})
+ },
+ 'cm.text': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'last_text_version': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'related_text'", 'null': 'True', 'to': "orm['cm.TextVersion']"}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'private_feed_key': ('django.db.models.fields.CharField', [], {'null': 'True', 'default': 'None', 'max_length': '20', 'blank': 'True', 'unique': 'True', 'db_index': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.textversion': {
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'mod_posteriori': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'note': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'tags': ('tagging.fields.TagField', [], {'max_length': '1000'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.userprofile': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'allow_contact': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_email_error': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_temp': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'preferred_language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'})
+ },
+ 'cm.userrole': {
+ 'Meta': {'unique_together': "(('role', 'user', 'text'),)"},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Role']", 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'unique_together': "(('app_label', 'model'),)", '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'})
+ }
+ }
+
+ complete_apps = ['cm']
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/migrations/0002_add_keys_to_textversion.py Wed Dec 09 12:21:45 2009 +0100
@@ -0,0 +1,192 @@
+
+from south.db import db
+from django.db import models
+from cm.models import *
+from cm.models_base import generate_key, KEY_MAX_SIZE
+class Migration:
+
+ def forwards(self, orm):
+
+ # Adding field 'TextVersion.adminkey'
+ db.add_column('cm_textversion', 'adminkey', models.CharField(max_length=KEY_MAX_SIZE, blank=False, default=''))
+ # orm['cm.textversion:adminkey']
+
+
+ # Adding field 'TextVersion.key'
+ db.add_column('cm_textversion', 'key', models.CharField(max_length=KEY_MAX_SIZE, blank=False, default=''))
+
+ def backwards(self, orm):
+
+ # Deleting field 'TextVersion.adminkey'
+ db.delete_column('cm_textversion', 'adminkey')
+
+ # Deleting field 'TextVersion.key'
+ db.delete_column('cm_textversion', 'key')
+
+
+
+ models = {
+ 'auth.group': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'})
+ },
+ 'cm.activity': {
+ 'comment': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.IPAddressField', [], {'default': 'None', 'max_length': '15', 'null': 'True', 'blank': 'True'}),
+ 'originator_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'originator_activity'", 'null': 'True', 'blank': 'True', 'to': "orm['auth.User']"}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.TextVersion']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.attachment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'data': ('django.db.models.fields.files.FileField', [], {'max_length': '1000'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"})
+ },
+ 'cm.comment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'content_html': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'end_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'end_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'reply_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'start_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'start_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'tags': ('tagging.fields.TagField', [], {}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.configuration': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.TextField', [], {}),
+ 'raw_value': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.email': {
+ 'bcc': ('django.db.models.fields.TextField', [], {}),
+ 'body': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'from_email': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'message': ('django.db.models.fields.TextField', [], {}),
+ 'subject': ('django.db.models.fields.TextField', [], {}),
+ 'to': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.notification': {
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.role': {
+ 'anon': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'global_scope': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']"})
+ },
+ 'cm.text': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'last_text_version': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'related_text'", 'null': 'True', 'to': "orm['cm.TextVersion']"}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'private_feed_key': ('django.db.models.fields.CharField', [], {'null': 'True', 'default': 'None', 'max_length': '20', 'blank': 'True', 'unique': 'True', 'db_index': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.textversion': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'mod_posteriori': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'note': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'tags': ('tagging.fields.TagField', [], {'max_length': '1000'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.userprofile': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'allow_contact': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_email_error': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_temp': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'preferred_language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'})
+ },
+ 'cm.userrole': {
+ 'Meta': {'unique_together': "(('role', 'user', 'text'),)"},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Role']", 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'unique_together': "(('app_label', 'model'),)", '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'})
+ }
+ }
+
+ complete_apps = ['cm']
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/migrations/0003_update_keys_to_textversion.py Wed Dec 09 12:21:45 2009 +0100
@@ -0,0 +1,187 @@
+
+from south.db import db
+from django.db import models
+from cm.models import *
+
+class Migration:
+
+ def forwards(self, orm):
+ "Write your forwards migration here"
+
+ for tv in TextVersion.objects.all():
+ tv.key = TextVersion.objects._gen_key()
+ tv.adminkey = TextVersion.objects._gen_adminkey()
+ tv.save()
+
+
+
+
+ def backwards(self, orm):
+ "Write your backwards migration here"
+
+
+ models = {
+ 'auth.group': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'})
+ },
+ 'cm.activity': {
+ 'comment': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.IPAddressField', [], {'default': 'None', 'max_length': '15', 'null': 'True', 'blank': 'True'}),
+ 'originator_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'originator_activity'", 'null': 'True', 'blank': 'True', 'to': "orm['auth.User']"}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.TextVersion']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.attachment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'data': ('django.db.models.fields.files.FileField', [], {'max_length': '1000'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"})
+ },
+ 'cm.comment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'content_html': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'end_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'end_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'reply_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'start_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'start_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'tags': ('tagging.fields.TagField', [], {}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.configuration': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.TextField', [], {}),
+ 'raw_value': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.email': {
+ 'bcc': ('django.db.models.fields.TextField', [], {}),
+ 'body': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'from_email': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'message': ('django.db.models.fields.TextField', [], {}),
+ 'subject': ('django.db.models.fields.TextField', [], {}),
+ 'to': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.notification': {
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.role': {
+ 'anon': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'global_scope': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']"})
+ },
+ 'cm.text': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'last_text_version': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'related_text'", 'null': 'True', 'to': "orm['cm.TextVersion']"}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'private_feed_key': ('django.db.models.fields.CharField', [], {'null': 'True', 'default': 'None', 'max_length': '20', 'blank': 'True', 'unique': 'True', 'db_index': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.textversion': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'mod_posteriori': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'note': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'tags': ('tagging.fields.TagField', [], {'max_length': '1000'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.userprofile': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'allow_contact': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_email_error': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_temp': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'preferred_language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'})
+ },
+ 'cm.userrole': {
+ 'Meta': {'unique_together': "(('role', 'user', 'text'),)"},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Role']", 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'unique_together': "(('app_label', 'model'),)", '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'})
+ }
+ }
+
+ complete_apps = ['cm']
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/migrations/0004_uniqueness_to_keys_in_textversion.py Wed Dec 09 12:21:45 2009 +0100
@@ -0,0 +1,196 @@
+
+from south.db import db
+from django.db import models
+from cm.models import *
+from cm.models_base import generate_key, KEY_MAX_SIZE
+
+class Migration:
+
+ def forwards(self, orm):
+ "Write your forwards migration here"
+
+ db.create_index('cm_textversion', ['key', ], unique=True)
+
+ db.create_index('cm_textversion', ['adminkey', ], unique=True)
+
+ db.create_unique('cm_textversion', ['key', ])
+
+ db.create_unique('cm_textversion', ['adminkey', ])
+
+
+ def backwards(self, orm):
+ "Write your backwards migration here"
+
+ db.delete_index('cm_textversion', ['key', ], unique=True)
+
+ db.delete_index('cm_textversion', ['adminkey', ], unique=True)
+
+ db.delete_unique('cm_textversion', ['key', ])
+
+ db.delete_unique('cm_textversion', ['adminkey', ])
+
+ models = {
+ 'auth.group': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'})
+ },
+ 'cm.activity': {
+ 'comment': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.IPAddressField', [], {'default': 'None', 'max_length': '15', 'null': 'True', 'blank': 'True'}),
+ 'originator_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'originator_activity'", 'null': 'True', 'blank': 'True', 'to': "orm['auth.User']"}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.TextVersion']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.attachment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'data': ('django.db.models.fields.files.FileField', [], {'max_length': '1000'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"})
+ },
+ 'cm.comment': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'content_html': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'end_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'end_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'reply_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}),
+ 'start_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'start_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'tags': ('tagging.fields.TagField', [], {}),
+ 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.configuration': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.TextField', [], {}),
+ 'raw_value': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.email': {
+ 'bcc': ('django.db.models.fields.TextField', [], {}),
+ 'body': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'from_email': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'message': ('django.db.models.fields.TextField', [], {}),
+ 'subject': ('django.db.models.fields.TextField', [], {}),
+ 'to': ('django.db.models.fields.TextField', [], {})
+ },
+ 'cm.notification': {
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.role': {
+ 'anon': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'global_scope': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']"})
+ },
+ 'cm.text': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'last_text_version': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'related_text'", 'null': 'True', 'to': "orm['cm.TextVersion']"}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'private_feed_key': ('django.db.models.fields.CharField', [], {'null': 'True', 'default': 'None', 'max_length': '20', 'blank': 'True', 'unique': 'True', 'db_index': 'True'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.textversion': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'mod_posteriori': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'note': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'tags': ('tagging.fields.TagField', [], {'max_length': '1000'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']"}),
+ 'title': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'cm.userprofile': {
+ 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'allow_contact': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_email_error': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_temp': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'preferred_language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'})
+ },
+ 'cm.userrole': {
+ 'Meta': {'unique_together': "(('role', 'user', 'text'),)"},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Role']", 'null': 'True', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'unique_together': "(('app_label', 'model'),)", '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'})
+ }
+ }
+
+ complete_apps = ['cm']
--- a/src/cm/settings.py Tue Dec 08 19:49:41 2009 +0100
+++ b/src/cm/settings.py Wed Dec 09 12:21:45 2009 +0100
@@ -95,7 +95,8 @@
'django.contrib.admin',
'cm',
'tagging',
- 'django_extensions', # http://code.google.com/p/django-command-extensions/
+ 'django_extensions', # http://code.google.com/p/django-command-extensions/
+ 'south',
)
_ = lambda s: s
--- a/src/cm/tests/test_notifications.py Tue Dec 08 19:49:41 2009 +0100
+++ b/src/cm/tests/test_notifications.py Wed Dec 09 12:21:45 2009 +0100
@@ -9,23 +9,40 @@
class NotificationTest(TestCase):
fixtures = ['roles_generic','test_content']
- def test_global_notification(self):
+ def setUp(self):
+ pass
+
+ def test_simple_notification(self):
c = Client()
c.login(username='user1', password='test')
- print Notification.objects.all()
+ self.assertEquals(len(Notification.objects.all()), 0)
- c.post('/notifications/', {'notify_check': u'true'})
+ # subscribe to workspace notifications
+ response = c.post('/notifications/', {'notif_id': u'workspace_notify_check',
+ 'workspace_notify_check': u'workspace_notify_check',
+ })
- # ? error ? django tests system bug?
+ self.assertEquals(len(Notification.objects.all()), 1)
+
+ # subscribe to own notifications
+ response = c.post('/notifications/', {'notif_id': u'own_notify_check',
+ 'own_notify_check': u'true',
+ })
+
+ self.assertEquals(len(Notification.objects.all()), 2)
+
+ self.assertEquals(len(mail.outbox), 0)
+
c.post('/client/', {'content' : 'sdf',
- 'end_offset' : 11,
+ 'end_offset' : 19,
'end_wrapper' : 0,
'format' : 'markdown',
'fun' : 'addComment',
'key' : 'text_key_1',
- 'start_offset' : 8,
+ 'start_offset' : 16,
'start_wrapper' : 0,
- 'title' : 'sdf',
+ 'title' : 'sdf',
+ 'tags': '',
})
self.assertEquals(len(mail.outbox), 1)