Posts by Rodrigo • 105 points
7 posts
-
0
votes3
answers53
viewsA: Code Duplication in Laravel ORM
At the time of refactoring the code and applying one of the two responses of the post I realized that I could do something a little different, using what I learned from the answers of Wictor and…
-
1
votes3
answers53
viewsQ: Code Duplication in Laravel ORM
I was working and came across the following situation: if (($entrada == null) and ($parcela == null)) { $cotas = Produto::orderBy('credito', 'DESC') ->where('id_subcategoria', $subcategoria)…
-
3
votes1
answer68
viewsQ: Adding data from the same column
Is there any way to make a calculation(sum) using values from the same column? For example: the customer wants to buy a quota in the value of 2000, in the bank I have several registered quotas,…
-
1
votes1
answer213
viewsQ: Good practice of python tests
I am a week studying tests in python, I started with unittest and some doubts arose... I must use a test class for each method of a class, or use a test class for each class...and yet, how to…
-
0
votes2
answers625
viewsA: Search in 2 fields at the same time
From what I understand you want to do a query that looks in two fields at once if something is in one field or the other...if that’s it and only use OR. If you want to search for two words typed in…
-
1
votes6
answers7088
viewsA: Intersection between two sets (element that is in set A and B at the same time)
if you need operations between sets, and only use set: a = {1, 2, 3, 4, 5} b = {0, 3, 4, 6, 7, 10} intersecao = (a & b) https://docs.python.org/3/tutorial/datastructures.html…
-
2
votes3
answers4694
viewsQ: How is the structure of projects in python?
I would like to know if there is a pattern or good practices as to how to structure a Python project. For example, I will make a CRUD using MVC. Something very simple. In JAVA I would create a…