20090510 -------- - (Many undocumented changes during the last weeks.) - :class:`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 :srcref:`src/lino/django/songs/fixtures/demo.dpy`. 20090511 -------- - :mod:`mysites.demo.makedemo` now finds the list of installed apps automatically. So I no longer need to change :xfile:`makedemo.py` after changing :setting:`INSTALLED_APPS`. - Worked on website pages :lino:`/django/index` and :lino:`/about/index`. - :meth:`Row.field_as_readonly` now supports when a value is a :class:`Manager` (which is the case when you specify a ManyToManyField). - Classes :class`Singer` and :class`Author` are now subclasses of :class`Person`. - Started `Common models`_ - updated my copy of Django from 10618 to 10736 Common models ------------- :class:`Language` and :class`Country` are a first example of models being used by several applications. They are now defined in :mod:`lino.django.utils`. The order of applications in :setting:`INSTALLED_APPS` becomes important: :func:`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 -------- - Worked on :srcref:`/lino/modlib/igen/fixtures/demo.dpy`. - Added :class:`igen.models.Contract`. - I noticed that Django's DateField does no validation and no conversion from string to date. :class:`lino.utils.instantiator.DateConverter` How to parse a datetime.date from a string? The standard Python module has now support at all, even not to parse a simple iso-formatted date. `PEP 321 `_ was exactly what I'd need now, but it has been withdrawn... I also read http://mail.python.org/pipermail/python-dev/2004-April/044181.html and http://mail.python.org/pipermail/python-list/2003-November/236842.html Conclusion: I started by writing a parse_date() myself, then I understood that I also need other things from python-dateutil, so I threw it away and added dateutils to :meth:`lino.django.utils.sites.LinoSite.tanks_to`. 20090519 -------- - preparing for field-specific default width in Layouts - :meth:`Row.field_as_readonly` now sets ``style="width:100%"`` when :attr:`Element.width`is `None`. - removed `null=True` from string fields after reading https://docs.djangoproject.com/en/5.0/ref/models/fields/#null - New :class:`GRID_CELL` to render more than one field in a single grid cell. - Started :class:`igen.models.MakeInvoicesDialog`. A Dialog is an enhanced django.forms.Form that can be installed as a menu action. In Module :mod:`render`: started to split new class ElementServer out of Row because Dialog will need only the ElementServer part of Row. 20090520 -------- - Good news: `Active Systems `_ is probably going to participate in the development of igen. We started an issues tracker on their server at http://code.active.ee:3000/projects/lino/issues We also wrote some Wiki pages: https://code.active.ee/wiki/doku.php?id=igen:igen 20090521 -------- - Merged :class:`Contract` into :class:`Order`. A contract is just a cyclic Order. - Worked on :meth:`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? :class:`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 :attr:`reports.Report.filter` and :attr:`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. :meth:`Report.__init__` now tries to detect them. This can be switched off by setting :attr:`Report.typo_check` to False. - New module :mod:`lino.django.utils.perms` with some shortcuts :func:`perms.is_staff`, :func:`perms.is_authenticated` and :func:`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 :mod:`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: :djangoticket:`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 -------- - continued on :mod:`lino.django.utils.perms`. Now it works. (Updated http://code.active.ee:3000/issues/show/338) - fixed a bug in http://127.0.0.1:8000/voc/tree - Committed revision 681. 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 - :meth:`DocItem.before_save` now always sets :attr:`DocItem.total` (except when unitPrice or qty is None). :meth:`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).