On 8/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > my_print = Print(paper_type=1) > print my_print.paper_type > > will print out 1. Is there a recommended pattern for printing out > "Letter"?
Generally this is the pattern we've used in our own code: """ class Print(meta.Model): paper_type = meta.IntegerField(choices=TYPE_CHOICES) module_constants = {'TYPE_CHOICES': TYPE_CHOICES} def get_paper_type(self): return TYPE_CHOICES[self.paper_type] """ That is, you pass TYPE_CHOICES in module_constants to make it available to the Django-created module -- then create a custom method. We're totally open to making a better way to do this. Any ideas? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org