Newwbie trying to get a variable name into a field name
3 views
Skip to first unread message
dave....@gmail.com
unread,
Feb 7, 2008, 4:01:55 AM2/7/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Here is my basic model:
class Type(models.Model):
name = models.CharField()
description = models.TextField(blank=True)
created = models.DateTimeField(auto_now_add)
modified = models.DateTimeField(auto_now)
class Media(models.Model):
name = models.CharField()
description = models.TextField(blank=True)
media_type = models.ForeignKey(Type)
path_to_file = models.FileField(upload_to='/%s/%Y/%m/%d/ %s
media_type')
created = models.DateTimeField(auto_now_add)
modified = models.DateTimeField(auto_now)
slug = models.SlugField(prepopulate_from=("name",))
I know I can't do what I am trying to do in the Media class, but how
can I do this? How can I name that folder from the media_type
fieldname?
Lemme know. Thanks.
Nathaniel Whiteinge
unread,
Feb 7, 2008, 11:57:37 AM2/7/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message