Skip to content

Instantly share code, notes, and snippets.

View descripc
en la imagen se explica todo
View texto
si cuando estmoas instalando mailbird
no quiere ingresar al correo de la unsa
1- se debe de poner la direccion completa al crear lanueva identidad: gtorres@unsa...
2- al salir error, elegir identificacion x usuario y contraseña
y colocar en servidor: imap.google,com
3- luego colocar auth2.0
4- asegurar que quede como la imagen de aqui:
View texto
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# which means :
# "BASE_DIR is the parent folder of the parent folder of the file this line is in (settings.py).".
# os.path.dirname() gives the parent folder path, and os.path.abspath()
# the absolute path (you need it to give os.path.dirname() enough informations to get the parent dirnames).
#exportar los settings.
View texto
I'm sorry for your inconvenience.
The only way to reset it is to clear registry -
please run regedit and delete following keys -
HKEY_CURRENT_USER\Software\Ordinarysoft\Start Menu X\RunLatest
HKEY_CURRENT_USER\Software\Ordinarysoft\Start Menu X\RunPaths
LUEGO CERRARLO Y VOVLERLO A ABRIR
Also you may switch to Start Menu X style that give you direct access to whole list so you don't need to use recent list.
View txt
## Comparison operations
* {% if %} with {% elif %} {% else %}.-
The {% if %} statement is the primary building block to evaluate conditions. The {% if %} statement is typically used in conjunction with the {% elif %} and {% else %} statements to evaluate more than one condition. An {% if %} statement with an argument variable evaluates to true if a variable exists and is not empty or if the variable holds a True boolean value. Listing 4-14 illustrates a series of {% if %} statement examples.
```
{% if drinks %} {% if drinks %} {% if drinks %}
We have drinks! We have drinks We have drinks
{% endif %} {% else %} {% elif drinks_on_sale %}
No drinks,sorry We have drinks on sale!
View intro
Considere
```
# base.html template
{% macro coffeestore(name, id='', address='', city='San Diego', state='CA', email=None) -%}
<a id="{{id}}"></a>
<h4>{{name}}</h4>
<p>{{address}} {{city}},{{state}}</p>
{% if email %}<p><a href='mailto:{{email}}'>{{email}}</a></p>{% endif %}
{%- endmacro %}
```
View django
# antiguo
from django.conf.urls import url
url(r'^login/$', views.user_login, name='login'),
url(r'^detail/(?P<id>\d+)/(?P<slug>[-\w]+)/$',views.image_detail, name='detail'),
url(r'^users/(?P<username>[-\w]+)/$', views.user_detail, name='user_detail'),
# nuevo
from django.urls import path
path('login/', views.user_login, name='login')
@gmocamilotd
gmocamilotd / mysql
Last active Sep 20, 2019
sistema de victor
View mysql
set @fechainicio = '2019-07-01';
set @fechafin = '2019-08-31';
select zca.grupo, zca.categoria, p.apellidos, p.nombres, d.*
from personal p
inner join (
select
a.IdPersonal,
year(a.fecha) as anyo,
month(a.fecha) as nromes, a.orden,
max( case when DAY(a.fecha) = 1 then a.Hora else '' end ) as d01,
@gmocamilotd
gmocamilotd / pyh
Created Jun 21, 2019
este snippet permite ver cómo en una sola línea de codigo puedo ejecutar más de una orden
View pyh
python -c "import django; print(django.__path__)"
View pyth
class BuscaPaciente(ListView):
model = Paciente, Cita
template_name = 'paciente/paciente_front.html'
def get_queryset(self):
query = self.request.GET.get('busca')
if query is not None:
object_list = Paciente.objects.filter(Q(curp__icontains=query))
# Lo que necesito en esa linea es que apartir del id que me filtre los objetos del segundo modelo que tiene mi relacion foranea por eso utilize 'select_related'
pac = Cita.objects.select_related('paciente').filter(paciente_id=object_list.id).all()