Zamknięty

Build inline admin page (TabularInline) for M2M relationship

Hi all

TabularInlines work fine if the relationship between two models is based on a foreign key.

For example, if there is a Restaurant model and a Pizza model (with a foreign key to Restaurant), it is easy to add Pizza to the Restaurant admin page as a TabularInline:

class RestaurantAdmin([url removed, login to view]):

inlines = (PizzaAdminInline,)

class PizzaAdminInline([url removed, login to view]):

model = Pizza

The problem I am having is if the relationship is a many-to-many relationship.

For example, let's say there is a M2M relationship between Pizza and Toppings. (Pizzas can have many toppings, and toppings can go on many pizzas).

If I create [url removed, login to view] code like this, the inline will only contain the M2M relationship (the Pizza_Toppings object):

class PizzaAdmin([url removed, login to view]):

inlines = (ToppingAdminInline,)

exclude = ('toppings',)

class ToppingAdminInline([url removed, login to view]):

model = [url removed, login to view]

I think if you've used Django Admin Inlines you know the exact problem I'm talking about.

So, I need you to create a custom view/form/whatever to make ToppingAdminInline display all the Topping Model fields, just like they would be displayed if the relationship was a foreign key rather than a many-to-many.

Please let me know if you have any questions.

Thanks!

Umiejętności: Django, Python

Zobacz więcej: i m looking for a programmer to build my website, design my logo build a relationship for startup, design my logo - build a relationship for startup, facebook build term relationship, hope can build professional relationship future, themeforest net admin template profi admin, merge wordpress admin web site admin, magento page redirecting properly firefox admin, email copywriting relationship build, build page website simple, build page website me , build page flip, admin register login admin cp user cp php script, admin php mysql admin area galery, build inline advertising system, admin demo brd admin demo creditte login password, build page search searchable database apple address book, build term relationship game, build page portfolio, website application build page, sincerely looking forward work build term business relationship, type games will build term relationship, hope build term relationship, build page website, companies cebu marketing process build customer relationship

O pracodawcy:
( 16 ocen ) Hong Kong, Macau

Numer ID Projektu: #11978771

10 freelancers are bidding on average $162 for this job

sonus21

Hey there, I'm a professional Django web developer, having expertise in Django Rest Framework, Bootstrap, Jquery, HTML and entire Django ecosystems. You can some of the works in the portfolio or browse following links Więcej

$100 USD w ciągu 3 dni
(26 Ocen)
5.1
sudshekhar

Hi, I've been working with Django and Python for over 4 years now. I've created several websites and I think I can do what you want. My older projects include [url removed, login to view] and [url removed, login to view] I think I've u Więcej

$200 USD w ciągu 4 dni
(1 Ocena)
4.4
adilhussain0411

Hello, My name is Adil, I am certified python expert I have 4 years+ experience in python language and . i have completed 100+ projects using python .. Expertise : Python, Django, Django-Rest- Framework and many pyth Więcej

$166 USD w ciągu 10 dni
(4 Ocen)
3.5
JosephMohan

Hi Good 'ol M2M inlines... I have a lot of experience with this. You have 2 options: Stick with the Django admin, you can get almost the same as a normal inline, but i don't think i ever got an "add Pizza" butto Więcej

$150 USD w ciągu 3 dni
(2 Ocen)
2.7
scriptphp87

Hello, I'm a professional programmer for web programming with php language to build the system website, Besides, I'm also expert in MySQL , HTML,HTML5,CSS, JS I'm always top in Vietnam freelancer [url removed, login to view] Więcej

$222 USD w ciągu 7 dni
(1 Ocena)
2.8
sbijum88

Hi there, I have four years of experience with django framework, I can fix your problem, please consider. Thanks and Regards, Bijumon

$155 USD w ciągu 3 dni
(6 Ocen)
2.4
WeazenSoft

Hello Respected Sir/Madam, We have a team of Microsoft Certified Solution Developer (MCSD) and Design & Development and I have more than 7 years experience in software development and web development using Microsoft Więcej

$250 USD w ciągu 10 dni
(0 Ocen)
0.0
shahiddar

Hello, I am shahid from kashmir. Over the last 7 years, I have worked for several clients. Joined Freelancer with over 7 years of experience in , Data entry, Linkedin Lead generation , Google Research Expert,Web sc Więcej

$30 USD w ciągu 3 dni
(0 Ocen)
0.0
drishinfotech

Hello, Thank you for the posting. Please share the existing system so that I can overview the code. I also need to check the DB. Kindly initiate PM and discuss in detail about your expectations. In case of Więcej

$155 USD w ciągu 3 dni
(0 Ocen)
0.0
$300 USD w ciągu 3 dni
(0 Ocen)
0.0
ajay2916

Your Requirement is Adding a restaurant For the a restaurant there will be multiple pizza For a Pizza there will be multiple toppings There will be three Models [url removed, login to view] [url removed, login to view] [url removed, login to view] This i Więcej

$111 USD w ciągu 3 dni
(0 Ocen)
0.0