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
INSERT INTO producto (nombre, atributos) VALUES ( | |
'Bicicleta', | |
'color => "verde", | |
ruedas => 2, | |
tipo => "monareta"' | |
); |
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
-- Obtener las llaves como arreglo | |
SELECT nombre, akeys(atributos) FROM producto; | |
-- Saber si un producto tiene cierta característica | |
SELECT nombre, atributos -> talla FROM producto WHERE atributos ? 'talla'; | |
-- Obtener el conjunto de características y sus valores para un producto | |
SELECT each(atributos) FROM producto WHERE name='pizza'; |
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
img { | |
-webkit-transition: -webkit-filter 1s; | |
-webkit-filter: grayscale(1); /* Chrome */ | |
filter: url(filters.svg#grayscale); /* Firefox 3.5+ */ | |
filter: gray; /* IE6-9 */ | |
} | |
img:hover { | |
-webkit-filter: grayscale(0); /* Chrome */ | |
filter: none; /* Applies to FF + IE */ | |
} |
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
pip install django-autocomplete-light |
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
url(r'autocomplete/', include('autocomplete_light.urls')), |
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 autocomplete_light | |
autocomplete_light.autodiscover() |
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
{% extends "admin/base.html" %} | |
{% block extrahead %} | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
{% include 'autocomplete_light/static.html' %} | |
{% endblock %} |
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 autocomplete_light | |
from cities_light.models import City | |
autocomplete_light.register(City, search_fields=('search_names',), | |
autocomplete_js_attributes={'placeholder': 'city name ..'}) |
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
from django.contrib import admin | |
import autocomplete_light | |
from models import Address | |
class AddressAdmin(admin.ModelAdmin): | |
form = autocomplete_light.modelform_factory(Address) | |
admin.site.register(Address, AddressAdmin) |
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 CartSale(models.Model): | |
first_name = models.CharField( | |
max_length=100, | |
) | |
last_name = models.CharField( | |
max_length=100, | |
) | |
date_sale = models.DateTimeField( | |
auto_now_add=True, | |
) |