On Mon, Aug 15, 2011 at 3:03 PM, Ramdas S <[email protected]> wrote: > On Mon, Aug 15, 2011 at 3:00 PM, Asif Jamadar <[email protected] > >wrote: > > > charges = [(c.company_name) > > > > for c in > > ReportModel.objects.values('company_name').distinct()] >
.values returns a QuerySet that returns dictionaries when used as an iterable, rather than model-instance objects. https://docs.djangoproject.com/en/dev/ref/models/querysets/#values > > > > > > but it throws this error: " 'dict' object has no attribute > 'company_name'" > > > > > > paste the whole code somewhere may be dpaste.com and ask the question > > > > > any suggestions? > > _______________________________________________ > > BangPypers mailing list > > [email protected] > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > Ramdas S > +91 9342 583 065 > _______________________________________________ > BangPypers mailing list > [email protected] > http://mail.python.org/mailman/listinfo/bangpypers > -- ashok raavi _______________________________________________ BangPypers mailing list [email protected] http://mail.python.org/mailman/listinfo/bangpypers
