This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def saludar(): | |
| print("Hola! ¿Como estás?") | |
| #Esta función NO return nada. Como consecuencia cuando se ejecuté con print(Saludar()) la salida será: | |
| #>> Hola! ¿Como estás? | |
| #>> None | |
| def saludar(): | |
| print("Hola! ¿Como estás?") | |
| return 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DistributorDelete(DeleteView): | |
| model= Distributor | |
| success_url = reverse_lazy('index') | |
| def get_queryset(self): | |
| query = Distributor.objects.get(pk=distributorid) | |
| query.delete() | |
| return HttpResponse("Deleted!") and the url is url(r'^(?P<pk>[a-z0-9]+)/delete/$', sales.views.DeleteView.as_view(), name='distributordelete'), but its give me a error | |
| Exception Type: ImproperlyConfigured | |
| Exception Value: | |
| DeleteView is missing a QuerySet. Define DeleteView.model, DeleteView.queryset, or override DeleteView.get_queryset(). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| from datetime import datetime, time | |
| from getpass import getpass | |
| from selenium import webdriver | |
| from selenium.webdriver.common.keys import Keys | |
| from selenium.common.exceptions import NoSuchElementException | |
| def facebook_bot(email, pwd, description, post_url): |