From 915c2b8069d505373cde148a1a182323fb7f76e0 Mon Sep 17 00:00:00 2001 From: Dan Loewenherz Date: Fri, 3 Feb 2012 19:58:42 -0800 Subject: [PATCH 1/2] Add missing arguments for auto, float, int, ip, nullbool, posint, posssmallint, and smallint --- snippets/django.snippets | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/snippets/django.snippets b/snippets/django.snippets index b89cb5b..e5aac77 100644 --- a/snippets/django.snippets +++ b/snippets/django.snippets @@ -9,7 +9,7 @@ # can either not specify them, or override them, e.g. auto_now_add=False. snippet auto - ${1:FIELDNAME} = models.AutoField() + ${1:FIELDNAME} = models.AutoField(${2}) snippet bool ${1:FIELDNAME} = models.BooleanField(${2:default=True}) snippet char @@ -29,23 +29,23 @@ snippet file snippet filepath ${1:FIELDNAME} = models.FilePathField(path=${2:"/abs/path/to/dir"}${3:, max_length=100}${4:, match="*.ext"}${5:, recursive=True}${6:, blank=True, }) snippet float - ${1:FIELDNAME} = models.FloatField() + ${1:FIELDNAME} = models.FloatField({2}) snippet image ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100}) snippet int - ${1:FIELDNAME} = models.IntegerField() + ${1:FIELDNAME} = models.IntegerField(${2}) snippet ip - ${1:FIELDNAME} = models.IPAddressField() + ${1:FIELDNAME} = models.IPAddressField(${2}) snippet nullbool - ${1:FIELDNAME} = models.NullBooleanField() + ${1:FIELDNAME} = models.NullBooleanField(${2}) snippet posint - ${1:FIELDNAME} = models.PositiveIntegerField() + ${1:FIELDNAME} = models.PositiveIntegerField({$2}) snippet possmallint - ${1:FIELDNAME} = models.PositiveSmallIntegerField() + ${1:FIELDNAME} = models.PositiveSmallIntegerField({$2}) snippet slug ${1:FIELDNAME} = models.SlugField(max_length=${2:50}${3:, blank=True}) snippet smallint - ${1:FIELDNAME} = models.SmallIntegerField() + ${1:FIELDNAME} = models.SmallIntegerField({$2}) snippet text ${1:FIELDNAME} = models.TextField(${2:blank=True}) snippet time From 789bb2510b11175ef14b71ab138e1fe26dc19586 Mon Sep 17 00:00:00 2001 From: Dan Loewenherz Date: Fri, 3 Feb 2012 20:00:36 -0800 Subject: [PATCH 2/2] Fix syntax errors --- snippets/django.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/django.snippets b/snippets/django.snippets index e5aac77..8296cce 100644 --- a/snippets/django.snippets +++ b/snippets/django.snippets @@ -29,7 +29,7 @@ snippet file snippet filepath ${1:FIELDNAME} = models.FilePathField(path=${2:"/abs/path/to/dir"}${3:, max_length=100}${4:, match="*.ext"}${5:, recursive=True}${6:, blank=True, }) snippet float - ${1:FIELDNAME} = models.FloatField({2}) + ${1:FIELDNAME} = models.FloatField(${2}) snippet image ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100}) snippet int @@ -39,13 +39,13 @@ snippet ip snippet nullbool ${1:FIELDNAME} = models.NullBooleanField(${2}) snippet posint - ${1:FIELDNAME} = models.PositiveIntegerField({$2}) + ${1:FIELDNAME} = models.PositiveIntegerField(${2}) snippet possmallint - ${1:FIELDNAME} = models.PositiveSmallIntegerField({$2}) + ${1:FIELDNAME} = models.PositiveSmallIntegerField(${2}) snippet slug ${1:FIELDNAME} = models.SlugField(max_length=${2:50}${3:, blank=True}) snippet smallint - ${1:FIELDNAME} = models.SmallIntegerField({$2}) + ${1:FIELDNAME} = models.SmallIntegerField(${2}) snippet text ${1:FIELDNAME} = models.TextField(${2:blank=True}) snippet time