#3148 (Birthday calendar)

by Luc Saffre · in Developers · assigned to Luc Saffre

Résumé

contacts.Person should simply act as a calendar entry generator, similar to cal.RecurrentEvents : having a Person with a non-empty birth_date should generate every year an automatic calendar entry.

Concepts sous-jacents

Commentaires

  • 2 ans, 9 mois ago by Luc Saffre about #3148 (Birthday calendar) : The test case and documentation is [url dev.lino-framework.org/plugins/contacts.html#showing-birthdays here].
  • 2 ans, 9 mois ago by Luc Saffre about #3148 (Birthday calendar) : Fixing the problem took 5 minutes, writing a test case to cover it took 50 minutes. As usual.
  • 2 ans, 9 mois ago by Luc Saffre about #3148 (Birthday calendar) : On December 31, "Upcoming birthdays" does not currently show the birthdays of 1st and 2nd and 3rd January.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I started to push my changes. In the end I realized that we need only one little welcome message handler that prints the upcoming birthdays. No need to generate calendar entries for birthdays. It is yet to be seen whether everybody wants such a welcome message and whether we need more filtering opti...
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : In Avanti, the get_welcome_messages() method is inherited by Clients, AllClients etc and therefore the birthdays are being shown multiple times.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : It's true: thanks to the Right() function I can simply write recent and upcoming birthdays as a welcome message! No need to generate calendar entries!
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Yes, with [url docs.djangoproject.com/en/4.2/ref/models/database-functions/#text-functions text functions] (left(), right() and substr()) we can show birthdays without generating any calendar entry at all.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I am almost done, but I start to wonder whether we should do it completely differently: actually we don't want to see birthdays when planning some meeting 3 weeks in advance. Birthdays aren't calendar entries. If we would implement the UncompleteDateField using 3 integers instead of one charfield, w...
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I will undo my change in Avanti where I moved the user field out of the Client model into a separate Coaching model.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I removed a strange code fragment in lino.core.fields: if isinstance(fld, models.ManyToOneRel):         gettable = False
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I still have 14 failures in after my changes, most are trivial, but at least one is still a riddle...
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Yet another detail: the Born mixin cannot be in cal because e.g. min1 has contacts without cal.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Uff, I finally found why I was stuck. lino_xl.lib.clients.ClientBase was asuming that the coach is stored in a field "user", but in Avanti the coach is now in field "coaching__user".
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I am still stuck because moving the user field to a separate model with a OneToOneField causes several changes re4garding filtering parameters.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I think I know now what to do. No, I won't split EventGenerator. If they want Lino to automatically generate meeting suggestions, the must add the coachings plugin or something equivalent. The person generate birthday events and the coaching generates coaching events. At least in the case of Avanti ...
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : But the generated calendar ere linked to their generator via the 'owner' field, and a calendar entry needs to "know" its generator, at least for MoveEntryNext.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : I think I will have to split the EventGenerator class into two parts, and coached clients with a birth date will implement two different event generators...
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : The concrete problem for me right now is that get_events_user() must get some argument in order to know whether to return the primary coach or None, depending on whether we are generating birthday entries or meetings.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Birthday entries are similar to holiday entries in that there is no responsible user, and the "state" does not need to be "draft", it might be "scheduled" directly when the entry is generated because there is no discussion needed. Birthday entries are similar to evaluation meetings in that they are ...
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Which makes me realize that this ticket is related to#5221 (Replace cal.Task by cal.Event).
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Confirmation: indeed a coached client can generate calendar entries for evaluation meetings of a client and his responsible coach. That feature was planned and then fell asleep.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Oh, I noticed only now that clients, in avanti, are already EventGenerator. I think they don't use this feature. Waiting for their confirmation.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Todo: in avanti the update_events action appears on Person but not on Client. Seems that RecurrenceSet yearly is buggy, i plan to write test cases.
  • 2 ans, 11 mois ago by Luc Saffre about #3148 (Birthday calendar) : Who should be the "responsible user" for the generated birthday events? Ideally nobody, i.e. Lino should support calendar entries with an empty user field.