Skip to content

Tag: django

Formset Not Saving on UpdateView Django

I’m having problem on formset not saving on UpdateView. This has been discussed in several SO post, and so far I can summarized them to following Make sure to pass an instance. Hence. Reference context[‘formset’] = journal_entry_formset(self.request.POST, instance=self.object) Override the P…

Django How to get GET parameters in template

I’m working on a django project. I’m wondering how to get GET parameters in template so that I can make corresponding tab active. I tried the code below, but it didn’t work. Thank you in advance. Answer Get it in view and send it as parameter in render and use it in template Or get it as and…

Where developers save choice options in Django?

For example i have a choice Should i create a model like: and create some color instances in django-admin or i need to declare CHOICE(above), where i save all colors(even if there are many colors)? Answer Let’s say you need to make a model product and this model has multiple colors. In this case you nee…