summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2011-06-10 21:13:58 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2011-06-10 21:13:58 +0200
commit2357a3cd753e7b44b69a71af2dca2f2ab8149c46 (patch)
treeb6b75f7912a63377d527370b781749c76e0e9d40 /ishtar/furnitures/views.py
parentd8cf5141cb77d24fba858ed9123c84359a0c0dd2 (diff)
downloadIshtar-2357a3cd753e7b44b69a71af2dca2f2ab8149c46.tar.bz2
Ishtar-2357a3cd753e7b44b69a71af2dca2f2ab8149c46.zip
"+" buttons to simplify the adding of items when necessary (closes #428)
Diffstat (limited to 'ishtar/furnitures/views.py')
-rw-r--r--ishtar/furnitures/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py
index 40e9aeaf0..1bdca3442 100644
--- a/ishtar/furnitures/views.py
+++ b/ishtar/furnitures/views.py
@@ -511,7 +511,7 @@ def new_item(model):
not_permitted_msg = ugettext(u"Operation not permitted.")
return HttpResponse(not_permitted_msg)
frm = getattr(ishtar_forms, model_name + 'Form')
- dct = {'title':unicode(_(u'New ')) + unicode(_(model_name.lower()))}
+ dct = {'title':unicode(_(u'New %s' % model_name.lower()))}
if request.method == 'POST':
dct['form'] = frm(request.POST)
if dct['form'].is_valid():
@@ -523,6 +523,7 @@ def new_item(model):
if '_select_' in dct['parent_pk']:
parents = dct['parent_pk'].split('_')
dct['parent_pk'] = "_".join([parents[0]] + parents[2:])
+ print dct
return render_to_response('window.html', dct,
context_instance=RequestContext(request))
else:
@@ -532,6 +533,8 @@ def new_item(model):
return func
new_warehouse = new_item(models.Warehouse)
+new_person = new_item(models.Person)
+new_organization = new_item(models.Organization)
def action(request, action_slug, obj_id=None, *args, **kwargs):
"""