NoReverseMatch at Django

and I do not know why and what will be the problem, could they help me? Thanks beforehand, greetings! Reverse for 'entregado' with arguments '()' and keyword arguments '{'cod_experto': 'ASE-0048', 'id_pedido': 1770}' not found. 1 pattern(s) tri...
more »

2017-03-17 14:03 (1) Answers

Placing div's with float

I have one big list of dictionaries in django view as follows: 'description': [ { 'name': 'Onderdelen', 'good': ['Motor', 'Versnellingsbak', 'Koppeling', 'Carburatie - injectie - Diesel injectie + verstuivers'], ...
more »

2017-03-16 13:03 (1) Answers

Wow does six.with_metaclass() work?

Hi Stackoverflow community I have been trying to understand how Django (and Wagtail's Stream-field) work under the hood. Doing that I learned about metaclasses and believe to have a handle on the principle. That said, exactly how SIX executes the wi...
more »

2017-03-16 05:03 (1) Answers

Django admin: view hangs on field_sets block

I have encountered a weird behaviour where one of the admin views which is quite simple and straight forward takes a while to load up until an nginx timeout in prod. Through Django debug toolbar and new relic I have found that the guilty code is the...
more »

2017-03-15 14:03 (1) Answers

Django - UNIQUE constraint failed

I could'nt solve my problem even if I looked other people who had this problem. How to create an id with foreign key? And how can I use the id? This is my code: class Receipt(models.Model): amount = models.DecimalField(max_digits=5, decimal_pl...
more »

2017-03-14 21:03 (1) Answers

use django's reverse function in req.path

I was stumbling on invitation feature to understand how it works. I found the blog post on http://www.pythondiary.com/tutorials/create-invite-only-website.html. There the author says (It checks the path as this will cause an infinite loop if not chec...
more »

2017-03-14 17:03 (1) Answers

Django sort records by calculated field

I have a model: class Person(models.Model): score1 = models.FloatField(default=0) score2 = models.FloatField(default=0) score3 = models.FloatField(default=0) and I need to sort the records by the average score (i.e. (score1 + score2 + ...
more »

2017-03-13 20:03 (1) Answers

django tables how to detect if table is empty

I am new to django and web development and based on examples and help on SO, I have pieced together something which takes a model and renders it in a django-table. My template code is basically as follows: {% block content %} {% load static %} {% lo...
more »

2017-03-13 12:03 (2) Answers

Django view not updating after changes in model

I am running into a problem with a Django project I am currently working on. I have a view in which I create a model instance via a POST request: class CreatePollView(View): template = "polls/create_poll.html" @method_decorator(login_requi...
more »

2017-03-13 11:03 (1) Answers

query is not returning kwargs results django

The kwargs are getting passed into my query but the values are not showing in my drop down box, no values are being displayed in the drop down box. forms.py class ChooseCarMakeModelForm(forms.Form): car_model = forms.ModelChoiceField(que...
more »

2017-03-12 22:03 (1) Answers

Django create new record instead of updating

I have the following model class FooBar(models.Model): FOOBAR_ID = models.AutoField(primary_key=True) foo = models.CharField(max_length=255) bar = models.CharField(max_length=255) Moreover, I have created a form that allows me to edit ...
more »

2017-03-12 16:03 (2) Answers