Posts by Italo Lemos • 251 points
12 posts
-
0
votes1
answer129
viewsA: Filtrar Foreign Key
Come on First point, no need django_select2 twice, just use as the documentation recommends: from django_select2 import forms as s2forms and then you call the widget that way s2forms.Select2Widget…
-
0
votes3
answers78
viewsA: Insert a list into a database made with Django
Entry.objects.bulk_create([ Entry(headline='This is a test'), Entry(headline='This is only a test'), ]) Only replace with the attribute (headline) you want, in your case nome…
-
0
votes1
answer52
viewsA: Multiple models - three apps
Just you set available to False when making an allocation This was done in the view, inside the method you create when set the dates, which class is you go there and change the boolean value: def…
-
0
votes1
answer359
viewsA: How to use back-end information on the front end with Python and Django?
Your class StatusListEmNavegacaoView is importing the model StatusVenda and not the model Status. In other words, the object available in your template will be Statusvendas and not Status. I…
-
1
votes3
answers354
viewsA: How to hide sensitive information in Django?
I like to use the python decouple to do this Have a tutorial here…
-
0
votes1
answer26
viewsA: Django Form - Status
You will set the disable attribute to true The disabled Boolean argument, when set to True, disables a form field using the disabled HTML attribute, so that it is not editable by users. Even if a…
-
0
votes2
answers169
viewsA: Login redirect Django does not work
You need to pass the url path as a parameter or the name of a view to be redirected as in the documentation example. Which name you set for view login in urls.py? 1.Passing the view name def…
-
0
votes1
answer302
viewsA: List_display in Django/Python
I think you’re wanting specific fields in the form, if that’s what you have to use fields and not list_display Here only name and title will be displayed in the form py.models class…
-
1
votes2
answers54
viewsA: Doubt with Lists
On your terminal python3 nome_arquivo.py
-
2
votes1
answer1208
viewsA: Multiple users and authentication - Django
Their authentication must be via email, which is a unique attribute. So you keep the primary keys of each user type. You can create a Profile class (Client or Counter) and then another one called…
-
0
votes2
answers114
viewsA: Error creating a simple Django table?
This must be the correct indentation class Produtos(models.Model): #id = models.AutoField(primary_key=True) nomeproduto = models.CharField(max_length=50, blank=True, null=True) quantproduto =…
-
0
votes1
answer192
viewsA: Error trying to validate field with required="required"
If you are using the bootstrap you can try with the bootstrap valiser Have an example of a form in the documentation http://1000hz.github.io/bootstrap-validator/#Validator-examples…