This commit is contained in:
Fergal Moran
2015-08-18 22:49:40 +01:00
9 changed files with 25 additions and 12 deletions

View File

@@ -229,7 +229,7 @@ class ActivityViewSet(viewsets.ModelViewSet):
if not user.is_authenticated():
raise PermissionDenied("Not allowed")
ret = ActivityPlay.objects.filter(mix__user=user).order_by("-id")
ret = ActivityPlay.objects.filter(mix__user=user.userprofile).order_by("-id")
if len(ret) > 0:
logger.debug("Activity returned: {0}".format(ret[0].get_object_slug()))
@@ -257,7 +257,7 @@ class NotificationViewSet(viewsets.ModelViewSet):
if not user.is_authenticated():
raise PermissionDenied("Not allowed")
return Notification.objects.filter(to_user=user).order_by('-date')
return Notification.objects.filter(to_user=user.userprofile).order_by('-date')
def perform_update(self, serializer):
return super(NotificationViewSet, self).perform_update(serializer)

View File

@@ -104,6 +104,15 @@ INSTALLED_APPS = (
#'django_facebook',
'django_extensions',
'django_gravatar',
# TODO: remove
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.twitter',
'corsheaders',
'sorl.thumbnail',
'djcelery',
@@ -115,6 +124,7 @@ INSTALLED_APPS = (
'storages',
'social.apps.django_app.default',
<<<<<<< HEAD
# TODO: remove
'allauth',
'allauth.account',
@@ -123,6 +133,10 @@ INSTALLED_APPS = (
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.twitter',
'south',
=======
>>>>>>> master
'dbbackup',
'djrill',
'rest_framework',

View File

@@ -1,4 +1,4 @@
Django==1.6.11
Django==1.8.4
django-extensions
django-sendfile
Werkzeug
@@ -15,7 +15,6 @@ django-grappelli==2.5.7
django-model_utils
django-dbbackup
django-user-agents
south
redis
django-celery
django-scheduler

View File

@@ -1,7 +1,7 @@
from django.db import models
from django.db.models.loading import get_model
from basemodel import BaseModel
class _Lookup(BaseModel):
description = models.CharField(max_length=100)

View File

@@ -12,8 +12,8 @@ from dss import localsettings, settings
class BaseModel(models.Model):
logger = logging.getLogger('dss')
object_created = models.DateTimeField(auto_now_add=True, default=datetime.now())
object_updated = models.DateTimeField(auto_now=True, default=datetime.now(), db_index=True)
object_created = models.DateTimeField(auto_now_add=True)
object_updated = models.DateTimeField(auto_now=True, db_index=True)
class Meta:
abstract = True

View File

@@ -14,7 +14,7 @@ class Comment(BaseModel):
comment = models.CharField(max_length=1024)
date_created = models.DateTimeField(auto_now_add=True)
time_index = models.IntegerField(default=0)
likes = models.ManyToManyField(UserProfile, related_name='liked_comments', blank=True, null=True)
likes = models.ManyToManyField(UserProfile, related_name='liked_comments', blank=True)
def get_absolute_url(self):
return '/comment/%i' % self.id

View File

@@ -90,8 +90,8 @@ class Mix(BaseModel):
genres = models.ManyToManyField(Genre)
# activity based stuff
favourites = models.ManyToManyField(UserProfile, related_name='favourites', blank=True, null=True)
likes = models.ManyToManyField(UserProfile, related_name='likes', blank=True, null=True)
favourites = models.ManyToManyField(UserProfile, related_name='favourites', blank=True)
likes = models.ManyToManyField(UserProfile, related_name='likes', blank=True)
def __unicode__(self):
return self.title

View File

@@ -21,7 +21,7 @@ class Release(BaseModel):
release_description = models.TextField()
release_image = models.ImageField(blank=True, upload_to=release_image_name)
release_label = models.ForeignKey(Label)
release_date = models.DateField(default=datetime.now())
release_date = models.DateField(auto_now=True)
embed_code = models.TextField(blank=True)

View File

@@ -62,7 +62,7 @@ class UserProfile(BaseModel):
activity_sharing_twitter = BitField(flags=NOTIFICATION_CHOICES, default=0)
email_notifications = BitField(flags=NOTIFICATION_CHOICES, default=0)
following = models.ManyToManyField('self', null=True, blank=True, symmetrical=False, related_name='followers')
following = models.ManyToManyField('self', blank=True, symmetrical=False, related_name='followers')
# location properties
city = models.CharField(max_length=100, blank=True, null=True)