Permalink
Browse files

removed revisions

  • Loading branch information...
1 parent 24060ef commit 19d49db7af12ba1e8b42666b4ee02cf390988fb4 @brosner brosner committed Jul 13, 2011
Showing with 8 additions and 46 deletions.
  1. +6 −19 CHANGELOG
  2. +2 −3 boxes/admin.py
  3. +0 −24 boxes/models.py
View
@@ -1,3 +1,8 @@
+0.1.dev1005
+-----------
+
+ * removed revision tracking
+
0.1.dev1003
-----------
@@ -15,32 +20,14 @@ Notes
User). It also includes a new model, Revision::
ALTER TABLE "boxes_box" ADD COLUMN "created_by_id" integer not null REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
- ALTER TABLE "boxes_box" ADD COLUMN "last_updated_by_id" integer not null REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
-
- CREATE TABLE "boxes_revision" (
- "id" serial NOT NULL PRIMARY KEY,
- "box_id" integer NOT NULL REFERENCES "boxes_box" ("id") DEFERRABLE INITIALLY DEFERRED,
- "label" varchar(100) NOT NULL,
- "content" text NOT NULL,
- "orig_created_by_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
- "created_on" timestamp with time zone NOT NULL,
- "created_by_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED
- );
-
CREATE INDEX "boxes_box_created_by_id" ON "boxes_box" ("created_by_id");
- CREATE INDEX "boxes_box_last_updated_by_id" ON "boxes_box" ("last_updated_by_id");
- CREATE INDEX "boxes_revision_box_id" ON "boxes_revision" ("box_id");
- CREATE INDEX "boxes_revision_label" ON "boxes_revision" ("label");
- CREATE INDEX "boxes_revision_label_like" ON "boxes_revision" ("label" varchar_pattern_ops);
- CREATE INDEX "boxes_revision_orig_created_by_id" ON "boxes_revision" ("orig_created_by_id");
- CREATE INDEX "boxes_revision_created_by_id" ON "boxes_revision" ("created_by_id");
* Templates.
A ``boxes/box_create.html`` was added that can be identical to ``boxes/box_edit.html``
just with a different action url.
-* Urls.
+* URLs.
A new ``boxes_create`` url was added to support the rendering of the create
form as well as processing the POST of that form. It takes a ``[-\w]+`` parameter
View
@@ -1,7 +1,6 @@
from django.contrib import admin
-from boxes.models import Box, Revision
+from boxes.models import Box
-admin.site.register(Box)
-admin.site.register(Revision)
+admin.site.register(Box)
View
@@ -18,27 +18,3 @@ def __unicode__(self):
class Meta:
verbose_name_plural = "boxes"
-
- def save(self, **kwargs):
- super(Box, self).save(**kwargs)
- Revision.objects.create(
- box = self,
- label = self.label,
- content = self.content,
- orig_created_by = self.created_by,
- created_by = self.last_updated_by
- )
-
-
-class Revision(models.Model):
-
- box = models.ForeignKey(Box, related_name="revisions")
- label = models.CharField(max_length=100, db_index=True)
- content = models.TextField()
- orig_created_by = models.ForeignKey(User, related_name="orig_revisions")
-
- created_on = models.DateTimeField(default=datetime.datetime.now)
- created_by = models.ForeignKey(User, related_name="revisions")
-
- def __unicode__(self):
- return self.label

0 comments on commit 19d49db

Please sign in to comment.