Skip to content
Browse files

hm, remove old references to django-revisions since it is not in fact…

… being used
  • Loading branch information...
1 parent 0cae20d commit 3ac573705de041a1217cbbfd90fd947c9bd2ef0a @trey0 trey0 committed Oct 11, 2011
Showing with 12 additions and 28 deletions.
  1. +0 −2 example/settings.py
  2. +1 −2 geocamMemo/forms.py
  3. +2 −3 geocamMemo/models.py
  4. +1 −1 geocamMemo/tests/views.py
  5. +2 −2 geocamMemo/views.py
  6. +4 −14 geocamTalk/models.py
  7. +2 −2 geocamTalk/views.py
  8. +0 −2 requirements.txt
View
2 example/settings.py
@@ -70,7 +70,6 @@
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
- 'revisions.middleware.VersionedModelRedirectMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
@@ -94,5 +93,4 @@
'django.contrib.sites',
'geocamMemo',
'geocamTalk',
- 'revisions'
)
View
3 geocamMemo/forms.py
@@ -8,7 +8,6 @@
from datetime import datetime
from django import forms
-from revisions.admin import AutoRevisionForm
from geocamMemo.models import MemoMessage
@@ -33,7 +32,7 @@ def clean(self, value):
raise forms.ValidationError
-class MemoMessageForm(AutoRevisionForm):
+class MemoMessageForm(forms.Form):
position_timestamp = GeolocationTimestampDateTimeFormField()
class Meta:
View
5 geocamMemo/models.py
@@ -22,8 +22,7 @@ class Meta:
server_timestamp = models.DateTimeField(auto_now_add=True)
author = models.ForeignKey(User, related_name="%(app_label)s_%(class)s_set")
content = models.TextField(max_length=1024)
- # removed auto_add_now from content_timestamp since revisions are also instances in the
- # same table and we don't overwrite this timestamp on an edit
+ # content_timestamp: no auto_add_now in case we go back to versioned message model
content_timestamp = models.DateTimeField(blank=True)
latitude = models.FloatField(null=True, blank=True)
longitude = models.FloatField(null=True, blank=True)
@@ -114,7 +113,7 @@ def fromJson(messageDict):
def getMessages(author=None):
""" Message Listing Rules:
- If no author is specified: all messages are displayed (latest revisions)
+ If no author is specified: all messages are displayed
If author is specified: all messages are displayed from author
"""
View
2 geocamMemo/tests/views.py
@@ -51,7 +51,7 @@ def test_deleteMessage(self):
msgCnt = MemoMessage.objects.all().count()
msg = MemoMessage.objects.all()[1]
- # delete the first message and all it's revisions:
+ # delete the first message
msg.delete()
newMsgCnt = MemoMessage.objects.all().count()
self.assertEqual(newMsgCnt + 1, msgCnt, "Deleting a Message Failed.")
View
4 geocamMemo/views.py
@@ -86,8 +86,8 @@ def create_message(request):
form = MemoMessageForm(request.POST)
if form.is_valid():
msg = form.save(commit=False)
- # Since revisions are now saved to db, this timestamp
- # can't just be auto set since we want to preserve from creation time
+ # Set time manually this way in case we switch back to a versioned message
+ # model in the future
msg.content_timestamp = datetime.now()
msg.save()
return HttpResponseRedirect(reverse('memo_message_list_all'))
View
18 geocamTalk/models.py
@@ -33,18 +33,8 @@ def getUnreadMessageCount(self):
class TalkMessage(GeocamMessage):
- """ This is the data model for Memo application messages
-
- Some of the Versioned Model API:
- VersionedModel.get_latest_revision()
- VersionedModel.get_revisions()
- VersionedModel.make_current_revision()
- VersionedModel.revert_to(criterion)
- VersionedModel.save(new_revision=True, *vargs, **kwargs)
- VersionedModel.show_diff_to(to, field)
- complete API and docs are here:
- http://stdbrouw.github.com/django-revisions/
-
+ """
+ This is the data model for Memo application messages
"""
# TODO - add time to filename location
audio_file = models.FileField(null=True, blank=True, upload_to='geocamTalk/audio/%Y/%m/%d') # "%s-audio" % (GeocamMessage.author))
@@ -122,15 +112,15 @@ def fromJson(messageDict):
def getMessages(recipient=None, author=None):
""" Message Listing Rules:
- If no users are specified: all messages are displayed (latest revisions)
+ If no users are specified: all messages are displayed
If only author is specified: all messages are displayed from author
If only recipient is specified: messages displayed are broadcast + from OR to recipient
If both recipient AND author are specified: messages displayed are braodcast + from author AND to recipient
Note: a broadcast message is a message with no recipients
"""
if (recipient is None and author is None):
- # all messages are displayed (latest revisions)
+ # all messages are displayed
messages = TalkMessage.objects.all()
elif (recipient is None and author is not None):
# messages displayed are from author:
View
4 geocamTalk/views.py
@@ -140,8 +140,8 @@ def create_message(request):
form = GeocamTalkForm(request.POST)
if form.is_valid():
msg = form.save(commit=False)
- # Since revisions are now saved to db, this timestamp
- # can't just be auto set since we want to preserve from creation time
+ # Set time manually this way in case we switch back to a versioned message
+ # model in the future
msg.content_timestamp = datetime.now()
msg.save()
form.save_m2m()
View
2 requirements.txt
@@ -6,5 +6,3 @@
# This is a pip requirements file
# http://pip.openplans.org/requirement-format.html
-
-django-revisions

0 comments on commit 3ac5737

Please sign in to comment.
Something went wrong with that request. Please try again.