id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 14820 Use `TextField` instead of `PositiveIntegerField` in docs and examples for generic relations. Tai Lee Gabriel Hurley "The docs state that the `object_id` field on a generic model that is linked back to with `GenericForeignKey` fields must be the same type, usually `PositiveIntegerField`. This is not entirely true since [12353] which coerces the primary key value to the same type as the `object_id` field on the generic model. This means that `TextField` should be the preferred type for `object_id` fields on generic models, because it will allow models with integer and non-integer (anything that can be coerced to a string) to link back to the generic model in question. Django actually uses `TextField` (I presume, for this reason) for its own internal generic models (`LogEntry` and `BaseCommentAbstractModel`), so it makes sense that we should tell users how to avoid this old limitation and set a best practice by example. " closed Documentation dev fixed generic relation genericforeignkey object_id type textfield sprintdec2010 Accepted 1 0 0 0 0 0