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/python | |
# This work is licensed under the Creative Commons Attribution 3.0 United | |
# States License. To view a copy of this license, visit | |
# http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative | |
# Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. | |
# from http://oranlooney.com/make-css-sprites-python-image-library/ | |
# Orignial Author Oran Looney <[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
VERSION = (1, 0, 0, 'alpha', 0) | |
def get_version(version=None): | |
"Returns a PEP 386-compliant version number from VERSION." | |
if version is None: | |
from address import VERSION as version | |
else: | |
assert len(version) == 5 | |
assert version[3] in ('alpha', 'beta', 'rc', 'final') |
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: utf8 -*- | |
from django.views.generic.edit import FormView | |
from django.core.urlresolvers import reverse | |
class FooFormView(FormView): | |
template_name = 'foo/foo_form.html' | |
form_class = FooForm |
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
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the branch/status of the current mercurial repository | |
# * the return value of the previous command | |
# |
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: utf8 -*- | |
from django.test import TestCase | |
from django.core.urlresolvers import reverse | |
class ProfileViewTest(TestCase): | |
"""Unit test for verify profile views""" | |
fixtures = ['users.json'] |
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
# | |
# Cookbook Name:: django | |
# Recipe:: default | |
# | |
# Copyright 2009, Opscode, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
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
{% if is_paginated %} | |
{% load i18n %} | |
<div class="pagination"> | |
<ul> | |
{% if page_obj.has_previous %} | |
<li class="prev"><a href="?page={{ page_obj.previous_page_number }}{{ getvars }}">‹‹ {% trans "previous" %}</a></li> | |
{% else %} | |
<li class="prev disabled"><a href="#">‹‹ {% trans "previous" %}</a></li> | |
{% endif %} | |
{% for page in pages %} |
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 cabecalho %} | |
<h2>Novo Produto</h2> | |
{% endblock %} | |
{% block corpo %} | |
<form action="{% url produtos:novo %}" method="post" class="form-stacked" enctype="multipart/form-data"> | |
{% csrf_token %} | |
<fieldset> |
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: utf8 -*- | |
from django.shortcuts import render_to_response | |
from django.template import RequestContext | |
from sigi.apps.diagnosticos.models import Diagnostico | |
def lista(request): | |
"""Consulta os diagnosticos do servidor logado, |
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: utf8 -*- | |
from django.test import TestCase | |
class DiagnosticosViewsTest(TestCase): | |
"""Testes feitos para verificar o funcionamento | |
do view de diagnósticos. | |
""" |