Posts by Victor Alessander • 387 points
17 posts
-
1
votes1
answer87
viewsA: How to update to a column of another table automatically when doing an update using Trigger?
You cannot update a foreign key like this, it would cause integrity problems, because if you update the RG of the Tb_employee table, the reference in the Tb_dependent table would no longer exist.…
-
0
votes2
answers326
viewsA: How to use the Django User part in a model?
There is another possibility, I just don’t know if it meets what you needed. author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
-
1
votes2
answers175
viewsA: Doubt Gem Devise
How about using it this way? Whereas you want to allow access without authentication only to the application’s main page: application_controller.Rb class ApplicationController <…
-
0
votes1
answer50
viewsA: link_to_remote on Rails 5
In Rails 5, to perform an AJAX request, you must use the remote: true The result according to your code looks something like this: <%= link_to "Cadastro", action: "register", remote: true %>…
-
0
votes1
answer42
viewsA: Special character function: '=' in method name
The method containing the special character "=" indicates that that method is a Setter. In Java, we define a Setter this way: public class Welcome{ private int number; public void setNumber(int…
-
1
votes1
answer43
viewsA: Rspec test failing because of Databasecleaner
Probably the test database is not being cleaned up, causing this problem which basically says that the record is not unique. In an application I was developing, this configuration solved this…
-
2
votes1
answer88
viewsA: Login Help [Ruby On Rails - Gem Devise]
To generate the controller and change as needed, you need to run this command: Create your custom controllers using the Generator which requires a Scope: $ Rails generate Devise:controllers [Scope]…
-
3
votes1
answer1920
viewsA: Redirect to another page in the Django view
The idea is that the code at least validates the information entered in the form, so it looks like this: def register(request): if request.method == 'POST': form = RegisterForm(request.POST) # Se as…
-
1
votes2
answers236
viewsA: Relationship with Admin Django
If I understand your question correctly, to make a particular model available on the admin page, just go to your admin.py and subscribe your model there: from django.contrib import admin from…
-
1
votes1
answer411
viewsA: Crawler to scan websites
You can use the following resources: 1- Python language for Crawler using one of these libraries (Scrapy or Beautifulsoup); 2- A database of your choice (Mysql, Postgresql, ...), if you are aware of…
-
3
votes4
answers7713
viewsA: How to detect if a variable is null?
To check whether the variable is null, in addition to the information that was passed above, you can do so too: if name: [...]
-
0
votes1
answer104
viewsA: Mechanize with Nokogiri: trying to get information on Ivs
If you are using Nokogiri to extract information from HTML tags, I see no reason to use regular expression. Follow an example using Httparty (just adapt to your situation): require 'httparty'…
-
0
votes1
answer559
viewsA: Error installing Python applications on Ubuntu 17.04
As far as I know to install Django is via Pip and not apt-get. Another thing, to install Django it is recommended to use a virtualenv to avoid conflicts between projects if you are developing them…
-
2
votes2
answers6375
viewsA: python Manage.py syncdb does not work!
Actually, the correct command is: ./manage.py migrate --run-syncdb or python manage.py migrate --run-syncdb…
-
1
votes1
answer4680
viewsQ: How to create a form and authenticate Django user
Good night to you all. I am developing a Django project for educational purposes only and I could not find a solution to my problem. I could not generate a form for the user to log in and much less…
-
0
votes2
answers338
viewsA: How to get all ips associated with a Python domain?
If you prefer an option that does not use Python, you can use Tracert on Windows, or Traceroute on Linux. Code output in Tracert So you could use Python only to run the external command with the…
-
0
votes5
answers98198
viewsA: How to display the result of a query on an PHP html page?
$connection = new mysqli("localhost", "user", "pass", "database"); $sql = $connection->query("Select * From tb_trabalhador and tb_detalhe_trabalhador"); if($sql){ // If $sql is True while($exibe…