Re: converting strings to model names dynamically.

2010-03-05 Thread Atamert Ölçgen
On Friday 05 March 2010 11:10:29 Omer Barlas wrote: > How can I use a unicode string as a model instance? You can't. However you can get a reference to your model class like this: > from django.db.models.loading import get_model > model_class = get_model('myapp', 'mymodel') > instance = model_clas

Re: converting strings to model names dynamically.

2010-03-05 Thread Alessandro Pasotti
2010/3/5 Omer Barlas > I have an ajax form which updates the status field of a table's status > column dynamically. I send the table name, and the Id to be replaced to the > ajax processor, but when I try to call > > what = model_name.objects.get(Id=id_number) > > django barks at me like this; >