From patchwork Mon Jan 17 09:46:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Wallenstein X-Patchwork-Id: 79136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 2E7CFB70CD for ; Mon, 17 Jan 2011 20:47:21 +1100 (EST) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) by ozlabs.org (Postfix) with ESMTP id 01E7DB7063 for ; Mon, 17 Jan 2011 20:47:18 +1100 (EST) Received: from fwd08.aul.t-online.de (fwd08.aul.t-online.de ) by mailout04.t-online.de with smtp id 1PelgE-0005cG-8t; Mon, 17 Jan 2011 10:47:18 +0100 Received: from localhost.localdomain (Tt4b8oZCghkfLbNOcPhYJw6sfQL4IzgI1lVyTRr6Ht3wD1E5BwHy7WnVgCieL2SQL5@[84.139.42.252]) by fwd08.t-online.de with esmtp id 1Pelfr-1IdSBU0; Mon, 17 Jan 2011 10:46:55 +0100 From: Dirk Wallenstein To: patchwork@lists.ozlabs.org Subject: [PATCH v2] Don't require optional model fields in forms Date: Mon, 17 Jan 2011 10:46:48 +0100 Message-Id: <1295257608-17151-1-git-send-email-halsmit@t-online.de> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1295092327-15376-1-git-send-email-halsmit@t-online.de> References: <1295092327-15376-1-git-send-email-halsmit@t-online.de> X-ID: Tt4b8oZCghkfLbNOcPhYJw6sfQL4IzgI1lVyTRr6Ht3wD1E5BwHy7WnVgCieL2SQL5 X-TOI-MSGID: e6fe4dff-815f-4550-8b75-120b0a50c110 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org The keyword 'blank' concerns only validation and does not change what will be stored in the database. Signed-off-by: Dirk Wallenstein --- Initially I thought the 'content' and 'hash' fields should always be non-empty, but they are in a pull request. Now every null=True has a blank=True. 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..dd554a9 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(db_index=True ,null=True, blank=True) def __unicode__(self): return self.name