Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UUID pks #38

Open
morlandi opened this issue Jan 15, 2023 · 0 comments
Open

Add support for UUID pks #38

morlandi opened this issue Jan 15, 2023 · 0 comments

Comments

@morlandi
Copy link

Hello @rbarrois ,
this is exactly the support I've always dreamed of for managing workflows in a Django project. Thank you.

I failed to use GenericTransitionLog() as my Models use UUID as pks.

At the moment I solved this at project level by introducing this variant, which seems to work:

class GenericTransitionLogWithUUID(xwf_models.GenericTransitionLog):
    """Abstract model for a minimal database logging setup.

    Specializes GenericTransitionLog to use a GenericForeignKey with UUID as pk.
    """
    content_id = models.UUIDField(_("Content id"), blank=True, null=True, db_index=True)

    class Meta:
        abstract = True

I think UUID should be considered first-citizens in the Django ecosystem sooner or later ... in case, I can add a specific unit test and prepare a PR. Let me know if you're interested; I do not mind a negative answer at all.

I would also add on_delete here and there to the ForeignKeys for better compatibility with recent versions of Django

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant