Posts by Regis Santos • 1,574 points
70 posts
-
0
votes1
answer168
viewsQ: Returning get_FIELD_display from a dictionary-transformed list (Django)
I wanted to turn the following list into a dictionary: lists py. status_list = ( ('c', 'cancelado'), ('elab', 'em elaboração'), ('p', 'pendente'), ('co', 'concluido'), ('a', 'aprovado') ) So I did…
-
2
votes1
answer525
viewsQ: Filter with Choicefield (Django)
Consider my form: Forms.py status_list = ( ('', ''), ('c', 'cancelado'), ('elab', 'em elaboração'), ('p', 'pendente'), ('co', 'concluido'), ('a', 'aprovado') ) class StatusSearchForm(forms.Form):…
-
1
votes1
answer284
viewsQ: How to copy record with Detailview and picking up on pk (Django)
Consider my template: entry_detail.html <form class="navbar-form navbar-right" action="." method="get"> <!-- add --> <!-- <p name="filter_link" class="pull-right"><a…
-
1
votes1
answer312
viewsQ: Typeerror with calculated field (Django)
Typeerror with calculated field unsupported operand type(s) for *: 'int' and 'NoneType' error in Return line below py.models def get_subtotal(self): return self.price_sale * self.quantity subtotal =…
djangoasked Regis Santos 1,574 -
4
votes2
answers1225
viewsQ: How to read and render a.txt file in the Django template?
How do I render the data of a arquivo.txt in a Django template? contents of the archive: 1;'one';'foo' 2;'two';'bar' I return in the template 1 - one - foo 2 - two - bar Any hint where I start?…
-
1
votes1
answer1346
viewsQ: Difference between get_context_data and get_queryset and code improvement (Django)
i wanted to know the difference between get_context_data and get_queryset. And I would like to know your opinion about my codes. What’s right and what’s wrong in them?…
-
2
votes1
answer848
viewsQ: How to return Objects in a Many to Many Django
Consider the model class Dealership(models.Model): dealership = models.CharField(max_length=50) class Ordered(models.Model): customer = models.ForeignKey("Customer") dealership =…
-
3
votes1
answer353
viewsQ: How to count people by age
I have class Person(TimeStampedModel, Address): name = models.CharField(_('nome'), max_length=100) birthday = models.DateField(_('data de nascimento')) and the function import datetime from datetime…
-
2
votes1
answer225
viewsQ: Queryset: Getting the description of the accessories on request (Django)
Consider the example below: class Vehicle(models.Model): vehicle = models.CharField(_('veículo'), max_length=50, unique=True) price = models.DecimalField(_(u'preço'), max_digits=8, decimal_places=2)…
-
2
votes1
answer64
viewsQ: Improving the return of a specific result
I think I’m letting go of the basics! I have a result that returns me only one element in the dictionary: [{'quant': 236, 'district': 'Centro'}] My context is: context['Districts'] = d How do I make…
-
5
votes2
answers804
viewsQ: How do you calculate (easily) total and subtotal in Django?
I’m wearing Django 1.7.8 I have the models.py class SaleDetail(models.Model): quantity = models.PositiveSmallIntegerField(_('quantidade')) price_sale = models.DecimalField( def get_subtotal(self):…
djangoasked Regis Santos 1,574 -
3
votes2
answers2033
viewsQ: Returning ZIP Code data in form
I have the following problem: I am trying to fill in the fields street, city and state with the post informed. They’re all input. I’m using https://github.com/jbochi/cep My project is in Django, but…
-
4
votes1
answer270
viewsA: Printing with path name saved in a table
'Imprimir todos os relatórios Dim FileNamePDF As String Dim SetDirectoryPDF As String Dim strRelatorio As String 'Tabela Funcionarios contem pelo menos os campos: ID, Nome, caminho_impressao…
-
1
votes2
answers694
viewsA: Return the total value of items calculated in a list
I made an SQL query: SELECT detVendas.id, Sum([Quant]*[Preco]) AS Total FROM detVendas GROUP BY detVendas.id;
ms-accessanswered Regis Santos 1,574 -
5
votes3
answers3831
viewsQ: Check if number is integer in Access
How to check if a number is integer in Access VBA? I tried to If Int(Me.Numero) Then Msgbox "É inteiro" End If But it didn’t work. I wanted if I typed 8.5 it returned "It’s not whole". The field is…
-
-1
votes1
answer1241
viewsQ: Copying record of table in itself via vba
Can you copy a record from a table and insert it in itself? I wanted to copy a record into a new one on the same table. INSERT INTO Produtos ( Produto, Preco ) SELECT Produtos.Produto,…
-
6
votes2
answers606
viewsQ: Competitive when using time table
I am using a vba code that transfers some data to an auxiliary table, handles and back to the original table. How do I solve the competition problem? That is, I didn’t want two users to use at the…
-
9
votes1
answer378
viewsQ: Front End Access on the server
Usually we put the Back End on the server and the Front End on the local machine. Is there any problem (maybe of performance) in leaving a copy of the FE on the server for each user and putting only…
ms-accessasked Regis Santos 1,574 -
8
votes1
answer270
viewsQ: Printing with path name saved in a table
I created a table called Funcionarios where I have at least 2 fields: ID and caminho_impressao. Where I put it for example: C: User Users1 Documents\ C: User Users2 Documents\ Then I tried to print…
-
8
votes2
answers694
viewsQ: Return the total value of items calculated in a list
I have a table with Quant and Preço. On the form, beyond these fields, I have the field Total = [Quant]*[Preço] Also, in the main form I have the field SomaTotal = Soma([Total]) That is, the classic…
ms-accessasked Regis Santos 1,574