djdb/models.py
def create(cls, *args, **kwargs):
        """Create an Artist object with an automatically-assigned key."""
        if 'key_name' not in kwargs:
            encoded_name = kwargs['name'].encode('utf-8')
            hashed = hashlib.sha1(encoded_name).hexdigest()
            kwargs['key_name'] = "artist:%s" % hashed
        return cls(*args, **kwargs)
Create an Artist object with an automatically-assigned key.
Create an Artist object with an automatically-assigned key.
Create an Artist object with an automatically - assigned key .
def create(cls, *args, **kwargs):
        if 'key_name' not in kwargs:
            encoded_name = kwargs['name'].encode('utf-8')
            hashed = hashlib.sha1(encoded_name).hexdigest()
            kwargs['key_name'] = "artist:%s" % hashed
        return cls(*args, **kwargs)
def create ( cls , * args , ** kwargs ) : if 'key_name' not in kwargs : encoded_name = kwargs [ 'name' ] . encode ( 'utf-8' ) hashed = hashlib . sha1 ( encoded_name ) . hexdigest ( ) kwargs [ 'key_name' ] = "artist:%s" % hashed return cls ( * args , ** kwargs )
Create an Artist object with an automatically-assigned key.
Create an Artist object with an automatically - assigned key .
"""Create an Artist object with an automatically-assigned key."""
cls