Posts by Flávio Filipe • 141 points
15 posts
-
0
votes2
answers409
viewsQ: Send JSON with python to API
I’m putting together a list of objects to post to an API in made in Arabic, but I can’t convert the data to work on the API. In python the list of objects is something like: payload = […
-
4
votes1
answer888
viewsQ: Register different types of users in Django admin
I have three types of users: Manager, Teacher and Student. All of them need to log into the system, but the teacher and student have some more information. The manager who creates access for the…
-
0
votes1
answer899
viewsA: LARAVEL - Error when connecting MYSQL with LARADOCK in Workspace
Problem solved When using on .env laradock MYSQL_VERSION=lasted he used mysql 8.0 and there was a problem. So I switched to 5.7 as follows: docker-compose down Change the .env laradock ...…
-
-1
votes1
answer899
viewsQ: LARAVEL - Error when connecting MYSQL with LARADOCK in Workspace
When I try to run the command on the laradock’s Workspace php artisan migrate the following error occurs: Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested…
-
1
votes1
answer3335
viewsQ: Read multiple sets xlsx file with PHP - Phpspreadsheet
I have a file in xlsx format with two spreadsheets and I need to read the data in PHP to create an import script in the database. I’m using the Phpspreadsheet library to read the files. I can do…
-
0
votes2
answers2017
viewsA: Text View Null: void android.widget.Textview.setText(java.lang.Charsequence)' on a null Object Reference
Resolution: Leitorfragment.java @Override public void onResume() { super.onResume(); mScannerView.setResultHandler(this); mScannerView.startCamera(); txtResult =…
-
1
votes2
answers2017
viewsQ: Text View Null: void android.widget.Textview.setText(java.lang.Charsequence)' on a null Object Reference
I’m taking a data from an API on a fragment to change the txt of Activity. But when I call the function that makes this change the setText gives NullPointerException. If I call the same function on…
-
0
votes1
answer143
viewsQ: Add footer with xhtml2pdf on specific pages with Django
I have a standard footer that is displayed on some pages when generating the PDF with the xhtml2pdf using Django which should be positioned at the bottom of the page. But in some I don’t want to…
-
2
votes1
answer937
viewsA: Catch element using python json
In this case you have a dictionary. You can use a for to go through the array and read each item by the key. Save this list in a variable, var and prints: for v in var: print(v['definition'])…
-
0
votes2
answers51
viewsA: Android storage
A good option is to use some web service to log in and store your data and use sqlLite as if it were a "super cache". Take a look at firebase, it has great ways to authenticate: by email or social…
-
1
votes1
answer957
viewsA: Take input from view
You can capture the field of email and break the string: getEmail = request.POST['email'] #Pega o email email = getEmail.split('@') #Quebra a string antes dps do @ nomes = email[0].split('.')…
-
2
votes2
answers225
viewsA: Make a Relationship Many for Many
From a survey on the select_related https://docs.djangoproject.com/en/2.0/ref/models/querysets/ With it you can browse your tables in more optimized ways like: user =…
-
2
votes2
answers1736
viewsA: How to call a view method in html?
It would be better to create the link in the url file: url(r'^accounts/home', views.home, name='home'), In the home view you render the template. And call the link in html: <li><a href="{%…
-
0
votes0
answers436
viewsQ: Convert HTML to PDF and insert Image with Django
The image does not appear in PDF, I use xhtml2pdf. reports/sol_access.html <img src="{% static 'img/small_logo.png' %}" alt="Blue Tech" style="max-width:200px; margin-top:10px"> view py. ` def…
-
0
votes2
answers589
viewsA: Legacy of templates with Django
Try using the full path ne extends. Ex: {% extends 'core/site/base.html' %} The hierarchy should be template/core/site/base.html