callowayproject/django-viewpoint — pull request #9 by finkedave (2012-09-14 14:32:09+00:00)
Title: Many authors and making published date/time editable

I made two changes that try to make viewpoint more like django-stories. First off I made an authors field that is many to many. The migrations take the current author on an entry and populate the many to many table before removing the author field. To keep this backwards compatible for others I added a author a property that just returns the first author, so it won't break anything if one tries to display just author. Also I added a tag for displaying many authors that we currently use for django-stories.
Note, in the admin one thing had to change that has effects. Since more then one author can be added to an entry, and currently a non-super user can only see themselves to add as author. i removed that restriction so a non-super user can add anyone as an author. I wrote but commented out method formfield_for_manytomany. If this method is uncommented out, it will bring back authors acting just like it used to. But I think now we have many authors they should be allowed to add other authors.

The second change i made was to make pub_date and pub_time editable via the admin. By removing the auto_now_add and giving them just a default. Then adding these fields to the admin entry advanced tab. update_date also had two things going on, it had both a auto_now and it was being set in save method, So I just removed the auto_now so I could show it as read only in the admin screen.