Questions tagged as 'django'

0
answers

About writing output of an Enum in Graphene

I am working with graphene and graphene-django and I have a problem with a field, that the values of choices are a number. When making a query, the result is "A_1" and it should be 1 (integer). For example: class Foo(model...
asked by 26.01.2017 / 20:57
1
answer

Paginate result of a POST form in Django

Good, I've been looking for an optimal solution for paging a list of cars resulting from a search through a POST form. I found the solution by adding that list of cars to request.session but that solution is inefficient and very slow, it take...
asked by 31.12.2016 / 14:30
1
answer

Add new fields on models.py in Django

I have the following model in models.py: class Videos(models.Model): title = models.CharField(max_length=45) link = models.CharField(unique=True, max_length=45) class Meta: managed = True db_table = 'Videos' d...
asked by 02.01.2017 / 20:07
1
answer

Key error in django when using kwargs.pop

Good, I would appreciate the help, I seem to be blocked with this, and it should not be complicated. I have a function in views.py that instantiates a form in the following way form = BusquedaPresenciaForm(initial={'fecha_inicio': datetime....
asked by 17.01.2017 / 12:14
2
answers

Problems synchronizing the database in Django

I'm creating an app in Django and when I try to run "makemigrations" I get the following error > (env) C:\Users\Jorge Ceron\env\Scripts\lgsbeta>python manage.py > makemigrations Traceback (most recent call last): File "manage.py", &...
asked by 26.12.2016 / 03:19
2
answers

Delete part of a URL with Django

Performing an application in Django (without using the forms that the framework brings), when accessing to edit a record the url that the browser shows me remains as follows: Up here all good, but once I edit the record I have the same...
asked by 26.12.2016 / 17:37
1
answer

Help with a $ scope and data from a database on google maps

I have a problem and I do not know how to use a scope variable and show it on the map, it does not recognize the location /** * Created by gamba on 20/10/2016. */ var app = angular.module("mapas",[]); app.controller("myctrl",func...
asked by 07.12.2016 / 00:49
2
answers

Django do group by with sum

I have a Warehouse Movements model, I want to take stock per warehouse of an item. The SQL query is: select almacen_id, sum(uentrada), sum(usalida) from Almacen_movimiento where articulo_id = 2 group by almacen_id I try this: mv...
asked by 05.11.2016 / 19:10
1
answer

Request POST in Django with AJAX function in Angular

I'm doing an AJAX function in angular where I pass a value for POST and it returns an object in JSON. My AJAX function is this: $http.post('/get_professional_info/', {idProfessional: id}).then( function mySucces(response) {...
asked by 02.11.2016 / 19:24
1
answer

Filter by a queryset with 2 kwargs

I have a URL where I pass 2 parameters: Edicionlist.hmtl <a class="btn btn-primary btn-xs" href="{% url "inscripcion:inscripciones_personas_edicion-list" programa=element.id edicion=element.edicion%}"> <span class="glyphicon glyp...
asked by 20.12.2016 / 12:31