Re: New member: Germano Carella. I need help with django, limit_choices_to and admin interface

2018-08-09 Thread germano carella
I found a tutorial! I studied ForeignKey and how it works with sets... Now, I'll learn how to create a form and how to save the new data in set. Thanks! Il 09/08/2018 22:59, Julio Biason ha scritto: Hi Germano, When you use "ManyToMany", you're saying "any book can have any chapter and v

Re: New member: Germano Carella. I need help with django, limit_choices_to and admin interface

2018-08-09 Thread germano carella
Hi Julio, Thanks, now is clear. Ok, I created models correctly and createa book in admin interface. Now I can create chapters to add this book. Now I want to learn how to create an interface that allows an user to add a new book, click on next button and add chapters to this book that is se

Re: New member: Germano Carella. I need help with django, limit_choices_to and admin interface

2018-08-09 Thread Julio Biason
Hi Germano, When you use "ManyToMany", you're saying "any book can have any chapter and vice versa". That's obviously what you don't want. What you want is "A book has a closed set of chapters". This is done by thinking a bit on the other way with Django: Instead of saying "There is a list of chap

New member: Germano Carella. I need help with django, limit_choices_to and admin interface

2018-08-09 Thread Germano Carella
Hi, I'm Germano from Italy. I'm new of django. Probably this discussion has many many examples, but I can't find my situation. I have two models, Book and Chapters. These are simple models, I need them only for educational purpose. class Book(models.Model): title=models.CharField(max_length=2