AttributeError: 'str' object has no attribute '_meta' (when using South)
I'm getting this error when I use 'startmigration' in South.
My guess is that I have data that is not serializable.
What is the best way for me to determine the o开发者_运维知识库ffending model?
I solved this by removing the problematic field, applying the migration, adding the field again and doing another migration.
My problem was an inconsistency with a field name that I renamed and some previous migrations that were trying to find it. What would also probably work (and perhaps a better solution) is to edit the migration scripts in <app>/migrations
to match the new field name.
I had to do this when updating the project in the production environment.
Since something is asking for _meta
attribute, then it means, that it expects model (or form, to be preceise, but I believe it's not the case) object, since models have _meta
attributes, but you are passing a string. If you more help, you need to present some code, to determine what is wrong.
Try updating to the latest version of South. There have been some recent fixes for one cause of this.
精彩评论