简体   繁体   中英

Fixtures with picklefield library for Django

A straight forward question:

Is there some easy way to write fixtures (ie in JSON format, but I don't care really) when using models that incorporate PickleFields ?

EDIT:

In the end I think I'll just get rid of fixtures altogether. I'll use named *.py scripts that will create all the objects for me. I've always found fixtures quite cumbersome anyway.

Assuming you are using django-picklefield you can use dumpdata /loaddata just like you would with any other model. Tested it briefly and everything works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM