django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.78k stars 581 forks source link

0.9.8 pypi release #458

Closed stefanfoulis closed 10 years ago

stefanfoulis commented 10 years ago

@yakky are there any important fixes that need to be merged for before I make a release?

yakky commented 10 years ago

No showstopper that I know of.

rscottco commented 10 years ago

Am I too late for the party? I have what for me has been a show stopper, and a partial fix. Well, one for the downstream fallout that is also a problem.

With 1.71 stable, the latest versions of mptt, polymorphic, et al, I was getting a KeyError while migrating:

.../filer/fields/multistorage_file.py", line 104, in __init__
    kwargs.pop("to")
KeyError: 'to'

There are similar code blocks in both _multistoragefile.py and file.py within .../file/fields/

They both have similar problems.

file/fields/file.py

    if "to" in kwargs.keys():
        kwargs.pop("to")
        warnings.warn("FilerImageField can only be a ForeignKey to a Image;"
                      "%s passed" % kwargs['to'], SyntaxWarning)

_file/fields/multistoragefile.py

    if 'upload_to' in kwargs:
        kwargs.pop("to")
        warnings.warn("MultiStorageFileField can handle only File objects;"
                      "%s passed" % kwargs['to'], SyntaxWarning)

Problems are thrice, two is too few and four is too many.

A fourth item is not a problem, but a mere flesh wount, errr, matter of style. Not only is it a non-issue, it would ruin my attempt at wit. After all, there are fewer opportunities to mangle tales from "The Grail" these days. It is the use of "has_key" VS "in".

file/fields/file.py

    if kwargs.has_key('to'):
        warnings.warn("FilerImageField can only be a ForeignKey to a Image;"
                      "%s passed" % kwargs.pop('to'), SyntaxWarning)

_file/fields/multistoragefile.py

    if kwargs.has_key('upload_to'):
        warnings.warn("MultiStorageFileField can handle only File objects;"
                      "%s passed" % kwargs.pop('upload_to'), SyntaxWarning)

Sadly, while this does alleviate the key error, etc., I fear the real offending issue may be further upstream.

    WARNING multistorage_file 
    .../filer/fields/multistorage_file.py:
    SyntaxWarning: MultiStorageFileField can handle only File objects;
    <function generate_filename_multistorage at 0x1cfc3b0> passed
      "%s passed" % popped_value, SyntaxWarning)
    .../filer/fields/multistorage_file.py", line 104, in __init__
        kwargs.pop("to")

I have not had a chance to test further as I have not finished installing this instance of Django. Wanted to fire this off ASAP in case you've not finalized your next release... that is if this is helpful.

Cheers

PS. Hopefully this formats okay, having trouble with my browser and git at the moment.

SalahAdDin commented 10 years ago

Use sorl.thumbnail please :D

yakky commented 10 years ago

Current implementation of filer is made to work with easy-thumbnails, image library indipendent code is currently not a priority, but any PR in this sense is welcome

rscottco commented 10 years ago

Seems to work fine, now that I've both upgraded to the latest version and installed 'unidecode' (not listed as a dependency, btw.). Feel free to close this at your discretion.

Thank you, by the way, to the entire group involved with this app, and those that support it.

stefanfoulis commented 10 years ago

thanks! unidecode has been added to the dependencies.

SalahAdDin commented 10 years ago

sorl?