I have a simple posting page app with the following "RecordEntry" model:
class RecordEntry(models.Model):
client = models.ForeignKey(PostPage)
filename = models.CharField(max_length=64, unique=False, blank=True, null=True)
descriptor = models.CharField(max_length=64, unique=False, blank=True, null=True)
date = models.DateField(_("Date"), default=datetime.date.today)
post_type = models.CharField(max_length=50, choices=POST_CHOICES)
round = models.CharField(max_length=50, choices=ROUND_CHOICES)
pdf = models.CharField(max_length=100, unique=False, blank=True, null=True)
html = models.CharField(max_length=100, unique=False, blank=True, null=True)
zip = models.CharField(max_length=100, unique=False, blank=True, null=True)
psd = models.CharField(max_length=100, unique=False, blank=True, null=True)
def __unicode__ (self):
return return u'%s %s' % (self.client, self.filename)
class Admin:
pass
the pdf, html, zip, and psd fields will hold paths to those objects which will be displayed as links by the template. My question is, is there a way I can avoid actually typing the entire path in these fields every time? Is there a widget of some type that will allow me to browse the filesystem and capture the path of any item I click on?
This get you anywhere?
Is there a filesystem plugin available for django?
There's a bit of a how-to here:
http://rfc1437.de/page/writing-a-simple-filesystem-browser-with-django/
but you'd have to make it into a selection widget yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With