示例#1
0
class UserLog(models.Model):
    todaydate = models.DateTimeField(auto_now_add=True)
    ugroup = models.ForeignKey(UserGroupList, blank=True, default=1)
    user = models.ForeignKey(User)
    logintime = models.DateTimeField(auto_now_add=True)
    logouttime = models.DateTimeField(auto_now_add=True)
    ip = models.CharField(max_length=255)
    urlreq = models.IntegerField(default=0)

    def __str__(self):
        return self.ip
示例#2
0
class DateRangeNewUrl(models.Model):
    url = models.CharField(max_length=255)
    user = models.CharField(max_length=45)
    comName = models.CharField(max_length=45, default='', blank=True)
    urltime = models.DateTimeField(blank=True, auto_now=True)
    startdate = models.DateTimeField(blank=True)
    enddate = models.DateTimeField(blank=True)
    statusid = models.CharField(max_length=45)
    ugroup = models.ForeignKey(UserGroupList, blank=True, default=1)

    def __str__(self):
        return self.url
示例#3
0
class Post(models.Model):
    posturl = models.CharField(max_length=255, default='')
    company = models.CharField(max_length=45)
    status_id = models.CharField(db_index=True, max_length=45)
    status_message = models.TextField(blank=True, null=True)
    status_published = models.DateTimeField(auto_now_add=True, blank=True)
    num_reactions = models.IntegerField()
    num_comments = models.IntegerField()
    num_shares = models.IntegerField()
    num_likes = models.IntegerField()
    num_loves = models.IntegerField()
    num_wows = models.IntegerField()
    num_hahas = models.IntegerField()
    num_sads = models.IntegerField()
    num_angrys = models.IntegerField()
    status = models.IntegerField(default=1)
    fans_comments = models.IntegerField(default=1)
    author_comments = models.IntegerField(default=1)
    total_comments = models.IntegerField(default=1)
    user = models.ForeignKey(User, blank=True)
    postimg = models.TextField(blank=True, null=True, default='')
    post_status = models.IntegerField(default=0)

    def __str__(self):
        return self.status_id
示例#4
0
class Comment(models.Model):
    comment_message = models.TextField(blank=True, null=True)
    status_id = models.CharField(db_index=True, max_length=45)
    negative = models.IntegerField()
    positive = models.IntegerField()
    neutral = models.IntegerField()
    model_sent = models.IntegerField(default=0)

    query = models.IntegerField()
    complain = models.IntegerField()
    appreciation = models.IntegerField()
    feedback = models.IntegerField(default=0)
    feedbackneg = models.IntegerField()
    feedbackpos = models.IntegerField()
    spam = models.IntegerField()
    wom = models.IntegerField()
    model_com = models.IntegerField(default=0)

    pi = models.IntegerField()
    npi = models.IntegerField(default=0)
    notpi = models.IntegerField(default=0)
    model_int = models.IntegerField(default=0)

    product_service = models.IntegerField()
    after_sales = models.IntegerField()
    campaign_offers = models.IntegerField()
    others = models.IntegerField()
    model_cat = models.IntegerField(default=0)

    comment_author = models.CharField(max_length=45, default='')
    author_url = models.CharField(max_length=45, default='')
    comment_published = models.DateTimeField(auto_now_add=True)
    comment_likes = models.IntegerField(default=0)

    company = models.CharField(max_length=45, default='')
    comment_id = models.CharField(max_length=45, default='')
    misclassified = models.IntegerField(default=0)
    comment_status = models.IntegerField(default=0)

    def as_dict(self):
        """
        Create data for datatables ajax call.
        """
        return {
            'comment_message': self.comment_message,
            'status_id': self.status_id,
            'company': self.company,
        }

    @property
    def campaign(self):
        return Post.objects.filter(
            status_id=self.status_id).first().status_message

    def __str__(self):
        return self.status_id
示例#5
0
class TeleProfile(models.Model):
    socialid = models.CharField(max_length=45)
    telcoid = models.CharField(max_length=45)
    name = models.CharField(max_length=45, default='')
    totoal_comment = models.IntegerField()
    pur_pattern = models.IntegerField()
    spam = models.IntegerField()
    score = models.DecimalField(max_digits=5, decimal_places=2)
    cumSum = models.DecimalField(max_digits=5, decimal_places=2)
    sat_level = models.CharField(max_length=45)
    last_interection = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.socialid
示例#6
0
class CampaignAnalysis(models.Model):
    company = models.CharField(max_length=45)
    status_id = models.CharField(max_length=45)
    status_message = models.TextField(blank=True, null=True)
    status_published = models.DateTimeField(auto_now_add=True, blank=True)
    num_reactions = models.IntegerField()
    num_comments = models.IntegerField()
    num_shares = models.IntegerField()
    num_likes = models.IntegerField()
    num_loves = models.IntegerField()
    num_wows = models.IntegerField()
    num_hahas = models.IntegerField()
    num_sads = models.IntegerField()
    num_angrys = models.IntegerField()
    fans_comments = models.IntegerField(default=1)
    author_comments = models.IntegerField(default=1)
    total_comments = models.IntegerField(default=1)
    response_ration = models.FloatField(default=1)
    negative = models.IntegerField(default=1)
    positive = models.IntegerField(default=1)
    neutral = models.IntegerField(default=1)
    ratiopos = models.FloatField(default=1)
    rationeg = models.FloatField(default=1)
    rationeu = models.FloatField(default=1)
    query = models.IntegerField(default=1)
    complain = models.IntegerField(default=1)
    appreciation = models.IntegerField(default=1)
    feedback = models.IntegerField(default=0)
    spam = models.IntegerField(default=1)
    wom = models.IntegerField(default=1)
    query_percentage = models.FloatField(default=1)
    complain_percentage = models.FloatField(default=1)
    appreciation_percentage = models.FloatField(default=1)
    feedback_percentage = models.FloatField(default=0)
    spam_percentage = models.FloatField(default=1)
    wom_percentage = models.FloatField(default=1)
    pi = models.IntegerField(default=1)
    pi_percentage = models.FloatField(default=0)
    npi = models.IntegerField(default=0)
    product_service = models.IntegerField(default=1)
    after_sales = models.IntegerField(default=1)
    campaign_offers = models.IntegerField(default=1)
    others = models.IntegerField(default=1)
    product_service_percentage = models.FloatField(default=1)
    after_sales_percentage = models.FloatField(default=1)
    campaign_offers_percentage = models.FloatField(default=1)
    others_percentage = models.FloatField(default=1)
    dropout_percentage = models.FloatField(default=0)
    post_user = models.ForeignKey(User, blank=True)
    postimg = models.TextField(blank=True, null=True, default='')
    ps_pos = models.IntegerField(default=0)
    ps_neg = models.IntegerField(default=0)
    ps_neu = models.IntegerField(default=0)
    ps_query = models.IntegerField(default=0)
    ps_complain = models.IntegerField(default=0)
    ps_appreciation = models.IntegerField(default=0)
    ps_neg_fed = models.IntegerField(default=0)
    ps_pos_fed = models.IntegerField(default=0)
    total_ps = models.IntegerField(default=0)
    as_pos = models.IntegerField(default=0)
    as_neg = models.IntegerField(default=0)
    as_neu = models.IntegerField(default=0)
    as_query = models.IntegerField(default=0)
    as_complain = models.IntegerField(default=0)
    as_appreciation = models.IntegerField(default=0)
    as_neg_fed = models.IntegerField(default=0)
    as_pos_fed = models.IntegerField(default=0)
    total_as = models.IntegerField(default=0)
    cf_pos = models.IntegerField(default=0)
    cf_neg = models.IntegerField(default=0)
    cf_neu = models.IntegerField(default=0)
    co_query = models.IntegerField(default=0)
    co_complain = models.IntegerField(default=0)
    co_appreciation = models.IntegerField(default=0)
    co_neg_fed = models.IntegerField(default=0)
    co_pos_fed = models.IntegerField(default=0)
    total_co = models.IntegerField(default=0)
    ot_pos = models.IntegerField(default=0)
    ot_neg = models.IntegerField(default=0)
    ot_neu = models.IntegerField(default=0)
    ot_query = models.IntegerField(default=0)
    ot_complain = models.IntegerField(default=0)
    ot_appreciation = models.IntegerField(default=0)
    ot_neg_fed = models.IntegerField(default=0)
    ot_pos_fed = models.IntegerField(default=0)
    total_ot = models.IntegerField(default=0)
    campaign_status = models.IntegerField(default=0)

    def __str__(self):
        return self.status_id