Template tags for sorting based on table headers

2006-03-02 Thread Chetan Vaity
Hi all,Here is a first cut implementation for a custom template tag which makes providing sorting on table headers easy.Assume that your model is something like:class Vegetable(meta.Model):    name = meta.CharField ()    wt = meta.PositiveIntegerField()    You will need to do the following things t

How does one access the human readble names given in the model

2006-03-01 Thread Chetan Vaity
Example model:class Vegetable(meta.Model):   name = CharField("Name of the vegetable", maxlength=10)   freshness = PositiveIntegerField("How fresh is it", maxlength=2)With the django API: from django.models.vegetable import *v = vegetables.get_object(pk=1)Now, how can I get the human readble name o

Multi-page forms

2006-02-23 Thread Chetan Vaity
Hi,I want to build a two-page form for creating an object. As I see it there are two options:1. Store values in hidden fields2. Use the session to store the variables from the first formAny Django best practices? - Chetan --~--~-~--~~~---~--~~ You received this mess

Re: Dynamic choices

2006-02-14 Thread Chetan Vaity
Thanks Amit and Adrian,I think I'll do something like what Amit said or write a custom manipulator.- ChetanOn 2/8/06, Adrian Holovaty < [EMAIL PROTECTED]> wrote:On 2/8/06, Amit Upadhyay < [EMAIL PROTECTED]> wrote:> > What I notice is that whenever an entry is added to LDAP, it is not> reflected in

Dynamic choices

2006-02-08 Thread Chetan Vaity
Hi all, I have a model which looks somethng like: class MyModel(meta.Model):     id = meta.AutoField(primary_key = True)     name = meta.CharField(maxlength=20, unique=True)     location = meta.CharField(maxlength=100, choices=getLocationChoices()) and getLocationChoices() is a function defined