Skip to content

Commit

Permalink
Uuups forgot to commit
Browse files Browse the repository at this point in the history
  • Loading branch information
plaetzchen committed Aug 30, 2012
1 parent 364bcdd commit 4848c19
Show file tree
Hide file tree
Showing 78 changed files with 18,769 additions and 28 deletions.
1 change: 1 addition & 0 deletions publicdocs/documents/admin.py
Expand Up @@ -8,3 +8,4 @@
admin.site.register(Page) admin.site.register(Page)
admin.site.register(Relation) admin.site.register(Relation)
admin.site.register(Category) admin.site.register(Category)
admin.site.register(Comment)
16 changes: 16 additions & 0 deletions publicdocs/documents/forms.py
@@ -0,0 +1,16 @@
from django.forms import ModelForm
from django import forms

from documents.models import Comment, Relation

class CommentForm(ModelForm):
''' Used for the comments '''
class Meta:
model = Comment
exclude = ["ip","moderated","document"]

class RelationForm(ModelForm):
''' Used for adding relations '''
class Meta:
model = Relation
fields = ["type", "relatedDocument", "comment"]
2 changes: 1 addition & 1 deletion publicdocs/documents/management/commands/searchdocs.py
Expand Up @@ -79,7 +79,7 @@ def handle(self, *args, **options):
if not os.path.exists("/opt/publicdocs/PublicDocs/publicdocs/media/documents/" + document.slug ): if not os.path.exists("/opt/publicdocs/PublicDocs/publicdocs/media/documents/" + document.slug ):
os.makedirs("/opt/publicdocs/PublicDocs/publicdocs/media/documents/" + document.slug) os.makedirs("/opt/publicdocs/PublicDocs/publicdocs/media/documents/" + document.slug)
file_name = smart_unicode(files, encoding='utf-8', strings_only=False, errors='strict') file_name = smart_unicode(files, encoding='utf-8', strings_only=False, errors='strict')
outcode = subprocess.Popen(u"/usr/bin/convert -quality 80% '" + file_name + "' /opt/publicdocs/PublicDocs/publicdocs/media/documents/" + document.slug + "/" + document.slug + ".jpg", shell=True) outcode = subprocess.Popen(u"/usr/bin/convert -quality 90% '" + file_name + "' /opt/publicdocs/PublicDocs/publicdocs/media/documents/" + document.slug + "/" + document.slug + ".jpg", shell=True)
while outcode.poll() == None: while outcode.poll() == None:
pass pass


Expand Down
98 changes: 98 additions & 0 deletions publicdocs/documents/migrations/0010_auto__add_comment.py
@@ -0,0 +1,98 @@
# -*- 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 'Comment'
db.create_table('documents_comment', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=254)),
('ip', self.gf('django.db.models.fields.IPAddressField')(max_length=15, null=True, blank=True)),
('moderated', self.gf('django.db.models.fields.BooleanField')(default=False)),
('comment', self.gf('django.db.models.fields.TextField')(max_length=1000)),
('page', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['documents.Page'])),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
))
db.send_create_signal('documents', ['Comment'])


def backwards(self, orm):
# Deleting model 'Comment'
db.delete_table('documents_comment')


models = {
'documents.author': {
'Meta': {'object_name': 'Author'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.CharField', [], {'max_length': '254', 'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'populate_from': 'None', 'unique_with': '()'})
},
'documents.category': {
'Meta': {'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'populate_from': 'None', 'unique_with': '()'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '254'})
},
'documents.comment': {
'Meta': {'object_name': 'Comment'},
'comment': ('django.db.models.fields.TextField', [], {'max_length': '1000'}),
'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', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}),
'moderated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['documents.Page']"})
},
'documents.document': {
'Meta': {'object_name': 'Document'},
'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['documents.Author']", 'null': 'True', 'blank': 'True'}),
'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['documents.Category']", 'null': 'True', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'documentCreated': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'documentModified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'md5hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'pages': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'document'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['documents.Page']"}),
'relations': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['documents.Relation']", 'null': 'True', 'blank': 'True'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'populate_from': 'None', 'unique_with': '()'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
'version': ('django.db.models.fields.IntegerField', [], {'default': '1'})
},
'documents.page': {
'Meta': {'object_name': 'Page'},
'content': ('django.db.models.fields.TextField', [], {'null': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'number': ('django.db.models.fields.IntegerField', [], {})
},
'documents.paragraph': {
'Meta': {'object_name': 'Paragraph'},
'content': ('django.db.models.fields.TextField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'})
},
'documents.relation': {
'Meta': {'object_name': 'Relation'},
'comment': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.IntegerField', [], {'max_length': '1'})
}
}

complete_apps = ['documents']
@@ -0,0 +1,105 @@
# -*- 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 field 'Comment.document'
db.add_column('documents_comment', 'document',
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['documents.Document'], null=True),
keep_default=False)


# Renaming column for 'Comment.page' to match new field type.
db.rename_column('documents_comment', 'page_id', 'page')
# Changing field 'Comment.page'
db.alter_column('documents_comment', 'page', self.gf('django.db.models.fields.IntegerField')(null=True))
# Removing index on 'Comment', fields ['page']
db.delete_index('documents_comment', ['page_id'])


def backwards(self, orm):
# Adding index on 'Comment', fields ['page']
db.create_index('documents_comment', ['page_id'])

# Deleting field 'Comment.document'
db.delete_column('documents_comment', 'document_id')


# User chose to not deal with backwards NULL issues for 'Comment.page'
raise RuntimeError("Cannot reverse this migration. 'Comment.page' and its values cannot be restored.")

models = {
'documents.author': {
'Meta': {'object_name': 'Author'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.CharField', [], {'max_length': '254', 'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'populate_from': 'None', 'unique_with': '()'})
},
'documents.category': {
'Meta': {'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'populate_from': 'None', 'unique_with': '()'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '254'})
},
'documents.comment': {
'Meta': {'object_name': 'Comment'},
'comment': ('django.db.models.fields.TextField', [], {'max_length': '1000'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'document': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['documents.Document']", 'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}),
'moderated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
'page': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
},
'documents.document': {
'Meta': {'object_name': 'Document'},
'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['documents.Author']", 'null': 'True', 'blank': 'True'}),
'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['documents.Category']", 'null': 'True', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'documentCreated': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'documentModified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'md5hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'pages': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'document'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['documents.Page']"}),
'relations': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['documents.Relation']", 'null': 'True', 'blank': 'True'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'populate_from': 'None', 'unique_with': '()'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
'version': ('django.db.models.fields.IntegerField', [], {'default': '1'})
},
'documents.page': {
'Meta': {'object_name': 'Page'},
'content': ('django.db.models.fields.TextField', [], {'null': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'number': ('django.db.models.fields.IntegerField', [], {})
},
'documents.paragraph': {
'Meta': {'object_name': 'Paragraph'},
'content': ('django.db.models.fields.TextField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'})
},
'documents.relation': {
'Meta': {'object_name': 'Relation'},
'comment': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.IntegerField', [], {'max_length': '1'})
}
}

complete_apps = ['documents']

0 comments on commit 4848c19

Please sign in to comment.