Author: gregoryjnewman
Date: Thu Sep 11 15:47:14 2008
New Revision: 872

Modified:
    trunk/pinax/local_apps/photos/views.py
    trunk/pinax/templates/photos/photo_right_panel.html

Log:
adding the ability to remove photos from tribes

Modified: trunk/pinax/local_apps/photos/views.py
==============================================================================
--- trunk/pinax/local_apps/photos/views.py      (original)
+++ trunk/pinax/local_apps/photos/views.py      Thu Sep 11 15:47:14 2008
@@ -104,7 +104,7 @@
                  tribeid = request.POST["tribe"]
                  mytribe = Tribe.objects.get(pk=tribeid)
                  if mytribe.photos.filter(photo=photo).count():
-                    # mytribe.photos(photo=photo)
+                    mytribe.photos.filter(photo=photo).delete()
                       
request.user.message_set.create(message=_("Successfully add photo '%s' to  
tribe") % title)
                  else:
                      # TODO: this applies to pinax in general. dont use  
ugettext_lazy here. its usage is fragile.

Modified: trunk/pinax/templates/photos/photo_right_panel.html
==============================================================================
--- trunk/pinax/templates/photos/photo_right_panel.html (original)
+++ trunk/pinax/templates/photos/photo_right_panel.html Thu Sep 11 15:47:14  
2008
@@ -66,6 +66,8 @@
              <form action="{% url details photo.id %}" method="POST">
                  <input type="hidden" name="tribe" value="{{ tribe.id }}"/>
              {% if tribe.has_photo %}
+                <input type="hidden" name="action"  
value="removefromtribe"/>
+                <input type="submit" value="remove"/>
                  {{ tribe.name }}
              {% else %}
                  <input type="hidden" name="action" value="addtotribe"/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to