Merge branch 'Qwann/SmallFixes' into Qwann/Serializers

This commit is contained in:
Qwann 2017-07-26 15:43:12 +02:00
commit cb9505f289
4 changed files with 32 additions and 4 deletions

View file

@ -26,7 +26,7 @@ class SubscriptionTest(TestCase):
title='TestEvent', title='TestEvent',
slug='test', slug='test',
created_by=cls.root, created_by=cls.root,
creation_date=timezone.now(), created_at=timezone.now(),
description="Ceci est un test", description="Ceci est un test",
beginning_date=timezone.now() beginning_date=timezone.now()
+ timedelta(days=30), + timedelta(days=30),

View file

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-26 11:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('event', '0002_auto_20170723_1419'),
]
operations = [
migrations.RenameField(
model_name='event',
old_name='creation_date',
new_name='created_at',
),
migrations.AlterField(
model_name='activity',
name='parent',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='event.ActivityTemplate'),
),
]

View file

@ -24,7 +24,7 @@ class Event(SubscriptionMixin, models.Model):
related_name="created_events", related_name="created_events",
editable=False, editable=False,
) )
creation_date = models.DateTimeField( created_at = models.DateTimeField(
_('date de création'), _('date de création'),
auto_now_add=True, auto_now_add=True,
) )
@ -167,6 +167,7 @@ class Activity(AbstractActivityTemplate):
ActivityTemplate, ActivityTemplate,
related_name="children", related_name="children",
blank=True, blank=True,
null=True,
) )
staff = models.ManyToManyField( staff = models.ManyToManyField(
User, User,
@ -178,7 +179,8 @@ class Activity(AbstractActivityTemplate):
end = models.DateTimeField(_("heure de fin")) end = models.DateTimeField(_("heure de fin"))
def get_herited(self, attrname): def get_herited(self, attrname):
inherited_fields = [f.name for f in ActivityTemplate._meta.get_fields()] inherited_fields = [f.name for f in
ActivityTemplate._meta.get_fields()]
m2m_fields = [f.name for f in ActivityTemplate._meta.get_fields() m2m_fields = [f.name for f in ActivityTemplate._meta.get_fields()
if f.many_to_many] if f.many_to_many]
attr = getattr(self, attrname) attr = getattr(self, attrname)

View file

@ -22,7 +22,7 @@ class ActivityInheritanceTest(TestCase):
title='La Nuit 2042', title='La Nuit 2042',
slug='nuit42', slug='nuit42',
created_by=cls.erkan, created_by=cls.erkan,
creation_date=timezone.now(), created_at=timezone.now(),
description="La nuit c'est lol", description="La nuit c'est lol",
beginning_date=timezone.now() beginning_date=timezone.now()
+ timedelta(days=30), + timedelta(days=30),