Commits

Matthew Schinckel  committed bac633e

Added manager with creation helper

  • Participants
  • Parent commits 94c048a

Comments (0)

Files changed (1)

File biometrics/models/fingerprint_template.py

 
 import picklefield
 
+class FTManager(models.Manager):
+    def create_with_serialized_data(self, data, **kwargs):
+        data = data.decode('base64')
+        return self.create(data=data, **kwargs)
+    
 class FingerprintTemplate(models.Model):
     user = models.OneToOneField('auth.User', 
         related_name='fingerprint_template')