pip install django-reversion
Add reversion to INSTALLED_APPS
INSTALLED_APPS = [
...
...
...
| import re | |
| texto = 'Supermercado (1,10,5)' | |
| busqueda_coordenada = re.search(r'(.+)(\(.{5,}\))', texto) | |
| print(busqueda_coordenada.groups()) | |
| if busqueda_coordenada: | |
| if len(busqueda_coordenada.groups()) >= 2: | |
| texto = busqueda_coordenada.group(1).strip() | |
| coordenada = re.sub('[()]', '', busqueda_coordenada.group(2)).split(',') |
| import chardet | |
| def determinar_encoding(input_file='despachos.csv'): | |
| file = open(input_file, 'rb').read() | |
| encoding = chardet.detect(file) | |
| if encoding: | |
| return encoding['encoding'] | |
| return None |
pip install django-reversion
Add reversion to INSTALLED_APPS
INSTALLED_APPS = [
...
...
...
| from django.forms import ModelForm | |
| from django.forms.models import inlineformset_factory | |
| from models import Sponsor, Sponsorship | |
| class SponsorForm(ModelForm): | |
| class Meta: | |
| model = Sponsor |
| .table-container th.asc:after { | |
| content: '\0000a0\0025b2'; | |
| } | |
| .table-container th.desc:after { | |
| content: '\0000a0\0025bc'; | |
| } | |
| .pagination { | |
| text-align: center; | |
| } |
| """ | |
| This module provides very simple Django middleware that sleeps on every request. | |
| This is useful when you want to simulate slow response times (as might be | |
| encountered, say, on a cell network). | |
| To use, add this middleware, and add a value for SLEEP_TIME to your settings. | |
| Possible future feature: Look for an X-Django-Sleep header on each request, | |
| to let the client specify per-request sleep time. |
| ## http://pastebin.ubuntu.com/11974308/ | |
| ## problemas con encoding à | |
| import codecs | |
| import csv | |
| def gen(): | |
| f = codecs.open("Ventas.csv", "rb", "utf16") | |
| yield next(f).encode("utf-8") | |
| for i in f: |
| import re | |
| cadena = "open('../Attachment/ViewAttachment.aspx?enc=%2fnzOJlvQE1Q5cGviPAFZ%2fAwP4DzDJBri%2bWK1%2fBimEpHECqkBoS5%2fQKtpmZ8x8fmj8rudm2jNRnGPgHzbTdOH3wtcK8STvRkmfjkfy8XUF6xwUBoBbErAErrL7%2bg3Tt6XjP5AEjY6C3dNZP8NBOhAKlniJExwmfRWBRMuA%2bUju6Isl8ncH617vzflGWloZhbNcolIDIK7lzetNeOBVdzdNVV6Yrz7sbhBYzTkIIjuxmZVoHFTrr7h0sqPmH%2bU5y5iaWXxqB%2f1h7awOfzQPqpOt6sg3ZpXKUvaD6XO8fikAjmcWJ3FqzcS3KRFNfiD4S7V','MercadoPublico', 'width=850, height=700, status=yes, scrollbars=yes, left=0, top=0, resizable=yes');window.event.returnValue=false;" | |
| patron = r".+\?enc=([a-zA-Z0-9%]+)" | |
| patron2 = r".*enc=([^']*).*" | |
| resultado = re.match(patron, cadena) | |
| print(resultado.group(1)) | |
| print('') |
| /*! | |
| * Grunt | |
| * $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev | |
| */ | |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| // Sass |