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
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
I believe there is a ticket showing that as a defect:
http://code.djangoproject.com/ticket/337
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
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
5 matches
Mail list logo