20090510

  • (Many undocumented changes during the last weeks.)

  • Instantiator now supports many-to-many fields. Content of a many-to-many field can now be specified as a string containing a space-separated list of primary keys. Or, if you want to use another field than the primary key for specifying related objects, m2m_field:lookup_field syntax. Examples for both usages are in src/lino/django/songs/fixtures/demo.dpy.

20090511

Common models

Language and :class`Country` are a first example of models being used by several applications. They are now defined in lino.django.utils.

The order of applications in INSTALLED_APPS becomes important: lino_setup() is called in that order.

This way of doing has unresolved issues:
  • cannot make a common class become abstract

  • cannot remove a menu item or change order of menu items

20090513

  • Added Collection and Places to songs.models. Added sample data in songs/fixtures/demo.dpy.

  • Instantiator now supports a lookup_field for ForeignKey.

20090514

20090519

  • preparing for field-specific default width in Layouts

  • Row.field_as_readonly() now sets style="width:100%" when Element.width`is `None.

  • removed null=True from string fields after reading https://docs.djangoproject.com/en/5.0/ref/models/fields/#null

  • New GRID_CELL to render more than one field in a single grid cell.

  • Started igen.models.MakeInvoicesDialog. A Dialog is an enhanced django.forms.Form that can be installed as a menu action. In Module render: started to split new class ElementServer out of Row because Dialog will need only the ElementServer part of Row.

20090520

20090521

  • Merged Contract into Order. A contract is just a cyclic Order.

  • Worked on Order.make_invoice(). make_invoice() will have to know when the next billing will occur. And whether a service must be paid for before or afterwards the period. For the moment we simplify by saying that the billing happens once per month.

  • The old question again: which documentation system to use? Doxygen and breathe? After playing around I continue to believe that documentation must be maintained outside of the source code.

  • Pro-rata : the covered period in a generated invoice may be longer or shorter than normal in certain cases.

    For example assume that invoices are sent only once a month, for example on the first working day of each month. What should we do if a monthly service order starts at the 28th of a month? Or at the 5th of the month? Order should get a new field, called maybe “Pro-rata”. Definition of “Pro-rata”: see http://en.wikipedia.org/wiki/Pro-rata. For the moment we simplify by saying that the covered period never adapts automatically to the billing cycle.

20090522

  • The new class attributes reports.Report.filter and reports.Report.exclude refer to the corresponding Django methods to limit a queryset.

  • Issue edit a report’s grid view fails

  • Report extensively uses sime class attribut overriding in subclasses. That’s what I want, but it has one disadvantage: typo’s are not detected. Report.__init__() now tries to detect them. This can be switched off by setting Report.typo_check to False.

  • New module lino.django.utils.perms with some shortcuts perms.is_staff(), perms.is_authenticated() and perms.never(). Trying this on Invoices.can_view = is_staff, Orders.can_view = is_authenticated and InvoicesToSend.can_add = never.

20090523

  • Why did I try to write my own permissions system? because I don’t like the system suggested by django.contrib.auth. “but it’s not currently possible to say “Mary may change news stories, but only the ones she created herself” or “Mary may only change news stories that have a certain status, publication date or ID.” The latter functionality is something Django developers are currently discussing.” (https://docs.djangoproject.com/en/5.0/topics/auth/#permissions)

    Some trace of the discussion is here: Django ticket #3011

    My conclusion: don’t insist for the moment on permissions and user management. Make my perms module minimal but usable and use it temporarily until Django has a good solution.

20090524

20090525

  • worked on ticket http://code.active.ee:3000/issues/show/337 - added DocItem.discount - added an example in demo

  • new DecimalConverter in Instantiator. DecimalFields were stored as strings in the database. And Django didn’t complain (maybe simply because I use the sqlite backend which allows such things).

  • Committed revision 683.

20090526

  • bug in demo.dpy

  • DocItem.before_save() now always sets DocItem.total (except when unitPrice or qty is None). DocItem.total_incl() no longer necessary.

  • Committed revision 684.

  • PaymentPerm.months and PaymentTerm.days. It’s not yet clear how igen should decide which type of invoice to generate (normal or proforma).