mirror of
https://github.com/fergalmoran/dss.api.git
synced 2026-01-03 07:05:23 +00:00
Stuff
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user