Skip to content

String default for FileBrowserField not working #51

@carlosgeos

Description

@carlosgeos

Clone of sehmaschine#358, I decided to open it here since it looks more actively maintained.

A string default for FileBrowserField does not work since it looks for .path on a string, at least on PostgreSQL:

def get_prep_value(self, value):
if not value:
return value
return value.path

Of course this fails with:

AttributeError: 'str' object has no attribute 'path'

Other examples can be found in the original issue linked.

I'll submit the same PR, but maybe there is a better solution to this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions