public
Description: Mobile FriendFeed Client
Homepage: http://www.fftogo.com/
Clone URL: git://github.com/bgolub/fftogo.git
edit v2.0, now simply via a GET parameter so every comment can be edited
bgolub (author)
Mon Jun 30 11:52:30 -0700 2008
commit  8413fbedd5fdea69c64fa2cb83845c1efc84e81f
tree    112acf513d8271efd52645c37f34adf7382f3ddc
parent  a90c87c6a88da2872c5f9046d801ae5b0005a869
...
97
98
99
100
 
 
101
102
103
...
118
119
120
121
122
123
124
125
...
130
131
132
 
 
133
134
135
136
137
138
139
140
141
142
...
97
98
99
 
100
101
102
103
104
...
119
120
121
 
 
122
123
124
...
129
130
131
132
133
134
135
136
 
 
 
 
137
138
139
0
@@ -97,7 +97,8 @@ def entry_comment(request, entry):
0
 
0
     entry is the entry id.
0
     An optional parameter, comment, in the GET dict will allow you to edit an
0
- entry (assuming its body already exists in memcache).
0
+ entry.
0
+ An optional parameter, body, in the GET dict will initialize the form.
0
     '''
0
     if not request.session.get('nickname', None):
0
         return HttpResponseRedirect(reverse('login'))
0
@@ -118,8 +119,6 @@ def entry_comment(request, entry):
0
                     del request.session['nickname']
0
                     del request.session['key']
0
                 return HttpResponseRedirect(reverse(str(e)))
0
- key = 'comment_%s' % comment
0
- memcache.set(key, form.data['body'])
0
             next = form.data['next']
0
             if not form.data['comment']:
0
                 if '?' in next:
0
@@ -130,13 +129,11 @@ def entry_comment(request, entry):
0
             return HttpResponseRedirect(next)
0
     else:
0
         initial = {
0
+ 'body': request.GET.get('body', None),
0
+ 'comment': request.GET.get('comment', None),
0
             'entry': entry,
0
             'next': request.GET.get('next', '/'),
0
         }
0
- if 'comment' in request.GET:
0
- key = 'comment_%s' % request.GET['comment']
0
- initial['body'] = memcache.get(key)
0
- initial['comment'] = request.GET['comment']
0
         form = CommentForm(initial=initial)
0
     extra_context = {
0
         'form': form,
...
120
121
122
123
124
125
 
126
127
128
129
 
130
131
132
...
120
121
122
 
 
 
123
124
 
 
 
125
126
127
128
0
@@ -120,13 +120,9 @@ Liked by {{ entry.likes|length|apnumber }} {{ entry.likes|length|pluralize:"pers
0
 -
0
 <span title="{{ comment.date }}">{{ comment.date|timesince }} ago</span>
0
 {% ifequal request.session.nickname comment.user.nickname %}
0
-(
0
-{% if comment|can_edit %}
0
-<a href="{% url entry_comment entry.id %}?comment={{ comment.id }}&next={{ request.path }}">edit</a>
0
+(<a href="{% url entry_comment entry.id %}?comment={{ comment.id }}&body={{ comment.body|urlencode }}&next={{ request.path }}">edit</a>
0
 |
0
-{% endif %}
0
-<a href="{% url comment_delete entry.id,comment.id %}?next={{ request.path }}">delete</a>
0
-)
0
+<a href="{% url comment_delete entry.id,comment.id %}?next={{ request.path }}">delete</a>)
0
 {% else %}
0
 {% ifequal request.session.nickname entry.user.nickname %}
0
 (<a href="{% url comment_delete entry.id,comment.id %}?next={{ request.path }}">delete</a>)

Comments

    No one has commented yet.