Created
March 10, 2017 17:10
-
-
Save leydson-vieira/e441c28fec26f58b809ee1676297780a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self, **kwargs): | |
''' | |
Sobrescreve o método save da classe alterando o slug da instância e atribuindo um UUID (Universal Unique Identifier). | |
''' | |
if not self.id: | |
self.slug = uuid.uuid4() | |
super().save(**kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment