Skip to content

Command line support for serializers in submodules #44

@BradWells

Description

@BradWells

I have a serializer named MySerializer in my_app/my_submodule/serializers.py

Unfortunately, the command line is not recursive, so using ./manage.py generate_ts -s my_app does not work as my_app doesn't have a serializers.py file within it.

./manage.py generate_ts -s my_app.my_submodule also does work just as above, because the command like thinks my_submodule is the class name of the serializer.

./manage.py generate_ts -s my_app.my_submodule.serializers.MySerializer and ./manage.py generate_ts -s my_app.my_submodule.MySerializer both fail because the commandline does not expect submodules.

I would like to propose that ./manage.py generate_ts -s my_app does a recursive search for files named serializers.py and that ./manage.py generate_ts -s my_app.my_submodule should check for a python module, and if it finds one, do a recursive search for serializers.py files in that module (otherwise it would fall back to checking if my_app.serializers.py exists and has a my_submodule class name)

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