well, im also a beginner but i think this should help you : http://docs.djangoproject.com/en/dev/ref/models/querysets/
Scroll down abit. there is example about books and authors which have quite similar relations to your models. In any case your information should e possible to get with one django query or queryset Alan. On Apr 15, 5:06 am, Emma F <emma.f.he...@gmail.com> wrote: > I feel like there must be something very elementary that I'm missing > here, but I've been all through the documentation and can't figure it > out. > > Say an app includes three models: > > - "Products" > (includes fields: Product Name, Supplier, Cost Price, Retail Price > > - "Customers" > (includes fields: Customer Name, Address, Contact Number, Payment > Details) > > - "Orders", a list of individual orders placed with the business. > (includes fields: Product Name, Customer Name, Delivery Address, > Price, Payment Details) > > The Product Name and Customer Name fields in "Orders" are ForeignKey > fields linked to the relevant models. Each Order only involves one > Product and one Customer. > > My question: Is it then possible to autopopulate the other fields in > the Orders model (eg. delivery address, payment details, retail price) > with the corresponding default information associated with that > Product or Customer? I'm using hooks to the save(self) process in the > admin, and it's working fine for hard-coded values, but I can't get it > to go to the related objects for data. > > I'd be very grateful for any nudge in the right direction. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---