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.conf import settings | |
| from django.db.models import get_models | |
| from django.utils.importlib import import_module | |
| from django.utils.module_loading import module_has_submodule | |
| from django.contrib.admin.sites import AlreadyRegistered | |
| from django.contrib import admin | |
| def autodiscover(): | |
| for app in settings.INSTALLED_APPS: |
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
| #!/usr/bin/env python | |
| #-*- coding: utf-8 -*- | |
| import urllib | |
| try: | |
| import json | |
| except ImportError: | |
| import simplejson as json | |
| def get_trend(keyword, rpp=1): |
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
| #!/usr/bin/env python | |
| #-*- coding: utf-8 -*- | |
| import urllib | |
| try: | |
| import json | |
| except ImportError: | |
| import simplejson as json | |
| WORLDWIDE = 1 | |
| BRAZIL = 23424768 |
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
| syntax on | |
| set title | |
| set ruler | |
| set nu | |
| set mouse=a | |
| set nowrap | |
| set showmatch | |
| set showmode |
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
| function FindProxyForURL(url, host) | |
| { | |
| // domains to use the proxy with | |
| var domains = ['computer.org','acm.org', 'ieee.org', 'elsevier.com', 'sciencedirect.com', 'sistema.uecevest.uece.br']; | |
| // proxy settings | |
| var proxyhost = 'proxy.uece.br'; | |
| var proxyport = '4050'; | |
| host = host.toLowerCase(); |
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 'base.html'%} | |
| {% block content %} | |
| {% if messages %} | |
| <ul class="messages"> | |
| {% for message in messages %} | |
| <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> | |
| {% endfor %} | |
| </ul> | |
| {% endif %} |
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.conf.urls import patterns, include, url | |
| from django.views.decorators.cache import never_cache | |
| from django.contrib import admin | |
| # voce pode por isso em outra arquivo e importar aqui | |
| class CustomAdminSite(admin.AdminSite): | |
| @never_cache | |
| def index(self, request, extra_context=None): | |
| ret = super(CustomAdminSite, self).index(request, extra_context) | |
| # SEU CODIGO AQUI |
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.core.exceptions import ImproperlyConfigured | |
| from django.contrib import messages | |
| class SuccessMessageMixin(object): | |
| success_message = None | |
| def get_success_message(self): | |
| if self.success_message: |
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
| class Field(object): | |
| def __init__(self, default=None): | |
| self.val = default | |
| def __get__(self, obj, objtype): | |
| if obj is None: | |
| return self.__class__ | |
| else: | |
| return self.val |