playlists/models.py
def validate(self):
        """Validate this instance before putting it to the datastore."""
        if not self.created_by_dj.is_dj:
            raise ValueError("User %r must be a DJ (user is: %r)" % (
                                self.created_by_dj, self.created_by_dj.roles))
Validate this instance before putting it to the datastore.
Validate this instance before putting it to the datastore.
Validate this instance before putting it to the datastore .
def validate(self):
        if not self.created_by_dj.is_dj:
            raise ValueError("User %r must be a DJ (user is: %r)" % (
                                self.created_by_dj, self.created_by_dj.roles))
def validate ( self ) : if not self . created_by_dj . is_dj : raise ValueError ( "User %r must be a DJ (user is: %r)" % ( self . created_by_dj , self . created_by_dj . roles ) )
Validate this instance before putting it to the datastore.
Validate this instance before putting it to the datastore .
"""Validate this instance before putting it to the datastore."""
self