Questions tagged as 'django'

2
answers

How to perform an arithmetic operation by changing numerous fields in the database efficiently?

There is a table with 200 records and one of the fields is responsible for indicating the order that these data are displayed (0, 1, 2, 3, 4, 5, ...). I need to rearrange this data, pick up the record from position 167 and put it in position 3,...
asked by 25.08.2017 / 02:49
1
answer

Array multidimensional python

I have a series of data that I would like to organize by title, example; movies = [ 'movie': [ 'legenda' [ 'dub', 'leg', 'nac' ], 'time': [ 1, 2, 3, 4, 5 ] ] .... ] I've tried dict()...
asked by 12.09.2016 / 21:18
1
answer

ImportError: can not import name patterns in django

The application in django was working normally until I was putting django-comments, I first installed it with setup.py that came along, I believe that this is what is causing the problem, then I put it together with the project folder and refere...
asked by 20.06.2016 / 23:13
2
answers

How to write the date and time of an error in the Django log?

I started a project in Django 1.4, and every mistake I made via try..except I printed in sys.stderr - making it fall into the same Apache log file (error.log). It worked, but only for the errors that I explicitly took, and in addit...
asked by 03.10.2016 / 20:28
1
answer

Django Debug Toolbar

Good evening !! Can anyone help me with this error, I'm trying to use debug_toolbar: Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/sara/dev/virtual/loc...
asked by 11.05.2016 / 05:13
1
answer

Django - extend admin template

could someone indicate the best way to extend the django template? and how best to share a template with the admin and site area. I'm using django version 1.8.6 and django-bootstrap3 Thank you.     
asked by 21.11.2015 / 22:12
1
answer

How do I join with Django?

I'm trying to run this SQL using Django's ORM SELECT * FROM test JOIN questionnaire q ON (q.id = test.questionnaire) WHERE q.discipline = 4; Templates:    Test, Questionnaire, Discipline     
asked by 31.10.2015 / 05:38
1
answer

Remove session data dictionary with ajax in Django

I have an array with a data dictionary in my session and would like to remove according to the line that the user is clicking on a table where those values are displayed. My view: def deletar_servico_ou_item_selecionado(request): if re...
asked by 29.10.2015 / 14:14
1
answer

Filter with ChoiceField (Django)

Consider my form: forms.py status_list = ( ('', ''), ('c', 'cancelado'), ('elab', 'em elaboração'), ('p', 'pendente'), ('co', 'concluido'), ('a', 'aprovado') ) class StatusSearchForm(forms.Form): status = forms....
asked by 25.07.2015 / 06:46
1
answer

Queryset: Getting the description of the accessories in the application (Django)

Consider the example below: class Vehicle(models.Model): vehicle = models.CharField(_('veículo'), max_length=50, unique=True) price = models.DecimalField(_(u'preço'), max_digits=8, decimal_places=2) kit_fabric = models.ForeignKey(...
asked by 07.06.2015 / 08:48