Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kifle Woldu authored and Kifle Woldu committed Oct 5, 2018
2 parents efd6a6c + 3098a1d commit fc69cd2
Show file tree
Hide file tree
Showing 5 changed files with 460 additions and 6 deletions.
1 change: 1 addition & 0 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def get_twitter_info(request, api, twit_obj, template_dict):

template_dict['twitter_friends'] = twitter_friends


@login_required
@render_to('accounts/sync_twitter.html')
def sync_twitter(request):
Expand Down
8 changes: 5 additions & 3 deletions api/migrations/0045_auto__del_unique_ratings_user_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
class Migration(SchemaMigration):

def forwards(self, orm):
pass
# Removing unique constraint on 'Ratings', fields ['user', 'page']
db.delete_unique('api_ratings', ['user_id', 'page_id'])
# db.delete_unique('api_ratings', ['user_id', 'page_id'])


def backwards(self, orm):
pass
# Adding unique constraint on 'Ratings', fields ['user', 'page']
db.create_unique('api_ratings', ['user_id', 'page_id'])
# db.create_unique('api_ratings', ['user_id', 'page_id'])


models = {
Expand Down Expand Up @@ -211,4 +213,4 @@ def backwards(self, orm):
}
}

complete_apps = ['api']
complete_apps = ['api']
223 changes: 223 additions & 0 deletions api/migrations/0049_auto__del_field_page_agg_score.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

def forwards(self, orm):
# Deleting field 'Page.agg_score'
db.delete_column('api_page', 'agg_score')


def backwards(self, orm):
# Adding field 'Page.agg_score'
db.add_column('api_page', 'agg_score',
self.gf('django.db.models.fields.IntegerField')(null=True),
keep_default=False)


models = {
'api.blacklistitem': {
'Meta': {'unique_together': "(('user', 'url'),)", 'object_name': 'BlackListItem'},
'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 7, 13, 0, 0)'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'port': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'api.chatmessage': {
'Meta': {'object_name': 'ChatMessage'},
'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['auth.User']"}),
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'message': ('django.db.models.fields.CharField', [], {'max_length': '2000'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '300'})
},
'api.domain': {
'Meta': {'object_name': 'Domain'},
'agg_score': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}),
'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '200'})
},
'api.eyehistory': {
'Meta': {'object_name': 'EyeHistory'},
'domain': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'end_event': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40'}),
'end_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'favIconUrl': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'favicon_url': ('django.db.models.fields.TextField', [], {'default': "''"}),
'humanize_time': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Page']", 'null': 'True', 'on_delete': 'models.SET_NULL'}),
'src': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40'}),
'start_event': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40'}),
'start_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'}),
'total_time': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'api.eyehistorymessage': {
'Meta': {'ordering': "['-post_time']", 'object_name': 'EyeHistoryMessage'},
'eyehistory': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.EyeHistory']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
'highlight': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Highlight']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'message': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '300'}),
'parent_comment': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'post_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
},
'api.eyehistoryraw': {
'Meta': {'object_name': 'EyeHistoryRaw'},
'domain': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'end_event': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40'}),
'end_time': ('django.db.models.fields.DateTimeField', [], {}),
'favIconUrl': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'favicon_url': ('django.db.models.fields.TextField', [], {'default': "''"}),
'humanize_time': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'src': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40'}),
'start_event': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40'}),
'start_time': ('django.db.models.fields.DateTimeField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'}),
'total_time': ('django.db.models.fields.IntegerField', [], {}),
'url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'api.highlight': {
'Meta': {'object_name': 'Highlight'},
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'highlight': ('django.db.models.fields.CharField', [], {'max_length': '10000'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Page']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
},
'api.mutelist': {
'Meta': {'object_name': 'MuteList'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '300', 'null': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'word': ('django.db.models.fields.URLField', [], {'max_length': '300', 'null': 'True'})
},
'api.page': {
'Meta': {'object_name': 'Page'},
'description': ('django.db.models.fields.TextField', [], {'default': "''"}),
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Domain']"}),
'favIconUrl': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'favicon_url': ('django.db.models.fields.TextField', [], {'default': "''"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'img_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'}),
'url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'})
},
'api.personalizedratings': {
'Meta': {'unique_together': "(('user', 'page'),)", 'object_name': 'PersonalizedRatings'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Page']"}),
'score': ('django.db.models.fields.IntegerField', [], {}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'api.popularhistory': {
'Meta': {'unique_together': "(('user', 'popular_history'),)", 'object_name': 'PopularHistory'},
'avg_time_ago': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'avg_time_spent_score': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),
'eye_hists': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['api.EyeHistory']", 'symmetrical': 'False'}),
'humanize_avg_time': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'messages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['api.EyeHistoryMessage']", 'symmetrical': 'False'}),
'num_comment_score': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),
'popular_history': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.PopularHistoryInfo']"}),
'top_score': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),
'total_time_ago': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'total_time_spent': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'unique_visitor_score': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}),
'visitors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'pophist_visitors'", 'symmetrical': 'False', 'to': "orm['auth.User']"})
},
'api.popularhistoryinfo': {
'Meta': {'object_name': 'PopularHistoryInfo'},
'description': ('django.db.models.fields.TextField', [], {'default': "''"}),
'domain': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '100'}),
'favIconUrl': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'favicon_url': ('django.db.models.fields.TextField', [], {'default': "''"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'img_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '2000'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Page']", 'null': 'True', 'on_delete': 'models.SET_NULL'}),
'title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'}),
'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '255'})
},
'api.ratings': {
'Meta': {'unique_together': "(('user', 'page'),)", 'object_name': 'Ratings'},
'from_time_distribution': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Page']"}),
'score': ('django.db.models.fields.IntegerField', [], {}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'api.summary': {
'Meta': {'object_name': 'Summary'},
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_editor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Page']"}),
'summary': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'})
},
'api.summaryhistory': {
'Meta': {'object_name': 'SummaryHistory'},
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_summary': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'}),
'previous_summary': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000'}),
'summary': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['api.Summary']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.SET_NULL'})
},
'api.whitelistitem': {
'Meta': {'unique_together': "(('user', 'url'),)", 'object_name': 'WhiteListItem'},
'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 7, 13, 0, 0)'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'port': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}

complete_apps = ['api']
Loading

0 comments on commit fc69cd2

Please sign in to comment.