1👍
The URL field in the ImageField is ReadOnly, so you cannot write it. You should probably use in addition a URLField (better than a CharField) to save the URLs.
You can allow null values on both and use only the appropriate one according to your scenario.
0👍
class FilePathField(path='', match=None, recursive=False, > allow_files=True, allow_folders=False, max_length=100, **options)
A CharField
whose choices are limited to the filenames in a certain directory on the filesystem.
Has some special arguments, of which the first is required:
FilePathField.path
Required. The absolute filesystem path to a directory from which this
FilePathField
should get its choices. Example: "/home/images".
For more info visit the doc https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.FilePathField
- [Answered ]-Custom accessor name in Django multi-table inheritance
- [Answered ]-How to programatically insert HTML in a Django template based on attributes in a model
- [Answered ]-Django report builder TEMPLATE_CONTEXT_PROCESSORS and Django 1.8
- [Answered ]-Accessing objects from another model using foreign key
Source:stackexchange.com