Posts by Rodolfo Sousa • 63 points
20 posts
-
0
votes1
answer662
viewsQ: 'Nonetype' Object has no attribute 'groups'
I’m using a function in mine Templatetagsdjango that basically checks if the user is in the group that has the permission for the given button. The return 'True or False' works well, IE, it shows…
-
-1
votes2
answers47
viewsQ: how to save user’s choice in a Nav-tab modal
I have a modal with some tabs referring to account closure, I need to save the user’s choices, I load types of payments, type of flags etc, each button can have an id, that id I want to save, I just…
-
0
votes2
answers53
viewsA: saving Dict list on file
I managed to solve my problem as follows: Save the first item as a Dict list: if not os.path.exists('data/today/CHECK/' + conta.num_conta): print('Arquivo Json não existe') lista_instancia =…
-
1
votes2
answers53
viewsQ: saving Dict list on file
I have a function that saves a Dict in a file, but this is simultaneous, I mean, every time I have a new Dict. I couldn’t apply the concept of append to this problem. The Archive is being saved this…
-
0
votes1
answer49
viewsQ: set cursor position
it is possible to define where the cursor will look as soon as the user enters a screen ? For example, I have this input, as I define that whenever the screen is logged in or loaded, the cursor is…
-
0
votes2
answers483
viewsA: access field value within Django template
I was able to solve creating a function in the model that returns the data in Json format, so I can call the function o in the template and navigate from Dict. MODEL class Avaliacao(models.Model):…
-
0
votes2
answers483
viewsQ: access field value within Django template
You can access the values within a variable in Django templates? For example, I have this model: class Avaliacao(models.Model): post = models.TextField() data_inclusao = models.DataField() in the…
-
0
votes1
answer28
viewsA: Generic relationship between model Logentry
I managed to solve by doing the following: from auditlog.models import LogEntry from auditlog.registry import auditlog from django.contrib.contenttypes.fields import GenericRelation class…
-
0
votes1
answer28
viewsQ: Generic relationship between model Logentry
Someone has worked with Auditlog on Django ? Documentation of Django Auditlog Let’s say I have this model: class Cadastro(models.Model): nome = models..TextField() auditlog.register(Cadastro) I…
-
0
votes1
answer39
viewsA: Save Timefield as blank
After studying a little I managed to solve this problem using the Try argument. I try to assign the value, if it fails, it saves the others without problems. invf = Inventario(loja=lj,…
-
0
votes1
answer39
viewsQ: Save Timefield as blank
I have a function to save the data imported from excel, the problem is that I have a Timefield that can come blank, and with that I have the following message: Error saving object to database:…
-
0
votes1
answer108
viewsA: Send input to save to JSON file
I was able to capture the user’s choices by calling the new 'Saveinvoice' function as soon as a new item is selected. Whenever an item is selected, it is saved in the selectedObj variable.…
-
0
votes1
answer108
viewsQ: Send input to save to JSON file
I have a screen where there is an auto-complete for sale items, the user searches the item by name or code, so far everything works. I need to capture the chosen item and send it to backend (Django)…
-
1
votes1
answer503
viewsQ: create dictionary based on two lists
I have a list of items and a list of submenus (imagine a menu), because then, I would like to create a dictionary separating the items by the key of your menu. I couldn’t develop a logic that worked…
python-3.xasked Rodolfo Sousa 63 -
0
votes1
answer84
viewsQ: Set attribute of another Python class
I am studying python and would like to understand how I can define an attribute of a class based on attributes of another class. I’ll go to the example to be clearer, it’s just an example of what I…
-
1
votes1
answer83
viewsA: Automate get from a list of tuples to JSON variables
I practically solved my problem with a bow tie. I always pick the position 0 from my list but at the end of the script I delete the index 0, IE, my code picks the new index 0 that before was 1 until…
-
0
votes1
answer83
viewsQ: Automate get from a list of tuples to JSON variables
I have a code that searches for information in a list of tuple, the code is very simple, it is searching the info in Index [0] and putting in my variables for the POST. I’d need to automate it so he…
-
0
votes2
answers360
viewsQ: Extract information from a tuple and place in different variables
I’m beginner and I’m caught in a problem I don’t even know how to research right. This is what happens: My code needs to select data from a database table (so far so good), and then need to separate…
-
0
votes1
answer121
viewsA: How to resolve "An Attributevalue may not contain an Empty string"?
For those who stop at this difficulty, I was able to make my code work by removing the brackets and keeping only the keys, at the time I am preparing the json file: got: payload = { "id": 10,…
-
1
votes1
answer121
viewsQ: How to resolve "An Attributevalue may not contain an Empty string"?
Hello, I am doing some simple tests for integration of the API Gateway with Dynamodb, at this moment I can do a GET and POST using POSTMAN and GET in python, but I cannot do the POST in Python, I…