TypeError __init__() takes 1 positional argument but 2 were given

2021-10-18 Thread Jose Cabrera
hello everyone, please help me with this error that is generated in the views.py, in class registro(CreateView): Thank you form.py class RegistrationForm(forms.ModelForm): password = forms.CharField(label='Password', widget=forms.PasswordInput) class Meta: model = UserProfile

Re: cannot get value(foreign key) after using distinct()

2021-10-18 Thread Lalit Suthar
since you are using .first() in the query, it will return only 1 object so I don't think using a for loop our 'category' in template will work On Mon, 18 Oct 2021 at 18:04, Katharine Wong wrote: > Hi all, > > There is a question when I use distinct(). > When I try to use the ORM(distinct &

Custom User error

2021-10-18 Thread Jose Cabrera
Greetings, I am starting in the world of django and I have some problems with a custom user, for the registration of users to the database, the example that I have works 100% with the user that comes by default allows me to render the registration form user without any inconvenience, but when

Custom User error

2021-10-18 Thread Jose Cabrera
Greetings, I am starting in the world of django and I have some problems with a custom user, for the registration of users to the database, the example that I have works 100% with the user that comes by default allows me to render the registration form user without any inconvenience, but when

Custom User error

2021-10-18 Thread Jose Cabrera
Saludos, me estoy iniciando en el mundo de django y tengo algunos problemas con un usuario personalizado, para el registro de usuarios a la base de datos, el ejemplo que tengo funciona al 100% con el usuario que viene por defecto me permite renderizar el formulario de registro de usuario sin

Re: DJNAGO Many to Many field MultiSelect Into DropdownList

2021-10-18 Thread Shaheed Haque
On Mon, 18 Oct 2021 at 15:41, Sebastian Jung wrote: > When u use SelectMultiple then you get a select widget where you can > select many options Your code are wrong in forms.py in widgets= > > Am Mo., 18. Okt. 2021 um 16:22 Uhr schrieb 'Maryam Yousaf' via Django > users : > >> It is

Re: DJNAGO Many to Many field MultiSelect Into DropdownList

2021-10-18 Thread Sebastian Jung
When u use SelectMultiple then you get a select widget where you can select many options Your code are wrong in forms.py in widgets= Am Mo., 18. Okt. 2021 um 16:22 Uhr schrieb 'Maryam Yousaf' via Django users : > It is already selectmultiple . I need dropdown where I can select multiple

Re: DJNAGO Many to Many field MultiSelect Into DropdownList

2021-10-18 Thread Sebastian Jung
Hello, then change in widgets Select() to SelectMultiple(). https://docs.djangoproject.com/en/3.2/ref/forms/widgets/#selectmultiple Regards Am Mo., 18. Okt. 2021 um 15:51 Uhr schrieb 'Maryam Yousaf' via Django users : > Hi, > > I have one manytomany field in one of my model which is currently

DJNAGO Many to Many field MultiSelect Into DropdownList

2021-10-18 Thread 'Maryam Yousaf' via Django users
Hi, I have one manytomany field in one of my model which is currently coming as Multiselect but I need a dropdown where user can select multiple values as I have huge data to show. I am trying this in forms.py but it is not showing dropdown field. Kindly help me out. *Model.py:* class

cannot get value(foreign key) after using distinct()

2021-10-18 Thread Katharine Wong
Hi all, There is a question when I use distinct(). When I try to use the ORM(distinct & value), I cannot get the value of the attribute(foreign key). models.py class Category(models.Model): category = models.CharField(max_length=20) class Article(models.Model): category =

Re: User matching query does not exist.

2021-10-18 Thread Nicholas Bartlett
Hi all, I have a similar issue on my DB. Internal Server Error: /ms_app/customers/19 Traceback (most recent call last): File "/Users/nicholasbartlett/Documents/Dashboard/djangodash/djenv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response =

How to get a chinese django tutorial

2021-10-18 Thread 银色配色
Dear Team, I recently learned django tutorials on django's website, which has tutorials in Chinese, but it's not convenient to visit django's website in my work environment. Is there any way to download the Chinese version of Django tutorial PDF file or epub file? -- You received this message