Hi,
I am getting the error "object is unindexable"
code :
company = Company.objects.get( id = companyid)
for ss in company.financials.all() :
ss[1].year
ss[1].revenue
ss.year and ss.revenue gives me the correct values for the entire list
but I am want to get only the first one.?
As I wanted only the first element in the list
Model :
class Financials(models.Model):
company = models.ForeignKey(Company, related_name="financials")
year = models.IntegerField()
revenue = models.FloatField(max_digits = 10, decimal_places = 2)
thanks for the help
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---