Hi everyone,

I'm getting the same error exactly while running the schemamigration 
command:

TypeError: 'NoneType' object has no attribute '__getitem__'


In my case the model is cartridge.shop.models.Product but the situation is 
really really close:

EXTRA_MODEL_FIELDS = (
    # Four-item sequence for one field injected.
    (
        # Dotted path to field.
        "cartridge.shop.models.Product.tags",
        # Dotted path to field class.
        "ManyToManyField",
        # Positional args for field class.
        ('theme.Tag', ),
        # Keyword args for field class.
        {"related_name": "products", "blank": True, "null": True},
    ),
)

And the theme.Tag model is:

class Tag(models.Model):
    """
    """
    nome = models.CharField(_("Nome"), blank=True, max_length=100)


Has anyone found the problem or what's wrong with this setup?

Thank you,
Maurizio


Il giorno venerdì 1 agosto 2014 16:59:19 UTC+2, Ryan Sadwick ha scritto:
>
> Make sure you run a south schemamigration on the blog app itself:
>
> Something like:
> manage.py schemamigration blog --auto
>
>
>
>
>
> On Tuesday, July 29, 2014 10:14:18 AM UTC-4, Beau Severson wrote:
>>
>> I was also wondering the answer to this. I'm trying to add a new M2M 
>> field to the BlogPost model and I keep getting the exact same error. Is 
>> this a bug for mezzanine using south? My EXTRA_MODEL_FIELDS contains the 
>> following:
>>
>>     (
>>         "mezzanine.blog.models.BlogPost.industry",
>>         "ManyToManyField",  # type of field to add
>>         ("users.Industry",),
>>         {"blank": True, "null": True},
>>     ),
>>
>> Everytime I attempt the migration though I get the same error you are 
>> seeing.
>>
>> On Friday, January 11, 2013 8:40:05 AM UTC-6, Sam wrote:
>>>
>>>
>>> Hello,
>>>
>>> In the admin interface i would like it to be possible to select multiple 
>>> genres for blogposts. These genres are from a different model so I used the 
>>> technique described in the manual.
>>>
>>> I try to add a custom ManyToManyField to the blog app using the 
>>> following syntax in my settings.py:
>>>
>>> (
>>>     "mezzanine.blog.models.BlogPost.genre",
>>>     "ManyToManyField",
>>>     ('blog_custom.Genre',),
>>>     {"null":True, "blank": True,},
>>> ),
>>>
>>> I started a custom app called blog_custom where I'd like to store the 
>>> migrations. I have defined my Genre model as follows:
>>>
>>> class Genre(models.Model):
>>>   name = models.CharField(max_length=300)
>>>
>>> Given the fact that I use South in this project, I have to perform a 
>>> migration at which point I get the following error:
>>> TypeError: 'NoneType' object has no attribute '__getitem__'
>>>
>>> After some investigation I found out that this issue might actually be 
>>> related to South, or related to the way the arguments are passed on from 
>>> mezzanine to South. If I, for example, create the intermediare table that 
>>> should have been created with the migration manually, and run the migration 
>>> after this fact, it does complete since south does not have to create it. 
>>> The problem with this approach is that Django will not use this 
>>> intermediary model in the admin interface, which is what I need.
>>>
>>> Any thoughts?
>>>
>>> Thanks
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to