Re: Unable to load a modified tabular.html
begin:vcard
fn:Pantelis Petridis
n:Petridis;Pantelis
adr:;;;;;;Greece
email;internet:ppetrid@yawd.eu
title:Yawd Web Applications
tel;cell:+(30) 6945108314
url:http://www.yawd.eu
version:2.1
end:vcard
You don't have to create any custom view. Just set the template in your inline model
class MyInline(admin.TabularInline):
template = 'path/to/the/template.html'
Hope this helps!
On 10/24/2013 06:32 PM, Vittorio wrote:
class MyInline(admin.TabularInline):
template = 'path/to/the/template.html'
Hope this helps!
On 10/24/2013 06:32 PM, Vittorio wrote:
Context: Mac OS X 10.7, Django 1.5.4 using Admin I was able to taylor the admin/edit_inline/tabular.html to eliminate some redundant info (such as the obsessive label indicating from which Object is extracted the inline record, repeated record by record!) in my many inlines putting the revised tabular.html under $MYPROJECT/templates/admin/edit_inline/. It works like a charm! Now, for a specific model only I need to modify tabular.html eliminating the 'delete?' label and the relating little boxes in each record of the inline model. Therefore I created a mytabular.html file and put it under myproject/templates/admin/ then in # views.py def mytabular(request): return render_to_response('mytabular.html') # urls.py urlpatterns = patterns('', ............. url(r'^magazzino/', include(admin.site.urls)), url(r'^movimentoordine/(\d+)/$', 'magazzino.views.mytabular', name='mytabular'), ) [The called url is e.g. 'http://localhost:8000/magazzino/magazzino/movimentoordine/2/'] Unfortunately django doesn't seem to take my desire into account and invariably calls admin/edit_inline/tabular.html instead of mytabular.html as debug_toolbar says. I tried also to put mytabular.html under $MYPROJECT/templates/admin/edit_inline/ to no avail. Please help. Ciao Vittorio
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home