#31416: FieldError when migrating field to new model subclass.
-------------------------------+------------------------------------
Reporter: Eduard Anghel | Owner: Nan Liu
Type: Bug | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Comment (by Nan Liu):
Replying to [comment:9 Sanskar Jaiswal]:
> Hey Nan,
>
> Happy that you figured out the solution. By all means, continue working
on this, hope you get a good grade on your assignment. IMO, we could check
that this is the field we are trying to remove from the base class by
looping through all the fields and checking if that field is also present
in a sub class. Since that’s not allowed, you know that this is the field
you wanna remove
>
> Cheers
> Sanskar
Thank you so much for your advice! I still can't figure out how to find
`title` field in the base class. I was able to find `title` field from a
sub class using `model_state.fields`. And I tried `model_state =
self.to_state.models[base_app_label, base_model_name]` to find its fields,
but there is only one field left which is self-generated `id` field. I am
pretty sure I am doing it wrong. But I am just wondering if there is other
ways to retrieve all fields of the base class, which is `readable` in this
case.
--
Ticket URL: <https://code.djangoproject.com/ticket/31416#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.5032191f9a3dc6f10b83ca681e79bb3e%40djangoproject.com.