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
# -*- coding: utf-8 -*- | |
# | |
# This code have contributions of Augusto Men (https://github.com/augustomen) | |
# and Nando Florestan (https://github.com/nandoflorestan) | |
# | |
from __future__ import (absolute_import, division, unicode_literals) | |
from datetime import date |
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
.input-recaptcha { | |
width:172px; | |
} |
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 core.validators import format_locality, validate_locality | |
class ClientForm(forms.ModelForm): | |
... | |
... | |
locality = forms.CharField( | |
help_text=u'Local da sede principal do cliente. Ex: São Paulo - SP', | |
validators=[validate_locality], | |
) | |
... |
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
/* >>>>>>>>>>>>>>> models.py <<<<<<<<<<<<< */ | |
from django.db import models | |
class MeuModelo(models.Model): | |
estado = models.ForeignKey('Estado') | |
cidade = models.ForeignKey('Cidade') | |
class Pais(models.Model): |
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.views.generic import ListView | |
from django.views.generic.edit import FormMixin | |
from django.db.models import Q | |
class SearchView(FormMixin, ListView): | |
template_name_suffix = '_search' | |
filter_operator = 'contains' | |
allow_or_operator = False | |
def get_filter_operator(self): |
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
# forms.py | |
class UserProfileForm(forms.ModelForm): | |
class Meta: | |
model = UserProfile | |
exclude = ('user',) | |
class UserForm(UserCreationForm): | |
def __init__(self, *args, **kwargs): | |
super(UserForm, self).__init__(*args, **kwargs) |
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
/* The code below should be included in a separate file using IE conditional comments | |
as it causes errors in IE8(+?) */ | |
/** | |
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>. | |
* Author: Drew Diller | |
* Email: [email protected] | |
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/ | |
* Version: 0.0.8a | |
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license |
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
#-*-coding: utf-8 -*- | |
''' | |
This module represents the FriendsRecommender system for recommending | |
new friends based on friendship similarity and state similarity. | |
''' | |
__author__ = 'Marcel Caraciolo <[email protected]>' |
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
# API JSON | |
from django.http import HttpResponse | |
from django.utils import simplejson | |
from django.views.generic.detail import BaseDetailView | |
from django.views.generic.list import BaseListView | |
from django.db.models.query import QuerySet | |
class JSONResponseMixin(object): | |
def render_to_response(self, context): | |
return self.get_json_response(self.convert_context_to_json(context)) |
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
<?php | |
class JConfig { | |
/* Site Settings */ | |
public $offline = '0'; | |
public $offline_message = 'This site is down for maintenance.<br /> Please check back again soon.'; | |
public $sitename = ''; | |
public $editor = 'tinymce'; | |
public $list_limit = '10'; | |
public $legacy = '0'; | |
/* Debug Settings */ |