# Path: webmachine/util/const.py
# SECRET_SIZE = 32 


import uuid
from django.contrib.auth.models import User
from django.db import models
from webmachine.util.const import SECRET_SIZE
# -*- coding: utf-8 -
#
# This file is part of dj-webmachine released under the MIT license. 
# See the NOTICE for more information.





class KeyManager(models.Manager):

    def generate_key_secret(self):
        key = uuid.uuid4().hex
        secret = User.objects.make_random_password(SECRET_SIZE)
        return key, secret

class ConsumerManager(KeyManager):

    def create_consumer(self, name=None, description=None, user=None):

# Path: webmachine/util/const.py
# SECRET_SIZE = 32 


# Path: webmachine/managers.py
import uuid
from django.contrib.auth.models import User
from django.db import models
from webmachine.util.const import SECRET_SIZE

# -*- coding: utf-8 -
#
# This file is part of dj-webmachine released under the MIT license. 
# See the NOTICE for more information.





class KeyManager(models.Manager):

    def generate_key_secret(self):
        key = uuid.uuid4().hex
        secret = User.objects.make_random_password(SECRET_SIZE)
        return key, secret

class ConsumerManager(KeyManager):

    def create_consumer(self, name=None, description=None, user=None):

        key, secret = self.generate_key_secret()