# -*- coding: utf-8 -*-
from django.contrib import admin
-from pdfannotator.models import Annotation, AnnotationComment
+from .models import Annotation, AnnotationComment
class AnnotationAdmin(admin.ModelAdmin):
model = AnnotationComment
-
-
admin.site.register(Annotation, AnnotationAdmin)
admin.site.register(AnnotationComment, AnnotationCommentAdmin)
-
-
+++ /dev/null
-# -*- coding: utf-8 -*-
-from south.utils import datetime_utils as 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 'Annotation'
- db.create_table('pdfannotator_annotation', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('annotation_id', self.gf('django.db.models.fields.CharField')(max_length=50)),
- ('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
- ('page', self.gf('django.db.models.fields.IntegerField')()),
- ('content', self.gf('django.db.models.fields.TextField')()),
- ))
- db.send_create_signal('pdfannotator', ['Annotation'])
-
-
- def backwards(self, orm):
- # Deleting model 'Annotation'
- db.delete_table('pdfannotator_annotation')
-
-
- models = {
- 'pdfannotator.annotation': {
- 'Meta': {'object_name': 'Annotation'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'page': ('django.db.models.fields.IntegerField', [], {}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- }
- }
-
- complete_apps = ['pdfannotator']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-from south.utils import datetime_utils as 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 'AnnotationComment'
- db.create_table('pdfannotator_annotationcomment', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
- ('annotation_id', self.gf('django.db.models.fields.CharField')(max_length=50)),
- ('content', self.gf('django.db.models.fields.TextField')()),
- ))
- db.send_create_signal('pdfannotator', ['AnnotationComment'])
-
-
- def backwards(self, orm):
- # Deleting model 'AnnotationComment'
- db.delete_table('pdfannotator_annotationcomment')
-
-
- models = {
- 'pdfannotator.annotation': {
- 'Meta': {'object_name': 'Annotation'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'page': ('django.db.models.fields.IntegerField', [], {}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- },
- 'pdfannotator.annotationcomment': {
- 'Meta': {'object_name': 'AnnotationComment'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- }
- }
-
- complete_apps = ['pdfannotator']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-from south.utils import datetime_utils as 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 'AnnotationComment.created'
- db.add_column('pdfannotator_annotationcomment', 'created',
- self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2018, 11, 16, 0, 0), blank=True),
- keep_default=False)
-
- # Adding field 'Annotation.order'
- db.add_column('pdfannotator_annotation', 'order',
- self.gf('django.db.models.fields.CharField')(default='1', max_length=10),
- keep_default=False)
-
-
- def backwards(self, orm):
- # Deleting field 'AnnotationComment.created'
- db.delete_column('pdfannotator_annotationcomment', 'created')
-
- # Deleting field 'Annotation.order'
- db.delete_column('pdfannotator_annotation', 'order')
-
-
- models = {
- 'pdfannotator.annotation': {
- 'Meta': {'object_name': 'Annotation'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'order': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
- 'page': ('django.db.models.fields.IntegerField', [], {}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- },
- 'pdfannotator.annotationcomment': {
- 'Meta': {'object_name': 'AnnotationComment'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- }
- }
-
- complete_apps = ['pdfannotator']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-from south.utils import datetime_utils as datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding index on 'AnnotationComment', fields ['uuid']
- db.create_index('pdfannotator_annotationcomment', ['uuid'])
-
- # Adding index on 'Annotation', fields ['uuid']
- db.create_index('pdfannotator_annotation', ['uuid'])
-
- # Adding index on 'Annotation', fields ['annotation_id']
- db.create_index('pdfannotator_annotation', ['annotation_id'])
-
-
- def backwards(self, orm):
- # Removing index on 'Annotation', fields ['annotation_id']
- db.delete_index('pdfannotator_annotation', ['annotation_id'])
-
- # Removing index on 'Annotation', fields ['uuid']
- db.delete_index('pdfannotator_annotation', ['uuid'])
-
- # Removing index on 'AnnotationComment', fields ['uuid']
- db.delete_index('pdfannotator_annotationcomment', ['uuid'])
-
-
- models = {
- 'pdfannotator.annotation': {
- 'Meta': {'object_name': 'Annotation'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'order': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
- 'page': ('django.db.models.fields.IntegerField', [], {}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
- },
- 'pdfannotator.annotationcomment': {
- 'Meta': {'object_name': 'AnnotationComment'},
- 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'content': ('django.db.models.fields.TextField', [], {}),
- 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['pdfannotator']
\ No newline at end of file
verbose_name = "Annotation"
verbose_name_plural = "Annotations"
- def __unicode__(self):
- return unicode('Annotation %d - %s for %s' % (self.id, self.annotation_id, self.uuid))
+ def __str__(self):
+ return str('Annotation %d - %s for %s' % (self.id, self.annotation_id, self.uuid))
class AnnotationComment(models.Model):
uuid = models.CharField(db_index=True, blank=False, null=False, max_length=50) # file uuid
verbose_name = "AnnotationComment"
verbose_name_plural = "AnnotationComments"
- def __unicode__(self):
- return unicode('Comment %d - %s' % (self.id, self.annotation_id))
+ def __str__(self):
+ return str('Comment %d - %s' % (self.id, self.annotation_id))
@property
def annotation(self):
--- /dev/null
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as 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 'Annotation'
+ db.create_table('pdfannotator_annotation', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('annotation_id', self.gf('django.db.models.fields.CharField')(max_length=50)),
+ ('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
+ ('page', self.gf('django.db.models.fields.IntegerField')()),
+ ('content', self.gf('django.db.models.fields.TextField')()),
+ ))
+ db.send_create_signal('pdfannotator', ['Annotation'])
+
+
+ def backwards(self, orm):
+ # Deleting model 'Annotation'
+ db.delete_table('pdfannotator_annotation')
+
+
+ models = {
+ 'pdfannotator.annotation': {
+ 'Meta': {'object_name': 'Annotation'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'page': ('django.db.models.fields.IntegerField', [], {}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['pdfannotator']
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as 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 'AnnotationComment'
+ db.create_table('pdfannotator_annotationcomment', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
+ ('annotation_id', self.gf('django.db.models.fields.CharField')(max_length=50)),
+ ('content', self.gf('django.db.models.fields.TextField')()),
+ ))
+ db.send_create_signal('pdfannotator', ['AnnotationComment'])
+
+
+ def backwards(self, orm):
+ # Deleting model 'AnnotationComment'
+ db.delete_table('pdfannotator_annotationcomment')
+
+
+ models = {
+ 'pdfannotator.annotation': {
+ 'Meta': {'object_name': 'Annotation'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'page': ('django.db.models.fields.IntegerField', [], {}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'pdfannotator.annotationcomment': {
+ 'Meta': {'object_name': 'AnnotationComment'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['pdfannotator']
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as 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 'AnnotationComment.created'
+ db.add_column('pdfannotator_annotationcomment', 'created',
+ self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2018, 11, 16, 0, 0), blank=True),
+ keep_default=False)
+
+ # Adding field 'Annotation.order'
+ db.add_column('pdfannotator_annotation', 'order',
+ self.gf('django.db.models.fields.CharField')(default='1', max_length=10),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Deleting field 'AnnotationComment.created'
+ db.delete_column('pdfannotator_annotationcomment', 'created')
+
+ # Deleting field 'Annotation.order'
+ db.delete_column('pdfannotator_annotation', 'order')
+
+
+ models = {
+ 'pdfannotator.annotation': {
+ 'Meta': {'object_name': 'Annotation'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'order': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
+ 'page': ('django.db.models.fields.IntegerField', [], {}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'pdfannotator.annotationcomment': {
+ 'Meta': {'object_name': 'AnnotationComment'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['pdfannotator']
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding index on 'AnnotationComment', fields ['uuid']
+ db.create_index('pdfannotator_annotationcomment', ['uuid'])
+
+ # Adding index on 'Annotation', fields ['uuid']
+ db.create_index('pdfannotator_annotation', ['uuid'])
+
+ # Adding index on 'Annotation', fields ['annotation_id']
+ db.create_index('pdfannotator_annotation', ['annotation_id'])
+
+
+ def backwards(self, orm):
+ # Removing index on 'Annotation', fields ['annotation_id']
+ db.delete_index('pdfannotator_annotation', ['annotation_id'])
+
+ # Removing index on 'Annotation', fields ['uuid']
+ db.delete_index('pdfannotator_annotation', ['uuid'])
+
+ # Removing index on 'AnnotationComment', fields ['uuid']
+ db.delete_index('pdfannotator_annotationcomment', ['uuid'])
+
+
+ models = {
+ 'pdfannotator.annotation': {
+ 'Meta': {'object_name': 'Annotation'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'order': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
+ 'page': ('django.db.models.fields.IntegerField', [], {}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+ },
+ 'pdfannotator.annotationcomment': {
+ 'Meta': {'object_name': 'AnnotationComment'},
+ 'annotation_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'content': ('django.db.models.fields.TextField', [], {}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+ }
+ }
+
+ complete_apps = ['pdfannotator']
\ No newline at end of file
from django import template
-from django.conf import settings
-
register = template.Library()
-try:
- from django.conf.urls import *
-except ImportError: # django < 1.4
- from django.conf.urls.defaults import *
+from django.conf.urls import url
+from . import views
-# place app url patterns here
-from django.conf.urls import patterns, url, include
-from pdfannotator import views
+urlpatterns = [
+ url(r'^add-annotation/$', views.add_annotation,
+ name="pdfannotator-add-annotation"),
-urlpatterns = patterns('',
- url(r'^add-annotation/$', views.add_annotation, name="pdfannotator-add-annotation"),
-
- url(r'^update-annotation/$', views.update_annotation, name="pdfannotator-update-annotation"),
- url(r'^delete-annotation/$', views.delete_annotation, name="pdfannotator-delete-annotation"),
- url(r'^get-annotations/$', views.get_annotations, name="pdfannotator-get-annotations"),
- url(r'^get-annotation/$', views.get_annotation, name="pdfannotator-get-annotation"),
+ url(r'^update-annotation/$', views.update_annotation,
+ name="pdfannotator-update-annotation"),
+ url(r'^delete-annotation/$', views.delete_annotation,
+ name="pdfannotator-delete-annotation"),
+ url(r'^get-annotations/$', views.get_annotations,
+ name="pdfannotator-get-annotations"),
+ url(r'^get-annotation/$', views.get_annotation,
+ name="pdfannotator-get-annotation"),
url(r'^add-comment/$', views.add_comment, name="pdfannotator-add-comment"),
- url(r'^get-comments/$', views.get_comments, name="pdfannotator-get-comments"),
- url(r'^update-comment/$', views.update_comment, name="pdfannotator-update-comment"),
- # url(r'^delete-comment/$', views.delete_comment, name="pdfannotator-delete-comment"),
-)
+ url(r'^get-comments/$', views.get_comments,
+ name="pdfannotator-get-comments"),
+ url(r'^update-comment/$', views.update_comment,
+ name="pdfannotator-update-comment"),
+]