import twice when run test

2009-11-25 Thread fallhunter
i have this code in my tests.py: from models import * and in the models.py I have a signal handler and register it with post_save.connect( post_save_note, sender=Note ) and when i run test with ./manage.py test main I found the signal handler was registered twice and executed twice, and I

how to get a model's field var the field's name in a string?

2009-01-15 Thread fallhunter
i mean i have a model m, and m has a field fd. so i can wrote like xx = m.fd m.fd = xxx but, when i got a string s = "fd" how could i do the same as above? i've tried m.__dict__[s], but it seems read only thanks for any help... --~--~-~--~~~---~--~~ You