Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Help me understand a djnago template sintax {% list_column list.columns.username %}
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
NMarcu  
View profile  
 More options Nov 5, 8:26 am
From: NMarcu <marcu.nico...@gmail.com>
Date: Thu, 5 Nov 2009 05:26:01 -0800 (PST)
Local: Thurs, Nov 5 2009 8:26 am
Subject: Help me understand a djnago template sintax {% list_column list.columns.username %}
Hello all, please help me understand this django template sintax:

{% list_column list.columns.username %}

I don't know from where is list_column, why is between {% %} and not
between {{ }}. I have a list pass to this tamplate that have colums
and username. The decoratros look like this:

def list(klass, title=None, s_f=None):
    def inner(view):
        def wrapper(request, env={}, *args, **kwargs):
            list = {}
            # template columns
            columns     = {}
            sort_field  = request.GET.get('sort', s_f)
            filters     = []
            for field in klass._meta.fields:
                name                = field.name
                column              = {}
                column['name']      = name
                column['filtered']  = request.GET.get(name, None)
                if column['filtered']:
                    filters.append((name, column['filtered']))
                column['asc_sort']  = sort_field == name
                column['desc_sort'] = sort_field == ('-' + name)
                column['caption']   = field.verbose_name
                columns[name]       = column
            list['columns'] = columns
            items = klass.objects.all()
            pager   = paginator.Paginator(items, 10)
            page_id = int(kwargs['page']) if kwargs.has_key('page')
else 1
            list['page'] = pager.page(page_id)
            list['title'] = title
            u_lg = request.user
            list['user'] = str(u_lg)
            env['list'] = list
           return view(request, env, *args, **kwargs)
        return wrapper
    return inner

This sintax make the head of a table.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Florian Apolloner  
View profile  
 More options Nov 5, 10:01 am
From: Florian Apolloner <f.apollo...@gmail.com>
Date: Thu, 5 Nov 2009 07:01:46 -0800 (PST)
Local: Thurs, Nov 5 2009 10:01 am
Subject: Re: Help me understand a djnago template sintax {% list_column list.columns.username %}
Plz ask usage questions on django-users

Thx.

P.S.: Btw it's "syntax" not "sintax"


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google