Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

PicturePlugin longdesc cannot be null? #1170

Closed
kezabelle opened this Issue · 3 comments

3 participants

@kezabelle

As of many years ago, when longdesc was added to the Picture model, it set null=True, which despite being frowned upon for CharFields (because then you have to search for '' and NULL), could be useful, in the following kind of case:

class MyForm(forms.ModelForm):
    class Meta:
        model = Picture
        exclude =['longdesc', 'float']
...
plugin_pool.register_plugin(WhichUsesMyForm)

This doesn't appear to work (At least on my local setup, using ... MySQL), as longdesc is marked as NOT NULL. I know Picture is the poor child no-one wants to love, or keep, particularly, but the migration should probably reflect the actual state of the plugin.

@kezabelle

As of right now, I can't actually confirm that doing manage.py schemamigration --auto picture would yield a new migration to fix it, because it causes South to error:

File "/path/to/south/creator/actions.py", line 59, in triple_to_def
    ", ".join(triple[1] + ["%s=%s" % (kwd, val) for kwd, val in triple[2].items()]), # args and kwds
AttributeError: 'str' object has no attribute 'items'

This seems to be because of line 113 of (at the least) the last migration, which added longdesc - it notably doesn't conform to the same syntax as line 104, which causes triple to be a string instead of a dict:

(Pdb) a
cls = <class 'south.creator.actions.DeleteModel'>
triple = models.OneToOneField(to=orm['cms.CMSPluginPublic'], unique=True, primary_key=True)

As I have no idea what CMSPluginPublic is (I've never even seen the class, and have no idea if it's still relevant), I'm hesitant to attempt to fix it (and thus see if this ticket even has merit) without someone more knowledgable wading in to confirm this.

@yakky
Collaborator

Migrations fixed in #2037 / #2038

@digi604
Collaborator

closed... as picture plugin has been removed from core as well

@digi604 digi604 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.