AttributeError: 'NoneType' object has no attribute 'upper' using South with Displayable

524 views
Skip to first unread message

rick

unread,
Feb 6, 2012, 9:12:09 PM2/6/12
to Mezzanine Users
hey guys,
i'm wondering what might be causing this error with a south migration.
i'm trying to subclass Displayable and i guess it has a KeywordsField
that's causing a problem with the migration.

AttributeError: 'NoneType' object has no attribute 'upper'

Here's the longer version of the error:

http://pastebin.com/D7EzEcnx

It looks like it's trying to call upper() on
mezzanine.generic.fields.KeywordsField ??

Here's the line from the migration that's causing the problem as well
as the class in models.py

http://pastebin.com/hv2UfjMv

any thoughts? thanks!

Stephen McDonald

unread,
Feb 7, 2012, 4:08:32 PM2/7/12
to mezzani...@googlegroups.com
I wasn't able to replicate this. The steps I took:

- create a new app with the startapp command
- add it to INSTALLED_APPS
- add the model code below to app.models
- run migrations

from django.db import models
from mezzanine.core.models import Displayable

class Blah(Displayable):
    name = models.CharField(max_length=200)

This all worked fine. I did come across some non-critical issues that could be related but probably aren't:


Try the lastet with the above commits and see how you go.
--
Stephen McDonald
http://jupo.org

James Cooke

unread,
Apr 18, 2012, 11:05:53 AM4/18/12
to mezzani...@googlegroups.com
Hi Stephen, hi Rick,

Thanks for this info... I'm a new Mezzanine and Django user - so please forgive me if I make some basic errors...

I've been able to replicate Rick's error, however, I get a failed call to lower() whereas Rick had upper(). This is the final error: 

AttributeError: 'NoneType' object has no attribute 'lower'

Stephen, I've run through the steps you listed on a clean MySQL (5.1.61) db.

- create a new app with the startapp command - yes.
- add it to INSTALLED_APPS - yes.
- add the model code below to app.models - yes, removed all our old models, cleaned out the South migration folder and just used your Blah model extending Displayable.
- run migrations - yes, ends in the error.

from django.db import models
from mezzanine.core.models import Displayable

class Blah(Displayable):
    name = models.CharField(max_length=200)

The full error dump is in this gist : https://gist.github.com/2414151 - our deps.txt file from a `pip freeze` is in there too.

Does anyone have any experience of this error or any suggested work arounds? Rick were you able to find a solution for your instance?

Cheers,

James




On Tuesday, 7 February 2012 21:08:32 UTC, Stephen McDonald wrote:
I wasn't able to replicate this. The steps I took:

- create a new app with the startapp command
- add it to INSTALLED_APPS
- add the model code below to app.models
- run migrations

from django.db import models
from mezzanine.core.models import Displayable

class Blah(Displayable):
    name = models.CharField(max_length=200)

This all worked fine. I did come across some non-critical issues that could be related but probably aren't:


Try the lastet with the above commits and see how you go.

Stephen McDonald

unread,
Apr 20, 2012, 11:56:00 AM4/20/12
to mezzani...@googlegroups.com
Might be worth posting to the south list as well since the error seems to be coming from it.

In the mean time I guess you could remove your migration, sync the db with Django and then add the migration and fake the run of it.

James Cooke

unread,
May 4, 2012, 3:51:54 PM5/4/12
to mezzani...@googlegroups.com
Hi Stephen,

Sorry for the delay - only just seen this message. I'll check out the error again, post to south as required.

My colleague found a work around which I'm not sure of the details of, but I'll find out.

Cheers,

James
Reply all
Reply to author
Forward
0 new messages