Questions tagged as 'django-admin'

1
answer

Customize Django Admin

I have 2 classes, one that is the Division and another that is Group. In the group I have the FK for division. I want to register a Storage in the Django Admin and select the Group I want the group to appear and divide it into the same sel...
asked by 22.01.2018 / 16:37
0
answers

Django admin use the request attributes

I'm developing an application in Django and have used the request data in form to validate some fields. For example, if the user who is changing form is from the "Administrator" group, changing the user's password does not have...
asked by 12.08.2018 / 17:22
1
answer

Upload and view PDF's Django admin

I want to ask a question, I'm trying to upload a PDF file, in django, and I wanted to know if you how do I view this pdf, I have the following code: models.py class Edital(models.Model): # ... class DataFile(models.Model): Arquiv...
asked by 08.02.2017 / 06:39
1
answer

How to add fields dynamically in Django?

I'd like to add fields dynamically in DjangoAdmin. Models.py file: class Book(models.Model): title = models.CharField(max_length=100) def __str__(self): return self.title class Author(models.Model): name = models.CharFiel...
asked by 13.01.2016 / 18:57
0
answers

Django Admin football game registration

Please help me. I'm learning Django. I have a site that registers some games in my city. Here is an example to understand the doubt: Championship: Holidays 2017 It has 2 groups (Group 1 and Group 2) I registered 6 teams (São Paulo, B...
asked by 25.06.2017 / 23:53
1
answer

How to set email as username in django

I have the following code to create a custom User: from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin,UserManager class User(AbstractBaseUser,PermissionsMixin): username = models.CharField('Nome de Usuário',max_len...
asked by 28.03.2017 / 14:11
1
answer

Custom Admin Django

I'm trying to change the login screen to a new custom screen, but it is not working. link I configured the settings: 'DIRS': [os.path.join(BASE_DIR, 'templates_admin')], I created folders and templates link But it is not wor...
asked by 22.02.2016 / 21:17
2
answers

filter list in a Django admin foreign key field

I have two questions, both related to the form automatically generated by django admin. If I create an administrative screen I can solve these problems, but working directly with the admin I am suffering a bit, even because I believe that the ad...
asked by 23.01.2018 / 18:01
0
answers

ValueError: Can not assign "'1'": "User.campus" must be a "Campus" instance. Error in Super User registration in Django

I'm developing an application where the user needs to be on a campus. However, when the superuser is created on the terminal, an instance error occurs. Note: The database is correctly pre-populated to search for 'campus_id'. Django 2.0.4 a...
asked by 05.01.2019 / 01:20
0
answers

Django 1.11 ManyToMany

Save some people, I'm having trouble servicing an old system. I have a form via Django Admin where I manage some information, in it I added a ManyToMany relationship but the form is getting like this: HereisthecodeI'musing:models.pyclassPale...
asked by 12.12.2018 / 00:37