diff options
author | Dirk Wallenstein <halsmit@t-online.de> | 2011-01-16 23:46:48 +0000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2011-02-11 09:08:34 +0800 |
commit | ab21927af7fa4003a0da8986c8448cb4cb134d6c (patch) | |
tree | e28006dccf88f4fc91cbeb7945ca7fdab00781bb /apps | |
parent | 47c56dfaceefaa44e5057236a5b63a05f68a981d (diff) | |
download | patchwork-ab21927af7fa4003a0da8986c8448cb4cb134d6c.tar patchwork-ab21927af7fa4003a0da8986c8448cb4cb134d6c.tar.gz |
models: Don't require optional model fields in forms
Add blank = True for nullable fields, to allow forms to be subitted
without a value for these fields.
The keyword 'blank' concerns only validation and does not change what
will be stored in the database.
Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/patchwork/models.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index 5c0ca95..134e12f 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -44,8 +44,8 @@ except ImportError: class Person(models.Model): email = models.CharField(max_length=255, unique = True) - name = models.CharField(max_length=255, null = True) - user = models.ForeignKey(User, null = True) + name = models.CharField(max_length=255, null = True, blank = True) + user = models.ForeignKey(User, null = True, blank = True) def __unicode__(self): if self.name: @@ -71,7 +71,7 @@ class Project(models.Model): class UserProfile(models.Model): user = models.ForeignKey(User, unique = True) - primary_project = models.ForeignKey(Project, null = True) + primary_project = models.ForeignKey(Project, null = True, blank = True) maintainer_projects = models.ManyToManyField(Project, related_name = 'maintainer_project') send_email = models.BooleanField(default = False, @@ -188,10 +188,10 @@ class Patch(models.Model): state = models.ForeignKey(State) archived = models.BooleanField(default = False) headers = models.TextField(blank = True) - content = models.TextField(null = True) - pull_url = models.CharField(max_length=255, null = True) + content = models.TextField(null = True, blank = True) + pull_url = models.CharField(max_length=255, null = True, blank = True) commit_ref = models.CharField(max_length=255, null = True, blank = True) - hash = HashField(null = True, db_index = True) + hash = HashField(null = True, blank = True) def __unicode__(self): return self.name |