PicturePlugin longdesc cannot be null? #1170

Closed
kezabelle opened this Issue Feb 13, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@kezabelle
Contributor

kezabelle commented Feb 13, 2012

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

This comment has been minimized.

Show comment Hide comment
@kezabelle

kezabelle Feb 18, 2012

Contributor

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.

Contributor

kezabelle commented Feb 18, 2012

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

This comment has been minimized.

Show comment Hide comment
@yakky

yakky Jul 11, 2013

Contributor

Migrations fixed in #2037 / #2038

Contributor

yakky commented Jul 11, 2013

Migrations fixed in #2037 / #2038

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Feb 7, 2014

Contributor

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

Contributor

digi604 commented Feb 7, 2014

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

@digi604 digi604 closed this Feb 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment