Skip to content

application_manager

h0pbeat edited this page Jun 5, 2013 · 1 revision

Module for managing registered applications. Applications can be clients in OAuth2 sense (e.g. Funf) or resource providers (e.g. Facebook). Applications use connectors to provide or access the data.

models

class Parameter(models.Model):
        key = models.CharField(max_length=240, db_index=True)
        value = models.CharField(max_length=240, db_index=True)
        def __unicode__(self):
                return self.key+':'+self.value

class Application(models.Model):
        name = models.CharField(unique=True, max_length=256)
        _id = models.CharField(unique=True, max_length=20, default=KeyGenerator(20), db_index=True)
        user = models.ForeignKey(User)
        scopes = models.ManyToManyField(Scope)
        params = models.ManyToManyField(Parameter)
        description = models.TextField(null=True, blank=True)
        connector_type = models.CharField(max_length=100)

        def __unicode__(self):
                return self.name+':'+self._id

Clone this wiki locally