Find Jobs
Hire Freelancers

Print Object List with ManyToManyField

$10-50 USD

Ukończony
Opublikowano prawie 5 lat temu

$10-50 USD

Płatne przy odbiorze
I am trying to create a project and I have two databases, linked by a ManyToManyField, but I cannot get the actual field value to print on the html form. It just says [login to view URL] no matter what I do. I need assistance completing my code. It is a tiny app, I just can't get past this one snag. Here is my Model: class Enrollment([login to view URL]): Enroll_Student = [login to view URL](Student) Put_Student_Here = [login to view URL](Course, on_delete=[login to view URL]) def get_delete_url(self): return f"/withdraw/{[login to view URL]}/delete" def __str__(self): return '%s %s' % (self.Put_Student_Here, self.Enroll_Student,) Here is my Form: class EnrollmentModelForm([login to view URL]): class Meta: model = Enrollment fields = ['Enroll_Student','Put_Student_Here'] labels = { 'Enroll_Student':'Student', 'Put_Student_Here':'Course', } Here is my view: def roster_list_view(request): qs = [login to view URL]() #list out objects, this is a search view template_name = '[login to view URL]' context = {'object_list': qs} return render (request, template_name, context) HTML Form: {% extends "[login to view URL]" %} {% block content %} Course Roster {% for object in object_list%} {% include '[login to view URL]'%} {% endfor %} {% endblock %} In-Line Form: {‌{object.Put_Student_Here}}, {‌{object.Enroll_Student}} Withdraw Student When I run this, the display on the screen says: History Kristen Disney, [login to view URL] As you can see, it's the "ManyToManyField(Student)" value that's not coming out on the list. The ForeignKey field is coming over just fine.
Identyfikator projektu: 20092010

Informację o projekcie

3 ofert
Zdalny projekt
Aktywny 5 lat temu

Szukasz sposobu na zarobienie pieniędzy?

Korzyści ze składania ofert na Freelancer.com

Ustal budżet i ramy czasowe
Otrzymuj wynagrodzenie za swoją pracę
Przedstaw swoją propozycję
Rejestracja i składanie ofert jest bezpłatne
Przyznano:
Awatar Użytkownika
Hello, {‌{object.Enroll_Student}} is a queryset and not an object. I am a Python Backend Developer | DevOps Engineer | SRE. I am proficient with tools such as Docker, Kubernetes, Istio, Terraform, Gitlab CI/CD, Travis CI, Google Cloud Platform, IBM Cloud, AWS, etc I also have experience working on backend technologies such as Python, Django, Redis, celery, ActiveMQ, PostgreSQL, PostGIS, etc I am passionate about software development and learning about new technologies/skills in the same domain. I am self-motivated, diligent and a great team player. I focus on the following when working on projects: ● Following recommended standards. ● Proper logging and Exception Handling. ● Proper Documentation. ● Test Driven Development. etc I value the following, not just in software development but also all aspects of life: - Constant improvement. - Transparency and honesty. - Collaboration and friendliness. - Flexibility and open-mindedness. I am positive that I can bring the project many benefits with my experience, background, and forward thinking. I look forward to working with you. Sincerely, Samwel
$50 USD w 1 dzień
4,8 (10 opinii)
4,3
4,3
3 freelancerzy składają oferty o średniej wysokości $43 USD dla tej pracy
Awatar Użytkownika
Hi, I have 5+years Experience in Website/Software Design & Website Development. I'm an Expert in: -Frontend & Backend Development -Python -Data Science -Machine Learning -JVM technologies -Jquery, PHP -Ionic - Hybrid Mobile Applications -Angular, Node.js -Ruby on Rails -C++ Who Knows the value of time. Very hard working and always delivers the work on time. I will finish your tasks in a timely and efficient manner, I aspire to help others reach their goals through the use of my knowledge and experience, I am available 24 hours support. I am available for the weekend also. If you are looking for website design and development I am the right person for you.
$30 USD w 7 dni
4,9 (8 opinii)
4,0
4,0

O kliencie

Flaga UNITED STATES
Oklahoma City, United States
0,0
0
Zweryfikowana metoda płatności
Członek od cze 24, 2019

Weryfikacja Klienta

Dziękujemy! Przesłaliśmy Ci e-mailem link do odebrania darmowego bonusu.
Coś poszło nie tak podczas wysyłania wiadomości e-mail. Proszę spróbować ponownie.
Zarejestrowani Użytkownicy Całkowita Liczba Opublikowanych Projektów
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Wczytywanie podglądu
Udzielono pozwolenia na Geolokalizację.
Twoja sesja logowania wygasła i zostałeś wylogowany. Proszę, zalogować się ponownie.