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 -*- | |
""" | |
fabfile for Django | |
------------------ | |
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/ | |
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle) | |
several additions, corrections and customizations, too |
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
<snippets license="BSD" filetypes="Python" authors="Kamil Selwa" name="Django1.2 snippets based on Texmate http://svn.textmate.org/trunk/Bundles/Python%20Django.tmbundle/Snippets/"> | |
<item> | |
<displayprefix></displayprefix> | |
<match>m2m</match> | |
<displaypostfix></displaypostfix> | |
<displayarguments>FIELDNAME</displayarguments> | |
<fillin>${1:FIELDNAME} = models.ManyToManyField(${RELATED_MODEL}, related_name=${RELATED_NAME}, ${limit_choices_to={'pub_date__lte': datetime.now}} )</fillin> | |
</item> | |
<item> | |
<displayprefix></displayprefix> |
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 -*- | |
import sys, re, time | |
#based on http://stackoverflow.com/questions/222581/python-script-for-minifying-css | |
#css = open( sys.argv[1] , 'r' ).read() | |
myfile = "style.css" | |
css = open( "style.css" , 'r' ).read() | |
css = re.sub( r'\s+', ' ', css ) | |
print "/* ---------------------------------------------------------------------*/" | |
print "/* -------------- GENERATED FROM %s AT %s ------------*/" % (myfile, time.strftime( "%d %b %Y %H:%M", time.gmtime()) ) |
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
#requirements | |
PIL>=1.1.6 | |
MySQL-python>=1.2.2 | |
python-memcached>=1.44 | |
simplejson>=2.0.9 | |
html5lib>=0.10 | |
#fundamental apps | |
-e svn+http://code.djangoproject.com/svn/django/trunk#egg=Django | |
-e hg+https://sorl-thumbnail.googlecode.com/hg/#egg=sorl |
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
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
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 -*- | |
from django import forms | |
from django.views.generic.edit import FormView | |
from django.utils.translation import ugettext_lazy as _ | |
from django.utils.translation import force_unicode | |
from ajax import JSONResponseMixin, JSONResponsePartialMixin | |
class HoneySpotMixin(object): | |
error_css_class = 'error' | |
required_css_class = 'required' |
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
// JavaScript Document | |
/************************************************* | |
Star Rating System | |
First Version: 23 June 2010 | |
Author: Kamil Selwa | |
Inspriation: http://php.scripts.psu.edu/rja171/widgets/rating.php | |
Usage: $('#rating').rating( {url:'www.url.to.post.com', curvalue:3}); | |
options |
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
/* ------------------------------------------------------ | |
ver: 0.1 | |
Validación de formularios con el soporte para NET | |
---------------------------------------------------------- | |
autor Kamil Selwa 09.03.2010 | |
---------------------------------------------------------- | |
requiere jquery > 1.2.3 http://jquery.com | |
----------------------------------------------------------- | |
soportadas reglas de validación: | |
required |
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
/* ------------------------------------------------------ | |
ver: 0.2 | |
Validación de formularios con el soporte para NET | |
---------------------------------------------------------- | |
autor Kamil Selwa 09.03.2010 | |
---------------------------------------------------------- | |
requiere jquery > 1.2.3 http://jquery.com | |
----------------------------------------------------------- | |
incorporadas reglas de validación: | |
required |
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 -*- | |
# Nicely titled (and translatable) country names. | |
COUNTRIES = ( | |
('AF', u'Afghanistan'), | |
('AX', u'\xc5land Islands'), | |
('AL', u'Albania'), | |
('DZ', u'Algeria'), | |
('AS', u'American Samoa'), | |
('AD', u'Andorra'), | |
('AO', u'Angola'), |
OlderNewer