support for uuid
See original GitHub issueHi, I tried using uuids as ids and it doesn’t work because of the save method in TenantMixin. When saving the setattr(self, self.tenant_field, tenant_value) line never gets called because self.pk has value when dealing with uuids different from IntegerField. I created my own abstract class and added a created field it did the trick, but it would be nice to have native support for uuids.
def save(self, *args, **kwargs):
tenant_value = get_current_tenant_value()
if not self.pk and tenant_value and not isinstance(tenant_value, list):
setattr(self, self.tenant_field, tenant_value)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
What is a UUID, and why should you care? - Cockroach Labs
A UUID – that's short for Universally Unique IDentifier, by the way – is a 36-character alphanumeric string that can be used to...
Read more >Universally unique identifier - Wikipedia
A universally unique identifier (UUID) is a 128-bit label used for information in computer systems. The term globally unique identifier (GUID) is also...
Read more >Mysql 8.0: UUID support
In MySQL 8.0.0 we introduced many new features; among those, three new functions that ease and enhance the support for working with UUIDs....
Read more >UUID Data Type - MariaDB Knowledge Base
The UUID data type is intended for the storage of 128-bit UUID (Universally Unique Identifier) data. See the UUID function page for more...
Read more >Documentation: 15: 8.12. UUID Type - PostgreSQL
The data type uuid stores Universally Unique Identifiers (UUID) as defined by RFC 4122, ISO/IEC 9834-8:2005, and related standards.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
I just released a new version
2.2.1
with the fix for this.We fixed it by using this implementation in our model base class: