This file contains 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 re | |
from django.core.management.base import BaseCommand | |
from django.template import base, defaulttags | |
from django.template.loader import get_template | |
from django.template.base import TextNode | |
# Monkey patching | |
render_tags = ('block ', 'endblock ', 'extends ', 'include ') | |
BLOCK_TAG_START = [] |
This file contains 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 urlparse | |
import re | |
from django import forms | |
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
def validate_youtube_url(value): | |
'''El patron lo saque de http://stackoverflow.com/questions/2964678/jquery-youtube-url-validation-with-regex''' |
This file contains 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 content_add(request, template_name='content/content_add.html', extra_context=None): | |
extra_context = extra_context or {} | |
extra_context['submit'] = 'Add' | |
return content_edit(request, template_name=template_name, extra_context=extra_context) | |
def content_edit(request, content_id=None, template_name='content/content_edit.html', extra_context=None): | |
data = instance = None | |
extra_context = extra_context or {} | |
if request.method == 'POST': |