comparison apps/bundle/models.py @ 171:a57d15b044a7

Add help_text to name field for bundles Explains that the name field is meant to hold a slug, etc.
author dellsystem <ilostwaldo@gmail.com>
date Sat, 20 Oct 2012 00:29:49 -0400
parents c7be7def8b57
children c042d26e6936
comparison
equal deleted inserted replaced
170:3be23e2e8fe7 171:a57d15b044a7
1 import os 1 import os
2 2
3 from django.db import models 3 from django.db import models
4 from django.contrib.auth.models import User 4 from django.contrib.auth.models import User
5 from django.utils.translation import ugettext_lazy as _
5 from pygments import lexers, highlight, formatters, util 6 from pygments import lexers, highlight, formatters, util
6 from mptt.models import MPTTModel, TreeForeignKey 7 from mptt.models import MPTTModel, TreeForeignKey
7 from sizefield.models import FileSizeField 8 from sizefield.models import FileSizeField
8 9
9 from apps.free_license.models import FreeLicense 10 from apps.free_license.models import FreeLicense
14 class Meta: 15 class Meta:
15 # Every user must pick unique names for their bundles 16 # Every user must pick unique names for their bundles
16 unique_together = ('uploader','name') 17 unique_together = ('uploader','name')
17 ordering = ['-pub_date'] 18 ordering = ['-pub_date']
18 19
19 name = models.SlugField() 20 name = models.SlugField(help_text=_("Your bundle will be accessible " +
21 "from a URL that uses the name you enter here, so choose wisely. " +
22 "Acceptable characters: alphanumeric characters, hyphens, and " +
23 "underscores."))
20 uploader = models.ForeignKey(User) 24 uploader = models.ForeignKey(User)
21 description = models.TextField(max_length=32728) 25 description = models.TextField(max_length=32728)
22 free_license = models.ForeignKey(FreeLicense, default=1) 26 free_license = models.ForeignKey(FreeLicense, default=1)
23 pub_date = models.DateTimeField('date uploaded', auto_now_add=True) 27 pub_date = models.DateTimeField('date uploaded', auto_now_add=True)
24 mod_date = models.DateTimeField('date last modified', auto_now=True) 28 mod_date = models.DateTimeField('date last modified', auto_now=True)