Questions tagged as 'django-models'

2
answers

Select dependent on Django?

How do I place four select to my template that show state, municipality, location? and of course, if the user selects the state DF, the other select only brings the municipalities and localities. How do I do it? In order to save them al...
asked by 04.01.2016 / 18:07
3
answers

Django REST Framework Serializing models that have fields / relationships ForeignKey and ManyToManyFields

The challenge of this question is clear from the update 2 which is the current state of it, you can read it full to understand its context if you want :) I have the following model that I want to serialize to expose via REST class Rehab...
asked by 08.03.2016 / 17:25
1
answer

Django REST Multiple Models (base_name & queryset) error

I am trying to use the Django REST Multiple Models and I have created the models and the viewset. But when trying to enter the url of the api, I get an error: link    'base_name' argument not specified, and could not automatically   dete...
asked by 24.05.2016 / 10:50
3
answers

Use of def __unicode __ (self):

Use Django 1.9. I have two models related to each other, one contains an id and name among other attributes and the other contains its own id along with the id of the first model: class Televisor(models.Model): idTelevisor = models.AutoFie...
asked by 10.02.2016 / 02:44
1
answer

Create models.forms dynamically in Django

Good Night with everyone There is some way to create Django form from the existing Django models in a dynamic, automatic way or maybe by doing a for or a loop. I ask this question already if I have for example 2 Company and Book models, th...
asked by 21.02.2018 / 04:58
1
answer

Modifying some Django admin behaviors regarding their generated forms

I have a model which I am manipulating through the Django administrator. The model and "its business logic" requires me to establish a specific behavior regarding its form to enter data. What I need to do is the following: I have the follo...
asked by 01.02.2016 / 22:24
1
answer

Cross imports in Django

In my Django project I have 2 apps, as the following map shows: Django/ProyectoWeb/Apps/ ├── Catedra └── Usuarios Without detailing much: The Chair has a unique model called Commission. Users have 2 models called Student, Teacher....
asked by 20.07.2017 / 03:02
1
answer

Return in a ListView information of 2 models filtered by the authenticated user

Hi, I'm new to django and would like to know how I can return the information of an authenticated user of 2 models in a ListView This is my code: models.py from django.contrib.auth.models import User class ModelOne1(models.Model):...
asked by 20.08.2018 / 17:35
1
answer

How to load a large volume of data with Django Querysets?

I have a loading process in a Django project which from an excel file stores information in a Business model. My loading process works, the problem is that the execution time is too high due to the data volume of the excel input. Model.py...
asked by 14.05.2018 / 17:29
1
answer

Display radio button in django?

Hi, I have this problem ... I can not manage to display the radio button in the template ... in which I'm wrong? models.py class Genero(models.Model): MASCULINO ='mas' FEMENINO ='fem' Type_CHOICES = ( (MASCULINO,'masculi...
asked by 05.02.2017 / 02:14