I have a model that represents a position at a company:
class Position(models.Model):
preferred_q = ForeignKey("Qualifications", blank=True, null=True, related_name="pref")
base_q = ForeignKey("Qualifications", blank=True, null=True, related_name="base")
#[...]
It has two "inner objects", which represent minimum qualifications, and "preferred" qualifications for the position.
I have a generic view set up to edit/view a Position instance. Within that page, I have a link that goes to another page where the user can edit each type of qualification. The problem is that I can't just pass the primary key of the qualification, because that object may be empty (blank and null being True, which is by design). Instead I'd like to just pass the position primary key and the keyword "preferred_qualification" or "base_qualification" in the URL like so:
(r'^edit/preferred_qualifications/(?P<parent_id>\d{1,4})/$', some_view),
(r'^edit/base_qualifications/(?P<parent_id>\d{1,4})/$', some_view),
Is there any way to do this using generic views, or will I have to make my own view? This is simple as cake using regular views, but I'm trying to migrate everything I can over to generic views for the sake of simplicity.