Daniel Roseman wrote:
> It's an intentional limitation of the template language that you can't
> do that. You'll need to write a custom tag or filter - luckily it can
> be done very trivially as a filter:
>
> @register.filter
> def get_attr(obj, val)
> return getattr(obj, val)
>
> Now in the
On Wed, Sep 23, 2009 at 1:05 PM, Chris Withers wrote:
>
> Hi All,
>
> I have this view function:
>
> def index(request,model,pk=None):
>
> return list_detail.object_list(
> request,
> queryset=model.objects.all(),
> paginate_by=10,
> template_name='index.html',
On Sep 23, 6:05 pm, Chris Withers wrote:
> Hi All,
>
> I have this view function:
>
> def index(request,model,pk=None):
>
> return list_detail.object_list(
> request,
> queryset=model.objects.all(),
> paginate_by=10,
> template_name='index.html',
>
Maksymus007 wrote:
> {{object.name}} ?
no, that is the equivalent of:
getattr(object,'name')
I want:
getattr(object,name)
Subtle, but rather important, difference...
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
-
On Wed, Sep 23, 2009 at 7:05 PM, Chris Withers wrote:
>
> Hi All,
>
> I have this view function:
>
> def index(request,model,pk=None):
>
> return list_detail.object_list(
> request,
> queryset=model.objects.all(),
> paginate_by=10,
> template_name='index.html',
Hi All,
I have this view function:
def index(request,model,pk=None):
return list_detail.object_list(
request,
queryset=model.objects.all(),
paginate_by=10,
template_name='index.html',
extra_context=dict(
column_titles = [f.name for
6 matches
Mail list logo