Re: How would I do this with Djangol?

2006-08-05 Thread HBTaylor
I'm not sure about your models, but I assume it is something like the following: from django.db import models class Holding(models.Model): symbol = models.CharField(maxlength=10) def __str__(self): return self.symbol def _get_latest_price(self): return

Re: Can I use an __init__ method on a model ?

2006-07-25 Thread HBTaylor
I came to this thread with what might be a similar need. For example, if I'm writing a time-tracking app, I might have an Entry model. Whenever I create instances of the model (via the DB API or in views), I would like to have the "start time" field default to now(), so a user entering a time

Re: DateTime FormFields again! Need Help!

2005-09-06 Thread HBTaylor
I believe there is a ticket showing that as a defect: http://code.djangoproject.com/ticket/337

Re: datetime field / form output

2005-09-02 Thread HBTaylor
I'm sorry to respond with a "me, too" instead of a solution, but I believe your problem and mine may be related. In http://groups.google.com/group/django-users/browse_thread/thread/f1219e342a8c89f0 (with a title of "selected" for ForeignKey field?), I have a ForeignKey field. When I use a Generic

"selected" for ForeignKey field?

2005-08-30 Thread HBTaylor
I have a model with the following (exerpt): class Team(meta.Model): name = meta.CharField(maxlength=200) venue = meta.CharField(maxlength=200) division = meta.ForeignKey(Division) # snip snip snip class Division(meta.Model): name = meta.CharField(maxlength=40) conference