Posts by Dcrispim • 52 points
9 posts
-
0
votes1
answer509
viewsQ: How 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 =…
-
1
votes1
answer69
viewsA: Python Type Error a float is required
On line 16 there is no parenthesis in the method #Incorreto: self.__totalDescontos = self.__calcularTotalDescontos #correto self.__totalImpostos = self.__sindicato + self.__fgts + self.__ir #Só…
-
0
votes2
answers479
viewsA: How to filter items in the Foreign key field of the Django form?
Vc can call the filter in Modelo_plates to get the list of active cards and then a for to fetch the respective entries from .models import Modelo_placas, Cadastro_placas def list_placas():…
-
0
votes1
answer566
viewsA: How to save elements in localStorage and send to another page?
If it is on the same domain you can access on any page. EX: url: www.meusite.com.br/buy/ localStorage.setItem("cart","Blabla") url: www.meusite.com.br/cart/ localStorage.getItem("cart") "Blablah"…
localstorageanswered Dcrispim 52 -
0
votes2
answers2327
viewsA: Python code error - Syntaxerror: can’t assign to Function call
Vc can declare the input and after entering the result in the list. lista_team = [] name_team = input('digite o nome do time') lista_team.append(name_team) I prefer this way because you can add a…
-
0
votes1
answer404
viewsQ: Foreignkey of two tables in Django
Fala, Povo! I have the following problem: I am developing a site for a store that also performs services. Then I have the Shopping and Sales Table (Saleorbuy) and the Services Table (Service) For…
-
1
votes2
answers237
viewsQ: How to get the name of the python function parent
Fala, Povo! I have a log - add_log() - add function that takes a title, status and Obs to register in a txt file along with the time. I wonder if there is any way to get the name of the parent…
-
0
votes3
answers1465
viewsA: Itemgetter - Sort list of dictionaries - Python
It got a little bigger than I imagined, but I think that way you gain more autonomy to sort and get various results. lista = [ {"nome": "Maria", "idade": 15}, {"nome": "João", "idade": 26}] def…
-
0
votes1
answer2019
viewsQ: How to get the current file name in python
Speak people, speak people, I am making a code creator for sqlite in python. I was wondering if there is any way to get the name of the current file to pass directly on the function. currently pass…