Commit 3a2ff6e0 authored by Alexandre's avatar Alexandre

merge: bugfix/#148 into dev

parents 5bcf51d8 b66e337e
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-07-07 14:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_manager', '0007_auto_20190702_1134'),
]
operations = [
migrations.AlterModelOptions(
name='actiontheme',
options={},
),
migrations.AlterField(
model_name='action',
name='num_of_members',
field=models.IntegerField(blank=True, null=True, verbose_name='Nombre de participants'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-07-07 14:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_manager', '0008_auto_20190707_1609'),
]
operations = [
migrations.AlterField(
model_name='action',
name='num_of_members',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Nombre de participants'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-07-08 09:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('data_manager', '0009_auto_20190707_1615'),
]
operations = [
migrations.AlterModelOptions(
name='actiontheme',
options={'default_permissions': ('add', 'change', 'delete', 'view', 'control')},
),
]
......@@ -15,13 +15,13 @@ import itertools
Conversation._meta.permission_classes = [ThreadPermission]
User._meta.serializer_fields = ['@id', 'username', 'first_name', 'last_name', 'email', 'actions', 'created_actions', 'get_full_name', 'userprofile']
User._meta.rdf_context = {"get_full_name": "rdfs:label", "photo": "foaf:depiction"}
User._meta.serializer_fields = ['@id', 'username', 'first_name', 'last_name', 'email', 'actions', 'active_actions', 'created_actions', 'get_full_name', 'userprofile']
User._meta.rdf_context = {"get_full_name": "rdfs:label"}
User._meta.depth = 0
User._meta.get_field('username').verbose_name = "Email"
#def active_actions(self):
# return json.dumps(list(self.actions.filter(date__gte=date.today())))
#User.active_actions=active_actions
User._meta.get_field('username').verbose_name = "Email"
def active_actions(self):
return self.actions.filter(date__gte=date.today())
User.active_actions=active_actions
class UserProfile(Model):
photo = models.URLField(max_length=9999999, blank=True, verbose_name=u"URL de la photo")
......
......@@ -10,7 +10,7 @@ urlpatterns = [
url(r'^api/quit_action/(?P<pk>\d+)/', views.quit_action, name='quit_action'),
# API:
url(r'^api/users/', LDPViewSet.urls( model=User, fields = ['@id','first_name', 'last_name', 'username', 'email', 'actions', 'created_actions', 'get_full_name', 'userprofile'], nested_fields=['actions', 'created_actions', 'userprofile'], permission_classes=(),)),
url(r'^api/users/', LDPViewSet.urls( model=User, fields = ['@id','first_name', 'last_name', 'username', 'email', 'actions', 'active_actions', 'created_actions', 'get_full_name', 'userprofile'], nested_fields=['actions', 'created_actions', 'userprofile'], permission_classes=(),)),
url(r'^api/active-actions/', ActionViewSet.urls()),
url(r'^api/', include('djangoldp.urls')),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment