From f87fe3d5a021a0ce471a3eedf404e88841212e3d Mon Sep 17 00:00:00 2001 From: Qwann Date: Wed, 26 Jul 2017 13:15:41 +0200 Subject: [PATCH] renamed attribute + PEP --- event/migrations/0003_auto_20170726_1116.py | 26 +++++++++++++++++++++ event/models.py | 5 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 event/migrations/0003_auto_20170726_1116.py diff --git a/event/migrations/0003_auto_20170726_1116.py b/event/migrations/0003_auto_20170726_1116.py new file mode 100644 index 0000000..e776702 --- /dev/null +++ b/event/migrations/0003_auto_20170726_1116.py @@ -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'), + ), + ] diff --git a/event/models.py b/event/models.py index 957e13a..eebe9b3 100644 --- a/event/models.py +++ b/event/models.py @@ -24,7 +24,7 @@ class Event(SubscriptionMixin, models.Model): related_name="created_events", editable=False, ) - creation_date = models.DateTimeField( + created_at = models.DateTimeField( _('date de création'), auto_now_add=True, ) @@ -179,7 +179,8 @@ class Activity(AbstractActivityTemplate): end = models.DateTimeField(_("heure de fin")) 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() if f.many_to_many] attr = getattr(self, attrname)