| Submitter | Dirk Wallenstein |
|---|---|
| Date | Jan. 17, 2011, 9:46 a.m. |
| Message ID | <1295257608-17151-1-git-send-email-halsmit@t-online.de> |
| Download | mbox | patch |
| Permalink | /patch/79136/ |
| State | Accepted |
| Headers | show |
Comments
Hi Dirk, > The keyword 'blank' concerns only validation and does not change what > will be stored in the database. mostly applied: > - hash = HashField(null = True, db_index = True) > + hash = HashField(db_index=True ,null=True, blank=True) Trying to sneak an index in, eh? :) Although this is probably a good idea, do you have a particular requirement (or data) for this change? Cheers, Jeremy
On Fri, Feb 11, 2011 at 09:13:26AM +0800, Jeremy Kerr wrote: > Hi Dirk, > > > The keyword 'blank' concerns only validation and does not change what > > will be stored in the database. > > mostly applied: > > > - hash = HashField(null = True, db_index = True) > > + hash = HashField(db_index=True ,null=True, blank=True) > > Trying to sneak an index in, eh? :) Yeah, except this pesky change-history in the django admin interface ;) > Although this is probably a good idea, do you have a particular requirement > (or data) for this change? No, just when saving a pull request through the admin interface I would have to fake a hash. If it's ok, and you apply, maybe fix the comma-space order in the new line.
Patch
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
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> --- 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(-)