Posts by Leonardo Furtado • 144 points
22 posts
-
0
votes2
answers107
viewsA: How to filter choices from a field based on choices from another form field in Django?
The best solution I could find so far was to use the library Django-autocomplete-light the section that was that one.…
-
-1
votes2
answers107
viewsQ: How to filter choices from a field based on choices from another form field in Django?
In Django Admin I have a model who has two fields: Unidade and Localizacao. Where Unidade has a ManyToManyField for Localizacao, as follows below class Unidade(models.): nome =…
-
0
votes1
answer34
viewsQ: How to format money fields in Django?
I have a field in my admin Django that receives a real value, but I would like that value to be formatted and not receive more than two decimal places. I tried using a javascript to modify the…
-
0
votes0
answers13
viewsQ: How to show additional options after filling a Selection box in Django Admin
When trying to register in Django Admin I have three fields to fill out being them tipo_remuneracao valor and valor_max, however depending on the type of compensation I may need to show value and…
-
1
votes1
answer30
viewsQ: Django: How to prevent date field conflicts in admin
In a record of a Vaga inside the Django admin I have two fields: data_inicio and data_fim. But I wish it wasn’t possible to put one data_fim less than data_inicio, and I don’t know how it can be…
-
1
votes0
answers16
viewsQ: How to view and define values for a model using the Django template
Django has HTML files that we can override, one of them is called app_list.html, which has the following code: {% if app_list %} {% for app in app_list %} <div class="app-{{ app.app_label }}…
-
1
votes0
answers14
viewsQ: How to change field location in Django?
When we register our models on admin.py from Django they are shown as follows:: @admin.register(Beneficio) class BeneficioAdmin(admin.ModelAdmin): list_display = ('nome', 'situacao') They will be…
-
0
votes0
answers18
viewsQ: How to change inlines according to an option in Django admin
Currently I have the following code: @admin.register(Experiencia) class ExperienciaAdmin(admin.ModelAdmin): list_display = ('tipo', 'data_inicio', 'data_fim') inlines = [AcademicoInline,…
-
-1
votes1
answer144
viewsQ: How to use objects in Django
I have to create models based on the following UML: I actually made the code of Experience that way: class Experiencia(Base): ACADEMICA = 'AC' PROFISSIONAL = 'PR' TIPO_CHOICES = [ (ACADEMICA,…
-
0
votes1
answer35
viewsQ: How to create this type of relationship using Django Models
After seeing a modeling that I should implement in Django, I was a little confused and I will explain what I tried to do and what was sent to me. The following image is the relationship I should…
-
0
votes0
answers18
viewsQ: How to modify State selection using STATE_CHOICES on Django
have a SearchModelForm in my file forms.py in Django with the following code: from localflavor.br.br_states import STATE_CHOICES class SearchModelForm(forms.Form): name =…
-
-1
votes1
answer138
viewsQ: Pandas: Acceptance and rejection percentage
I have a dataset that contains some columns that inform me: user, situacao_requisicao, city. I would like to generate a csv that informs me the amount of requisicoes of each city, how many were…
-
1
votes2
answers1783
viewsA: print matrix in Phyton
This will print formatted: matriz = [[2, 3, 4], [5, 6, 7]] for linha in matriz: for coluna in linha: print(coluna,end=' ') print('\n')
python-3.xanswered Leonardo Furtado 144 -
0
votes4
answers208
viewsA: Identify missing value in numerical sequence
I don’t quite understand the question, but this might help: entrada = [] #lista de valores recuperados N = -(float('inf')) # diz que N é muito pequeno(Eu não sabia o que usar) print('informe a…
-
0
votes1
answer748
viewsA: Convert an entire txt file. Python
Come on arquivo = open('jogos.txt', 'r') #Vou armazenar os dados aqui dados = [] for linha in arquivo: linha = linha.strip('\n') #Isso vai remover o '\n' do fim da linha dados.append(linha.split('…
pythonanswered Leonardo Furtado 144 -
0
votes2
answers5430
viewsQ: How is a multi-valued attribute represented?
I need to perform a modeling of Google Play as work of univerisdade, one of the requirements of the work is to represent a multivariate. how would that be represented? Would it be a type? ex: Nome…
-
0
votes1
answer1322
viewsQ: Vector of objects in Python
I want to create a Node class, and one of its attributes is a Nodes vector (as in a chained list). Since Python does not declare the type of attribute, I have no idea dd how to do.
pythonasked Leonardo Furtado 144 -
0
votes2
answers847
viewsQ: How to go through an iterable?
I have a method keysWithPrefix for the purpose of returning all Keys starting with an input value that is specified as in the implementation below: public Iterable<String>…
javaasked Leonardo Furtado 144 -
2
votes1
answer48
viewsQ: Error in Method Get on a Collection
I need to use XML in a university job and had problems with a method Get that I had to implement in a Collection. After a while I ended up taking a look at some sites to do this and found the…
-
0
votes1
answer96
viewsQ: Memory Allocation - Infinite loop when using the free() function
I’m doing a code in C to test concepts of data structure that are passed through my university. But I came across an error when using the function free, that generates an infinite loop in my code.…
casked Leonardo Furtado 144 -
1
votes1
answer48
viewsQ: Problems with C arrays input
I intend to make a simulator of memory ram in C and need to manipulate strings, at first I would like to use a 4x4 array for input of 4 memory positions with 4 bits: 1010 1000 1011 0000 Something…
-
2
votes2
answers700
viewsQ: How to disable a java button without removing its color
I have a button that when you click it changes color, but if you click it again nothing should happen. However, I still can’t block this action. I tried that code: private void…