Questions tagged as 'django'

1
answer

Django ManyToManyFiled how to add 2 objects of the same type to a model

I'm doing an inventory of tools, and I want to have a way to create a tool cart where I can add repeated tools. Example (Add to the cart two cutters of the same type). I have a table called Item This table contains all the common fields of...
asked by 17.07.2018 / 23:26
0
answers

mask to format input data

How can I generate a mask to format an entry data, I mean, I'm working on a pretty old web application in django (1.5) and I want to format a field in a registration form (in this case, the Chilean the form xx.xxx.xxx-x) at the moment it is not...
asked by 24.07.2018 / 19:29
1
answer

Store the id of the object in a manytomany field

I have a user model in django with a field: wallets = models.ManyToManyField(Wallet) and a Wallet object with other fields. I currently store the names of the Wallets objects assigned to the user in the user's wallets field. How can I store...
asked by 15.07.2018 / 15:26
0
answers

Django-Leaflet: First argument in 'static' must be 'as'

Recently I upgraded django from version 1.8 to 1.11 and I have problems with the static loads of the tool django-leaflet , this is the error: I have installed: Django == 1.11.14 django-geojson == 2.11.0 django-leaflet = =...
asked by 16.07.2018 / 20:50
0
answers

How to insert id in csv reading with DJango

I have the following question, in which way I can insert an id that I have obtained from another table, in reading a .csv file, which I am importing into my database with the django-import-export library. I have the code in the following way...
asked by 16.07.2018 / 17:57
0
answers

Connect database from the view

I have this configuration in the settings.py to work with sql server that works fine DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'almaceninterno', 'USER': 'postgres',...
asked by 16.07.2018 / 15:52
0
answers

error formset Django

I am editing a product form in which I want to replace several sizes in a product. If you have created 5 and when updating the pass 1 single form returns this error:    MultiValueDictKeyError at / edit-article-boutique / test /       "'sizes...
asked by 16.07.2018 / 10:45
1
answer

Problems with css and js files Django 2.0.7 and Python 3.7

I can not upload my static files css and js: Mi settings : import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #PROJECT_ROOT = os.path.dir...
asked by 10.07.2018 / 00:45
1
answer

Django 2 pick up parameter passed in the url inside a ListView

If I have a URL that passes a parameter as follows http://mysite/person/car?parametro=1 In a ListView I get that parameter in the following way Parametro = request.GET.get("id") But if the parameter is passed in the url "person/<i...
asked by 10.07.2018 / 20:09
0
answers

Custom endpoint API REST FRAMEWORK

I'm trying to make an endpoint to show the data of different models.    Webinars, Slide, Academy class Webinars(BaseTitle, Timestamp) class SlideBanners(models.Model) class Academy(BaseName, Timestamp) These models do not have relatio...
asked by 19.07.2018 / 16:46