eggDiscover / followerslookup / models.py

"""
Here we define the schema used as database for the application followerslookup
"""

from django.db import models

class User(models.Model):
    """
    Represent a twitter :class:`User`.
    """
    id = models.BigIntegerField(primary_key=True)
    created_at = models.DateTimeField()
    description = models.TextField(null=True)
    favourites_count = models.IntegerField(null=True, blank =True)
    followers_count = models.IntegerField(null=True, blank =True)
    friends_count = models.IntegerField(null=True, blank =True)
    lang = models.CharField(max_length = 10)
    listed_count = models.IntegerField(null=True, blank =True)
    location = models.CharField(max_length = 140,null=True,blank=True)
    name = models.CharField(max_length = 140)
    profile_background_color = models.CharField(max_length = 25,null=True, blank =True)
    profile_background_tile = models.CharField(max_length = 140,null=True, blank =True)
    profile_image_url = models.CharField(max_length = 500,null=True, blank =True)
    profile_image_url_bigger = models.CharField(max_length = 500,null=True, blank =True)
    profile_link_color = models.CharField(max_length = 25,null=True, blank =True)
    profile_sidebar_fill_color = models.CharField(max_length = 25,null=True, blank =True)
    profile_text_color = models.CharField(max_length = 25,null=True, blank =True)
    protected = models.BooleanField()
    screen_name= models.CharField(max_length = 250)
    statuses_count = models.IntegerField(null=True, blank =True)
    time_zone = models.CharField(max_length = 250,null=True, blank=True)
    url = models.CharField(max_length = 500, null=True, blank=True)
    utc_offset = models.IntegerField(null=True,blank=True)
    verified = models.BooleanField()
    protected = models.BooleanField()
    notifications = models.BooleanField()
    geo_enabled = models.BooleanField()
    contributors_enabled = models.BooleanField()

    
    def __unicode__(self):
        return self.screen_name


class TwitterUser(models.Model):
    """
    Represent a twitter user we want to analyse for eggs
    """
    name = models.CharField(max_length = 140)
    followers = models.ManyToManyField(User)
    lastindex = models.IntegerField(default = 0)

    def __unicode__(self):
        return self.name

    def followers_count(self):
        return self.followers.count()

class Monitoring(models.Model):
    """
    Bench utils not used for now
    """
    action = models.CharField(max_length = 250)
    elapsed_time = models.CharField(max_length = 250)
    
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.