Dnia 16-08-2010 o 19:25:50 Alec Shaner napisał(a):
Regarding your issue with get_next, could be because you're invoking the
method when you define default=get_next(). Try it with just the bare
method
name get_next.
You could also use the aggregate function instead of creating a new
model:
Dnia 16-08-2010 o 19:56:01 Nick napisał(a):
How about using an autofield?
Nope. Autofield requires primary_key=True, filed need to be editable, so
user can add values unordered, (10,11,12,13,17,25,9)
I'm checking out aggregation functions now.
--
Linux user
--
You received this message
How about using an autofield?
http://docs.djangoproject.com/en/dev/ref/models/fields/#autofield
On Aug 16, 12:25 pm, Alec Shaner wrote:
> Regarding your issue with get_next, could be because you're invoking the
> method when you define default=get_next(). Try it with just the bare method
> name
Regarding your issue with get_next, could be because you're invoking the
method when you define default=get_next(). Try it with just the bare method
name get_next.
You could also use the aggregate function instead of creating a new model:
http://docs.djangoproject.com/en/1.2/topics/db/aggregation
Hi, i have "number" field in "newspaper" model. I want assign to it
dynamically a default value, witch would be a incremented by 1 highest
value so far.
So i managed to make a little workaround, since i can't query for last
value of "number" field of model from model itself.
I have created
5 matches
Mail list logo