[Moin-user] Attachment comments

Thomas Waldmann tw-public at gmx.de
Thu Sep 21 10:12:02 EDT 2006


> I need to be able to specify a comment when uploading an attachment
> (twiki does this).  I also need a better table of attachments, like
> this:
>
> +------------+---------------+---------------------+----------------+
> | Filename   |  Date         | Uploader            | Comment        |
> +------------+---------------+---------------------+----------------+
> | tower.jpg  | 2006-09-19    | AntonisChristofides | Useless file   |
> | small.jpg  | 2006-09-20    | HeatherStern        | Useful file    |
> +------------+---------------+---------------------+----------------+
>
> (But I think the table is easy if the comment is present.)
>
>  * Is anything like this being developed?
Yes and No. :)

No, because attachments as they are currently handled are deprecated, 
they will be replaced by "mimetype items" as soon as we have a storage 
backend api and done some internal changes. This will not happen in 1.5 
and not in 1.6, but possibly in 1.7. Because of this, we don't do major 
changes to the old code or introduce major new features, because this 
would be just wasted time in the end and maybe even make migration to 
the new stuff harder.

Yes, because those "mimetype items" will solve quite some stuff by 
treating wiki pages and file "attachments" the same way:
 * all will be revisioned (wiki pages and also files)
 * all will have edit / upload comments
 * all will have history / logs

Until this is done (don't hold your breath, this can take a while), you 
maybe can just comment your files on the wiki page and have a backup in 
case someone deletes a file.


If you need "edit comments" fast, feel free to contribute some code to 
1.6 (such stuff won't go into 1.5).

You have to hack or look at those files:
action/AttachFile.py
logfile/editlog.py
macro/RecentChanges.py
action/info.py (maybe)

The change should be done like this:
Read MoinMoin:CodingStyle, install Mercurial DVCS.
Add some comment field to upload form (AttachFile.py).
Clean input in the same way you see for DeletePage or RenamePage comment.
If someone enters a comment, use it for the editlog comment field.
If not, synthesize some comment (move code from RecentChanges.py 
format_comment) and store that.
Check for potential side effects of what you have done. :)

(Later maybe also add similar stuff to delete attachment action.)

If you give us a clean, tested and minimal patch doing this, I guess we 
could evaluate it for 1.6 inclusion.





More information about the Moin-user mailing list