On Mar 29, 7:56 am, Asim Yuksel <a.sinanyuk...@gmail.com> wrote: > Sorry for not making it clear. The idea is to use default admin > template and help the admin to enter data from admin interface. I will > enter data via admin's default template. Lets say I have People and > Publications Table in my database. So when I click admin's add button, > it will display some fields to enter data for People and Publication > Tables. When I click save, the data will be saved to People and > Publications table. People and Publications are not related. They are > different tables. I cant use inlines option ind admin,py because the > tables should be related. > > On 28 Mart, 15:37, Gramware <dmb...@gmail.com> wrote: > > > On Mar 28, 8:40 pm, Asim Yuksel <a.sinanyuk...@gmail.com> wrote: > > > > I have two questions. > > > 1)I have two tables(People, Publication) and they are not related and > > > I want to display the fields of these tables on the same admin page. > > > So when I fill all the fields, I want to insert these values into > > > people and publication tables. > > > I do not fully understand your question, but if you would like to > > Iterate (loop over) 2 values in your template at the same time, you > > can use the zip command like blow > > > In your views.py > > > peo = People.objects.all() > > pub=Publications.objects.all() > > > render_to_response(template.html, {'tables':zip(peo,pub)}) > > > in your template (template.html) > > > {% for pe, pu in tables %} > > {{pe.field1}} {{pu.field1}} > > {% endfor %} > > > I am assuming that for each record in people, there is a matching one > > in publications > > > > 2) I also want to insert the id values of people and publication to a > > > bridge table(lets say PeoplePublication) whenever I do the first step. > > > > I guess I cant do the 1st one with inlines. How can I do this? > > > Why not use a ForeignKey? Have you tried the above solutions. P.S. I have no experience in hacking the Admin Interface, I have made my own Admin pages using the above process
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.