I have the following model defined (in my models.py file):
class File(models.Model):
filename = models.FilePathField(path = '/my_dir/', recursive = True)
This model has been registered to the automatic *admin interface* (in the
admin.py file):
class FileAdmin(admin.ModelAdmin):
fields = ('filename', )
admin.site.register(File, FileAdmin)
*Adding* a new file using the automatic *admin interface* correctly
displays a FilePathField widget pointing to the /my_dir/ directory.
However, when I enter the *change view* in the *admin interface* (by
clicking on the file in the *list view* page), I would like to have a
CharField widget to display the filename of my file (instead of the
FilePathWidget as defined in the File class). Is there a way to achieve
this somehow?
Many thanks in advance,
- Hans
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/t9CE4c5Wg-kJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.