Posts by Neto Miranda • 65 points
8 posts
-
1
votes2
answers791
viewsA: Django Models - Foreignkey how to call method within the class by Admin
To get what I needed, I don’t know if it was the best solution, but I managed to achieve it in the following way. def calcula_valor(sender, **kwargs): if kwargs['created']: atividade =…
-
0
votes2
answers791
viewsQ: Django Models - Foreignkey how to call method within the class by Admin
Good afternoon Galera, My situation is as follows. I have a nested class structure for a solution and I’m stuck in the following situation: I have these class structure: class…
-
0
votes2
answers115
viewsA: How to return attribute value X - in a Manytomanyfield
Hello, my solution was instead of using M2m was to use 1to1 in the activity class: class Atividade_estruturas_complementares(models.Model): atividades_complementares =…
-
0
votes2
answers115
viewsQ: How to return attribute value X - in a Manytomanyfield
I have some classes that relate to each other. Ex: I have an Activity class that has a M2m relationship with an Activity class. And I have another structure class that has a 1to1 with…
-
0
votes1
answer80
viewsA: Chained Many To Many Field does not return values
The problem was with the version used for Django-smart-selects. I was using version 0.24.0 which was updated for some reason that I don’t remember. But the previous version was 0.23.0 and when…
-
1
votes1
answer80
viewsQ: Chained Many To Many Field does not return values
Below is a screenshot of the registration screen where options for choices should appear The low image containing the options that should appear in the image above follows the model.py code from…
-
2
votes2
answers3313
viewsQ: I need to list the amount of an 'X' product that each customer bought
Below follows the structure and relationships of my database. I tried to use the code : `SELECT `cliente`.`Nome`, `produto`.`Descricao`, `contem`.`QuantItem` FROM `cliente`, `produto`, `contem`…
-
2
votes3
answers1589
viewsQ: How to redirect user after login according to user type?
in the system there are 2 types of users 1 = admin and 2 = teacher, and after logging in need redirect each to a different page. This is my php and html code. require "lib/authenticate.php"; $error…