I think you misread my question. FileFields in Models work for me just fine (I have already defined MEDIA_ROOT and figured out directory stuff). However, I need to have FileField in Field and that Field in Model, but having such hierarchy throws error.
2019 m. lapkritis 5 d., antradienis 15:42:38 UTC+2, Integr@te System rašė: > > Hi Issuer, > > please see: > In your settings file, you’ll need to define MEDIA_ROOT > <https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-MEDIA_ROOT> > as > the full path to a directory where you’d like Django to store uploaded > files. (For performance, these files are not stored in the database.) > Define MEDIA_URL > <https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-MEDIA_URL> > as > the base public URL of that directory. Make sure that this directory is > writable by the Web server’s user account. > > https://docs.djangoproject.com/en/2.2/ref/models/fields/ > > And more check in this content. > > > > On Tue, Nov 5, 2019, 20:01 Simonas Pilkauskas <[email protected] > <javascript:>> wrote: > >> Hello, >> I want to setup a Model like this >> <https://github.com/Simonas0/django_playground/blob/master/files_in_custom_fields/models.py>, >> >> but apparently FileField in custom field doesn't work out of box (when >> trying to save, I get the error "can't adapt type >> 'TemporaryUploadedFile'"). FileField, which is directly in Model, works >> fine. >> I've tried what came to my mind, but I'm relatively new to Django and >> can't figure out myself. >> Could anyone help me? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/c34d85b3-78d6-4d89-804f-b1cf2f77c2e5%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/c34d85b3-78d6-4d89-804f-b1cf2f77c2e5%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/042528fe-4150-4433-bf69-845dffa73b2e%40googlegroups.com.

