Posts by Raphael Melo De Lima • 461 points
30 posts
-
2
votes1
answer39
viewsQ: Filter in the null returning array
I have the following doubt, I am with that const export const STATUS = [{ 0: 'Rascunho', 1: 'Enviado', 2: 'Processando', 9: 'Processado', 3: 'Agendado', 4: 'Protocolizado', 5: 'Suspenso', 6: 'Erro…
-
2
votes1
answer117
viewsA: Remove object from array
I found the answer inside the stackoverflow Remove Duplicates in an Object array Javascript I set little thing for my purpose, follows the line of code that worked for me…
-
1
votes1
answer117
viewsQ: Remove object from array
I have the following array called listDeTipoAtendimento 0: {tipoAtendimento: "ESTUDANTE", tipoServico: "ESTUDANTE", atendente: "José da Silva"} 1: {tipoAtendimento: "Gestante", tipoServico: "teste…
-
0
votes1
answer81
viewsQ: Filter Map and Reduce
I have the following line of code: $scope.listDeColaboradoresObject.forEach(item => { item.listNmAssunto = $scope.relatorioTotalMensagensRespondidasColab .filter(x => x.nmUsuario ==…
-
2
votes2
answers157
viewsQ: Sort an array of strings with dates
I have the following array: let datas = ["nov/2018", "set/2018", "jan/2019", "dez/2018", "out/2018"] when executed datas.sort() it orders by alphabetical order, however, I must order first by year…
-
3
votes1
answer1319
viewsQ: "ORA-01756: quoted string not properly terminated"
Speak guys, good morning, I’m with a legacy code and I’m having the following difficulty: When I try to check any word that has simple quotation mark I get this error ORA-01756 Ex: Raphael me'lo now…
-
0
votes1
answer312
viewsQ: fetch api GET method with Django
Talk guys good day, I’m with a form that the user enters Cpf and ra and receives its id_registration, I’m trying to do this with ajax, but always returns 500 Internal Server Error, follows my line…
-
2
votes0
answers17
viewsQ: Function in JS and querySelector
Good afternoon guys, I was playing with js today, follow my code line: index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport"…
javascriptasked Raphael Melo De Lima 461 -
2
votes1
answer276
viewsQ: dropdown with pure javascript
I need a hand with a dropdown. every donation in the database I have a button that if clicked appears the items that were donated. I have the following line of code: user-donation.js const…
-
0
votes1
answer588
viewsQ: Javascript variable in Django template
Hello guys, good afternoon, I need to use a JS variable, being it the type Boolean in the Django template but I don’t know how to do it. Example of what I want to do: <!DOCTYPE html>…
-
3
votes2
answers260
viewsQ: Search with case insensitive
Good afternoon, I have a search field but I need it to return the values regardless of toLowerCase() and toUpperCase() Ex Bola, I can look up how ball or else BALL I have the following line of code:…
-
0
votes2
answers724
viewsA: Concatenate variables in the Django template
To solve the problem I did it this way: first created a @property: @property def items(self): return self.donationitem_set.all() then in the py views.: def user_donations(request): donations =…
-
3
votes2
answers724
viewsQ: Concatenate variables in the Django template
Talk guys, good morning, I have a problem. I’m walking through a lista but I want to concatenar my list I’m calling on template as {{ list }} and {{ forloop.counter0 }} so that in mine is only…
-
1
votes2
answers1576
viewsA: Use {%for %} and {%if %} in Django template
I managed to solve the problem as follows: Before: video-list: <div class="numbers-video"> <!-- MOSTRA VIDEOS ATIVOS --> {%for video in videos%} {%if video.is_visible%} <a…
-
1
votes2
answers1576
viewsQ: Use {%for %} and {%if %} in Django template
I have 3 videos saved in the Postgres bank where I seventh a star_date and the video only appears on template when the start_date <= date.today() My problem is in template. I have 3 buttons, one…
-
0
votes1
answer42
viewsQ: Show list items filtering by date.Today()
I have a list that I order by position in my models.py, but I have the field start_date I want to use as a validator so that the item is visible or not. But it is not working: py views.: from…
-
1
votes1
answer1396
viewsQ: Sort list with Python + Django
Good afternoon guys, I have a problem, register by the Django admin a video that should be sent to my template, however I need these videos to be ordered by the field position that I have in my…
-
0
votes1
answer668
viewsQ: Integrate Rdstation with Django + Python p/ lead submission
Good morning guys, I have a problem: I have an LP that has to save the lead in the Postgres database and automatically send that lead to the RD platform using their API. using the curl I do it this…
-
0
votes1
answer97
viewsA: Show modal only if there is an active session
Good, seeing that the way I was trying I was not getting success, I solved the problem using same ajax, follows the code. py views.: from django.shortcuts import render, redirect from .models import…
-
0
votes1
answer97
viewsQ: Show modal only if there is an active session
When someone registers their name and email I create a session and I rescan the page with the name of who signed up, but I’m not able to understand how I do so that the time I rescan the page…
-
3
votes2
answers997
viewsQ: Django + Python, show modal using {% if %} in template
I’m making a check if there are active classes, if there is should present a modal and not the registration form, but it is not working: py views.: from django.shortcuts import render, redirect from…
-
0
votes2
answers408
viewsQ: Django + Python update and do not insert
I am using a filter to return some student and update their data, but when I try to save I get the following error: Student with this CPF already exists. and Student with this RA already exists. My…
-
0
votes1
answer406
viewsQ: Django Forms.Checkboxselectmultiple emits: Select a Valid Choice. [''] is not one of the available Choices
I’m trying to use a checkbox to select items in a list, but returns me the following error: Select a valid choice. [''] is not one of the available choices. py.models app: from django.db import…
-
0
votes1
answer70
viewsQ: Django + Postgresql Object has no attribute
I am trying to do a validation before submitting my form, but returns me the following error: 'Studentform' Object has no attribute 'termAccepted' models.py of the app: from django.db import models…
-
0
votes1
answer455
viewsQ: Django Session, emite: Object of type '' is not JSON serializable
I am creating a student but when I try to save it within a session, returns me the following error: Object of type 'Student' is not JSON serializable In Settings.py: INSTALLED_APPS = […
-
3
votes1
answer5459
viewsQ: Django: Reverse for '' not found. '' is not a Valid view Function or Pattern name
I am trying to put a url based on my views.py but it returns me the error: Reverse for 'create_student' not found. 'create_student' is not a Valid view Function or Pattern name. py urls of the…
-
3
votes1
answer856
viewsQ: Django + Python how to update a table item
Hey, guys, I have a registration flow where in a first step save the student and then the data of the responsible, however, after that I need the student to make a description and this description…
-
0
votes1
answer88
viewsQ: Mocha + Chai do not access routes that require authentication
Talk, y'all, good afternoon. So I’m running some tests on my Node.js API using Mocha and chai, but I have a middleware that checks my user’s token so that it can access some HTTP requirements. The…
-
0
votes1
answer40
viewsQ: Redirect user without token
Talk guys, good morning, so I have a problem and I’m not sure how to solve, (maybe it’s in the way I implemented it), well: i am saving a user and his token every time I log in to my platform, in…
-
1
votes0
answers153
viewsQ: Use Promise when uploading files in Angular and Node.js
Good afternoon guys, I am with a registration form in homologation, but when I upload an image and a pdf file in the first moment my request returns that I have not filled all the data, but then…