Posts by leogregianin • 198 points
9 posts
-
0
votes1
answer27
viewsA: How to update "deleting" objects from a nested object?
def update_instance_from_dict(instance, attrs, save=False): for attr, val in attrs.items(): setattr(instance, attr, val) if save: instance.save() return…
-
0
votes1
answer21
viewsA: Django Rest Framework does not filter after resetting queryset
def get_queryset(self): qs = self.queryset search_descr = self.request.query_params.get('search', None) if search_descr=='modal': qs = qs.filter(descr='') return…
-
6
votes3
answers3126
viewsA: Mercosul standard vehicle plate?
Note that your method is validatePlate, therefore should validate the old plates (which will still be in circulation) and also the new plates in the Mercosul model. So your regex should validate…
-
1
votes1
answer61
viewsA: How to make a Sorted by a specific csv column?
I made an example with json but it’s the same idea with csv files. You can do something like this: def ordenarSalario(value): return value['salario'] def os10MaioresSalarios(): result = [] data =…
-
1
votes1
answer172
viewsA: XML tags being generated with prefixes
When you use AddChild() to add a new child tag and not explicitly specify a namespace, the child tag inherits the parent tag namespace. This is a behavior of the own AddChild(), you cannot change…
-
4
votes3
answers583
viewsA: Machine Learning Python
You need to have the data before you separate it into the training and test data. You are passing X1 and Y1 data as function parameter but the data has not been defined yet. See the example below:…
-
0
votes2
answers509
viewsA: See Nfe without digital certificate
Nfe’s webservices require a digital certificate. To consult an Nfe without digital certificate is necessary to read the HTML of the Receita Federal website, this is called webscraping, however the…
-
0
votes1
answer175
viewsA: Problem with HTML code when sending email using Acbrmail
It is necessary to replace the String the way the site returns, try this Stringreplace: HtmlPadrao := StringReplace(HtmlPadrao, '<Número da Compra>', NumeroCompra,…
-
1
votes1
answer574
viewsQ: Insufficient memory with Clientdataset.Savetofile
I need to generate a file XML of a table of 500,000 rows and 200 columns using ADQuery of FireDAC and TClientDataSet recording with ClientDataSet.SaveToFile(Arquivo). I need to record with the…