HBTaylor wrote:
> By the way, it seems like having the symbol in your Price model would
> be redundant, since you can use myprice.holding.symbol to get the
> symbol if you are listing (for example) all of the prices for a given
> day.
>
> H.B.
Actually H.B., after looking it over closer, i need
HBTaylor wrote:
> 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
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
Thanks Chris,I looked at that but it only gives me one record. What i need is the last price for each stock. Maybe im using the latest() function wrong?ThanksJohn
On 8/4/06, Chris Long wrote:This might help:
http://www.djangoproject.com/documentation/db_api/#latest-field-name-noneChris
This might help:
http://www.djangoproject.com/documentation/db_api/#latest-field-name-none
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
I have a model of stock holdings(id, symbol) and a model of stock
prices(id, symbol, price, date)
How would I go about filtering for just the latest prices for all the
stocks?
Your help is appreciated.
John
--~--~-~--~~~---~--~~
You received this message
6 matches
Mail list logo