> hi all, needs help here..... i declare this in views.py > > ds = DigitalSignage.objects.get(pk=ds_id) > setting = ds.setting > textslots = ds.textslot_set.all() > slots = ds.slot_set.all() > tableslots = ds.tableslot_set.all() > columnsetups = tableslots.columnsetup_set.all() > querysetups = tableslots.querysetup_set.all()
> > > but i got error in this : > Request Method: GET > Request URL: http://localhost/reed/1/ds.xml > Exception Type: AttributeError > Exception Value: '_QuerySet' object has no attribute > 'columnsetup_set' > Exception Location: c:\django\reed\products\views.py in dsxml, line > 91 > Python Executable: C:\Program Files\Apache Software > Foundation\Apache2.2\bin\httpd.exe > Python Version: 2.5.1 > > tableslots and columnsetup is many to many relationship. the same > with ds > and tableslots many to many relationship. i don;t know what's > wrong.. anyone > can help plis... As the error message mentions, 'tableslots' is a QuerySet (since you obtained it with .all()), not an object. Using the (backward) relationship for that isn't defined; only for an object. So you'll need to iterate through tableslots one by one, or use lookups that span relationships: http://www.djangoproject.com/documentation/db-api/#lookups-that-span-relationships --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---