I've got the following simple subclass of some of the base Django
fields:
# File is eve.lib.null_fields
class Key(models.ForeignKey):
def __init__(self, *args, **kwargs):
kwargs['null'] = True
kwargs['blank'] = True
return super(Key, self).__init__(*args, **kwargs)
And I added the following to my main urls.py:
from south.modelsinspector import add_introspection_rules
add_introspection_rules(rules=[], patterns=["^eve\.lib\.null_fields"])
But yet I still get the error about not being able to import it.
What am I missing?
Oh, and please add a note to the wiki page suggesting that you add
this block to urls.py, as it took me a while to figure that out. The
docs arn't very user-centric.
Ash wrote:
> OK, yeah, I read the wiki page on extending the introspection and
> still wasn't able to get it to work.
>
> I've got the following simple subclass of some of the base Django
> fields:
>
> # File is eve.lib.null_fields
> class Key(models.ForeignKey):
> def __init__(self, *args, **kwargs):
> kwargs['null'] = True
> kwargs['blank'] = True
> return super(Key, self).__init__(*args, **kwargs)
>
> And I added the following to my main urls.py:
>
> from south.modelsinspector import add_introspection_rules
> add_introspection_rules(rules=[], patterns=["^eve\.lib\.null_fields"])
>
> But yet I still get the error about not being able to import it.
Did you recreate the migration file? Is the import statement at the top?
> Oh, and please add a note to the wiki page suggesting that you add
> this block to urls.py, as it took me a while to figure that out. The
> docs arn't very user-centric.
Yes, I think the documentation could be improved. Here are some things
that could be added:
- Simple example how to add a field that just subclasses from a django field.
- Where should the add_introspection_rules() call happen?
It would be better if the Exception would happen during creation of the migration
file, and not during executing it.
Thomas
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Andrew
> --
>
> You received this message because you are subscribed to the Google Groups
> "South Users" group. To post to this group, send email to
> south...@googlegroups.com. To unsubscribe from this group, send email
> to south-users...@googlegroups.com. For more options, visit this
> group at http://groups.google.com/group/south-users?hl=en.
>
I was able to run the migrate_to_south command for the app involved,
but this error is stopping me from making my migration.
I'm running: './migrate.py startmigration user skill_queue --auto',
and that's when it fails. So I don't have a migration file to
recreate. I think... (Nothing in user actually uses the null_field
fields, but they have ForeignKey relations to a different app that
isn't under South's control that does call null_fields.) It would also
be nice if South didn't demand to be able to import field types that
are not actually used in the app it's managing migrations for.
Andrew