[Answered ]-How to add list field in the django restframework sqlite

1👍

SQLite doesn’t support list or array fields, but you have few options depending on what you want to archive.

  1. Switch to Postresql (it supports those fields)
  2. If your list store objects, then you can create model for the objects and create One-to-Many or Many-to-Many relationship. Then you can get a list of models using something like YourModel.your_related_objects_set.all()
  3. If you want to just store simple values like integers or strings then you can use Charfield and some custom logic to extract values from string and convert it to list

Leave a comment