lincolnloop / django-dynamic-raw-id

(formerly known as django-salmonella) A raw_id_fields widget replacement that handles display of an object's string value on change and can be overridden via a template.
MIT License
163 stars 55 forks source link

Use correct Form Field based on related Model Field type #83

Closed jacklinke closed 7 months ago

jacklinke commented 2 years ago

When initializing the form, look at whether the related model field is a UUIDField, CharField, or other, and utilize forms.UUIDField, forms.CharField, or forms.IntegerField, respectively.

Should resolve #67 and replace PR #74 with a much simpler approach (no duplication of forms, which would be a breaking change).

jacklinke commented 2 years ago

Please let me know thoughts on this, and I'll add tests and the associated test models with different pk types.

bartTC commented 2 years ago

Uh nice. Would you try adding test models for these use cases?

bartTC commented 7 months ago

This has been fixed in fb2bf46a01c4fb814d135956cbc1d6146b2272fb. I figured, you don't need to have specific field types for a Filter Input field.