Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 7d1c4f8a60dfb4e474f4cd8acc5af5d0bb246b92 @flmendes committed Oct 8, 2009
Showing with 321 additions and 0 deletions.
  1. +11 −0 README
  2. +151 −0 django-template.xml
  3. +159 −0 django.xml
11 README
@@ -0,0 +1,11 @@
+Django Snippets for Gedit, converted from TextMate Snippets to Gedit.
+
+INSTALL
+
+* Open gedit
+* Install and activate the snippets plugin [1] (if you didn’t before)
+* Go to Tools -> Manage snippets
+* Click on the import button and select the file django.xml and django-template.xml
+* Now you should see the new Django snippets
+
+[1] http://live.gnome.org/Gedit/Plugins/Snippets
151 django-template.xml
@@ -0,0 +1,151 @@
+<?xml version='1.0' encoding='utf-8'?>
+<snippets language="html">
+ <snippet>
+ <tag></tag>
+ <description>comment</description>
+ <text><![CDATA[{% comment %}
+ $1
+{% endcomment %}]]></text>
+ </snippet>
+ <snippet>
+ <tag></tag>
+ <description>templatetag: openblock</description>
+ <text><![CDATA[{% templatetag openblock %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>load</tag>
+ <description>load</description>
+ <text><![CDATA[{% load $1 %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>now</tag>
+ <description>now</description>
+ <text><![CDATA[{% now "$1" %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>regroup</tag>
+ <description>regroup</description>
+ <text><![CDATA[{% regroup $1 by $2 as $3 %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>for</tag>
+ <description>for</description>
+ <text><![CDATA[{% for $1 in $2 %}
+ $3
+{% endfor %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>cycle</tag>
+ <description>cycle</description>
+ <text><![CDATA[{% cycle $1 as $2 %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>if</tag>
+ <description>if</description>
+ <text><![CDATA[{% if $1 %}
+ $2
+{% endif %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>block</tag>
+ <description>block</description>
+ <text><![CDATA[{% block $1 %}
+ $2
+{% endblock %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>blocktrans</tag>
+ <description>blocktrans</description>
+ <text><![CDATA[{% blocktrans ${1:with ${2:var1} as ${3:var2}} %}
+ $4{{ $3 }}
+{% endblocktrans %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>url</tag>
+ <description>url</description>
+ <text><![CDATA[{% url ${1:package.module.view_fn} ${2:value1,kwarg=value2} %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>firstof</tag>
+ <description>firstof</description>
+ <text><![CDATA[{% firstof $1 %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>ssi</tag>
+ <description>ssi</description>
+ <text><![CDATA[{% ssi $1 ${2:parsed} %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>widthratio</tag>
+ <description>widthratio</description>
+ <text><![CDATA[{% widthratio ${1:this_value} ${2:max_value} ${3:100} %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>autoescape</tag>
+ <description>autoescape</description>
+ <text><![CDATA[{% autoescape ${1:off} %}
+ $2
+{% endautoescape %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>debug</tag>
+ <description>debug</description>
+ <text><![CDATA[{% debug %}]]></text>
+ </snippet>
+ <snippet>
+ <tag></tag>
+ <description>templatetag: closevariable</description>
+ <text><![CDATA[{% templatetag closevariable %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>extends</tag>
+ <description>extends</description>
+ <text><![CDATA[{% extends "$1" %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>ifnotequal</tag>
+ <description>ifnotequal</description>
+ <text><![CDATA[{% ifnotequal $1 $2 %}
+ $3
+{% endifnotequal %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>ifchanged</tag>
+ <description>ifchanged</description>
+ <text><![CDATA[{% ifchanged %}$1{% endifchanged %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>trans</tag>
+ <description>trans</description>
+ <text><![CDATA[{% trans "${1:string to translate}" %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>filter</tag>
+ <description>filter</description>
+ <text><![CDATA[{% filter $1 %}
+ $2
+{% endfilter %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>include</tag>
+ <description>include</description>
+ <text><![CDATA[{% include ${1:"$2"} %}]]></text>
+ </snippet>
+ <snippet>
+ <tag>ifequal</tag>
+ <description>ifequal</description>
+ <text><![CDATA[{% ifequal $1 $2 %}
+ $3
+{% endifequal %}]]></text>
+ </snippet>
+ <snippet>
+ <tag></tag>
+ <description>templatetag: closeblock</description>
+ <text><![CDATA[{% templatetag closeblock %}]]></text>
+ </snippet>
+ <snippet>
+ <tag></tag>
+ <description>templatetag: openvariable</description>
+ <text><![CDATA[{% templatetag openvariable %}]]></text>
+ </snippet>
+</snippets>
159 django.xml
@@ -0,0 +1,159 @@
+<?xml version='1.0' encoding='utf-8'?>
+<snippets language="python">
+ <snippet>
+ <tag>file</tag>
+ <description>FileField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.FileField(upload_to=${1:/path/for/upload})]]></text>
+ </snippet>
+ <snippet>
+ <tag>phonenumber</tag>
+ <description>PhoneNumberField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.PhoneNumberField(${2:blank=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>nullbool</tag>
+ <description>NullBooleanField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.NullBooleanField(${2:default=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>smallint</tag>
+ <description>SmallIntegerField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.SmallIntegerField(${2:blank=True, null=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>decimal</tag>
+ <description>DecimalField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.DecimalField(max_digits=$2, decimal_places=$3)]]></text>
+ </snippet>
+ <snippet>
+ <tag>text</tag>
+ <description>TextField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.TextField(${2:blank=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>sendmail</tag>
+ <description>send_mail</description>
+ <text><![CDATA[mail.send_mail("${1:Subject}", "${2:Message}", "${3:from@example.com}", ${4:["to@example.com"]}${5:, fail_silently=True})
+]]></text>
+ </snippet>
+ <snippet>
+ <tag>integer</tag>
+ <description>IntegerField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.IntegerField(${2:blank=True, null=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>ipaddress</tag>
+ <description>IPAddressField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.IPAddressField(${2:blank=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>possmall</tag>
+ <description>PositiveSmallIntegerField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.PositiveSmallIntegerField(${2:blank=True, null=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>posint</tag>
+ <description>PositiveIntegerField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.PositiveIntegerField(${2:blank=True, null=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>comaseparatedinteger</tag>
+ <description>CommaSeparatedIntegerField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=$2)]]></text>
+ </snippet>
+ <snippet>
+ <tag>char</tag>
+ <description>CharField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.CharField(${2:blank=True}, max_length=${3:100})]]></text>
+ </snippet>
+ <snippet>
+ <tag>xml</tag>
+ <description>XMLField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.XMLField(schema_path=${2:/path/to/RelaxNG}${3:, blank=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>manytomany</tag>
+ <description>ManyToManyField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.ManyToManyField(${2:RELATED_MODEL})]]></text>
+ </snippet>
+ <snippet>
+ <tag>image</tag>
+ <description>ImageField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.ImageField(upload_to="${2:/dir/path}"${3:, height_field=$4}${5:, width_field=$6})]]></text>
+ </snippet>
+ <snippet>
+ <tag>float</tag>
+ <description>FloatField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.FloatField()]]></text>
+ </snippet>
+ <snippet>
+ <tag>datetime</tag>
+ <description>DateTimeField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.DateTimeField(${2:blank=True}${3:, default=datetime.datetime.now})]]></text>
+ </snippet>
+ <snippet>
+ <tag>slug</tag>
+ <description>SlugField</description>
+ <text><![CDATA[${1:slug} = models.SlugField(${2:prepopulate_from=("$3",$4)})]]></text>
+ </snippet>
+ <snippet>
+ <tag>url</tag>
+ <description>URLField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.URLField(${2:blank=True}, verify_exists=${3:True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>email</tag>
+ <description>EmailField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.EmailField()]]></text>
+ </snippet>
+ <snippet>
+ <tag>boolean</tag>
+ <description>BooleanField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.BooleanField(${2:default=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>fk</tag>
+ <description>ForeignKey</description>
+ <text><![CDATA[${1:FIELDNAME} = models.ForeignKey(${2:RELATED_MODEL})]]></text>
+ </snippet>
+ <snippet>
+ <tag>time</tag>
+ <description>TimeField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.TimeField(${2:blank=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>model</tag>
+ <description>Model Skeleton</description>
+ <text><![CDATA[class ${1:Modelname}(models.Model):
+ """${2:($1 description)}"""
+ $0
+
+ class Admin:
+ list_display = ('',)
+ search_fields = ('',)
+
+ def __unicode__(self):
+ return u"$1"
+]]></text>
+ </snippet>
+ <snippet>
+ <tag>filepath</tag>
+ <description>FilePathField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.FilePathField(path="${1:/location/of/choices}"${2:, match="${3:regex}"}${4:, recursive=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>usstate</tag>
+ <description>USStateField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.USStateField(${2:blank=True})]]></text>
+ </snippet>
+ <snippet>
+ <tag>auto</tag>
+ <description>AutoField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.AutoField()]]></text>
+ </snippet>
+ <snippet>
+ <tag>date</tag>
+ <description>DateField</description>
+ <text><![CDATA[${1:FIELDNAME} = models.DateField(${2:default=datetime.datetime.today})]]></text>
+ </snippet>
+</snippets>

0 comments on commit 7d1c4f8

Please sign in to comment.