[xiph-commits] r3937 - in arkaiv/trunk: arkaiv/controllers arkaiv/model arkaiv/templates data/templates
dcrowdy at svn.annodex.net
dcrowdy at svn.annodex.net
Fri May 29 14:58:56 PDT 2009
Author: dcrowdy
Date: 2009-05-29 14:58:55 -0700 (Fri, 29 May 2009)
New Revision: 3937
Modified:
arkaiv/trunk/arkaiv/controllers/collection.py
arkaiv/trunk/arkaiv/model/__init__.py
arkaiv/trunk/arkaiv/model/__init__.pyc
arkaiv/trunk/arkaiv/templates/collections.mak
arkaiv/trunk/data/templates/collections.mak.py
arkaiv/trunk/data/templates/collections.mak.pyc
Log:
Implemented deletion of collections
Modified: arkaiv/trunk/arkaiv/controllers/collection.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/collection.py 2009-05-28 05:48:33 UTC (rev 3936)
+++ arkaiv/trunk/arkaiv/controllers/collection.py 2009-05-29 21:58:55 UTC (rev 3937)
@@ -28,3 +28,8 @@
c.collections = model.getcollections()
return render('/collections.mak')
+ def deletecollection(self):
+ model.deletecollection(request.params['id'])
+ c.collections = model.getcollections()
+ return render('/collections.mak')
+
Modified: arkaiv/trunk/arkaiv/model/__init__.py
===================================================================
--- arkaiv/trunk/arkaiv/model/__init__.py 2009-05-28 05:48:33 UTC (rev 3936)
+++ arkaiv/trunk/arkaiv/model/__init__.py 2009-05-29 21:58:55 UTC (rev 3937)
@@ -295,6 +295,24 @@
Session.commit()
return
+#def deletemeta(metaid):
+# meta_q = Session.query(Meta)
+# m = meta_q.filter_by(ixm=metaid).first()
+# Session.delete(m)
+# Session.commit()
+# return
+
+
+def deletecollection(id):
+ """ Deletes a collection - just the collection name and entry, not
+ all of the items under it
+ """
+ coll_q = Session.query(Collection)
+ c = coll_q.filter_by(ixk=id).first()
+ Session.delete(c)
+ Session.commit()
+ return
+
def getcollections():
""" gets a list of all collections in the database
Modified: arkaiv/trunk/arkaiv/model/__init__.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/templates/collections.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/collections.mak 2009-05-28 05:48:33 UTC (rev 3936)
+++ arkaiv/trunk/arkaiv/templates/collections.mak 2009-05-29 21:58:55 UTC (rev 3937)
@@ -6,6 +6,10 @@
% for coll in c.collections:
<li>
${ h.link_to(coll['name'], h.url_for(action="displaycollection", edit="no", id=coll['index'], name=coll['name'])) }
+${ h.form(h.url_for(action='deletecollection', id=coll['index']), multipart=True) }
+Delete collection:
+${ h.submit('Delete') }
+${ h.end_form() }
</li>
% endfor
Modified: arkaiv/trunk/data/templates/collections.mak.py
===================================================================
--- arkaiv/trunk/data/templates/collections.mak.py 2009-05-28 05:48:33 UTC (rev 3936)
+++ arkaiv/trunk/data/templates/collections.mak.py 2009-05-29 21:58:55 UTC (rev 3937)
@@ -3,8 +3,8 @@
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
-_modified_time = 1239258393.6922669
-_template_filename='/home/dcrowdy/src/arkaiv/trunk/arkaiv/templates/collections.mak'
+_modified_time = 1243493230.927696
+_template_filename='/home/dcrowdy/src/arkaiv/working/trunk/arkaiv/templates/collections.mak'
_template_uri='/collections.mak'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding=None
@@ -37,19 +37,28 @@
__M_writer(u'<li>\n ')
# SOURCE LINE 8
__M_writer(unicode( h.link_to(coll['name'], h.url_for(action="displaycollection", edit="no", id=coll['index'], name=coll['name'])) ))
- __M_writer(u'\n</li>\n')
- # SOURCE LINE 11
+ __M_writer(u'\n')
+ # SOURCE LINE 9
+ __M_writer(unicode( h.form(h.url_for(action='deletecollection', id=coll['index']), multipart=True) ))
+ __M_writer(u' \nDelete collection:\n')
+ # SOURCE LINE 11
+ __M_writer(unicode( h.submit('Delete') ))
+ __M_writer(u' \n')
+ # SOURCE LINE 12
+ __M_writer(unicode( h.end_form() ))
+ __M_writer(u' \n</li>\n')
+ # SOURCE LINE 15
__M_writer(u'\n<hr>\nAdd new collection:\n')
- # SOURCE LINE 14
+ # SOURCE LINE 18
__M_writer(unicode( h.form(h.url_for(action='addcollection'), multipart=True) ))
__M_writer(u' \n')
- # SOURCE LINE 15
+ # SOURCE LINE 19
__M_writer(unicode( h.text_field('newcollection') ))
__M_writer(u'\n')
- # SOURCE LINE 16
+ # SOURCE LINE 20
__M_writer(unicode( h.submit('Add') ))
__M_writer(u' \n')
- # SOURCE LINE 17
+ # SOURCE LINE 21
__M_writer(unicode( h.end_form() ))
__M_writer(u' \n\n')
return ''
Modified: arkaiv/trunk/data/templates/collections.mak.pyc
===================================================================
(Binary files differ)
More information about the commits
mailing list