Most voted "django-2.0" questions
65 questions
Sort by count of
-
0
votes1
answer183
viewsDefault values in the model - Django
I am studying Jango and trying to set a standard value for a field when makemigrations is executed, would inform that such field would receive a default value like 0 models.IntegerField(default=0)…
-
0
votes1
answer209
viewsCheck if there is object in instantancy
I wonder how I check for variable object in Python. I tried so: try: select_me = User.select_me(request) select_random = User.select_random(request, 3) me = select_me.username random =…
-
0
votes0
answers845
viewsForeign key relationship on Jango
I have two tables in the Client and Animal model, where animal has a foreign key for Client, I can list all the animals related to the client in the table, but customers who do not have animals…
-
0
votes0
answers25
viewsSet a Datefields Arrayfield
I need to store several dates in a Django model (I’m using version 2.1), I was able to create several fields, thus: date1 = models.DateField(null=True, blank=True, verbose_name="Data da parcela 1")…
-
0
votes1
answer79
viewsHow can I get access to deleted objects in Django?
I’m developing a parking management system in Django that registers the 'Vehicle' object according to its time of entry, and calculates the value as it goes, but I need to develop a reporting system…
-
0
votes1
answer196
viewsPython error with Django on_delete
I’m a beginner in the Django platform and the Python language and I’m developing a website in Django 2.2 and Python 3.7.3, and I have a problem with my code on models.py from my app "Courses". class…
-
0
votes1
answer61
viewsInsert direct tuple with SQL in a Django view
I’m using Django in two projects (let’s call Project1 and Project2) that relate and share the same database, but because they are different projects, they do not share the same apps. Now I need to…
-
0
votes2
answers295
viewsForeignkey using User in other models
I’m developing a quotation site for language study purposes. I have customized the User models and it includes other attributes such as address and city for example. The problem now is to write the…
-
0
votes1
answer509
viewsHow to Serialize more data from more than one table in Django Rest-framework
Speak People! I am the following problem: I have a buy-and-sell schedule: class SalesOrBuy(models.Model): client = models.ForeignKey(Client, null=True, on_delete=models.CASCADE) mode =…
-
0
votes0
answers13
viewsHow to show additional options after filling a Selection box in Django Admin
When trying to register in Django Admin I have three fields to fill out being them tipo_remuneracao valor and valor_max, however depending on the type of compensation I may need to show value and…
-
-1
votes1
answer58
viewsif and Is between loan
Thus, I created a user table and a business, both inherit from the Django user table. Perfect, both your users and tables. But I have a menu and a profile page.html and wanted that in this menu…
-
-1
votes1
answer65
viewsUrl checks - Django
When learning to develop applications using Django it is common to get the following URL: locahost:8000/minhaentidade/deletar/id However, a malicious user may change this id and end up deleting…
-
-1
votes1
answer43
viewsarticles_article.author_id Error
I’ve been following the blog creation tutorial using the previous version of Django 2.0 (this one here: https://youtu.be/zJWhizYFKP0), however I use version 2.0, in the process I have been making…
-
-1
votes1
answer900
viewsAttributeerror: 'list' Object has no attribute '_meta'
I’m trying to edit an object but I’m not being able to instantiate it by the desired id filter to show in my form and edit. Django 2.1.15 Python 3.8.1 my views.py def Alterar_Pessoa(request, id):…
-
-2
votes1
answer28
viewsYou’re not saving the picture on the way
I’m creating a field of ImageField no Jango, but when I put to save, it saves in the bank the name of the image but does not save the path to the image. models: class Cliente(models.Model): photo =…