Hi,

I want to know if its possible to convert a string object into class
object.
Basically Im trying to make some generic methods for changing the data
in the models

For your convinience, Im providing you the link to the code where Im
facing the problem

http://dpaste.com/117323/

at line no 40, if you notice, I m trying to add "Form" to the
model_name for creating an instance of the class CompanyForm, here is
my problem, as a result of the addition it becomes string object and
hence im getting the error 'str' object is not callable'

How can I overcome this problem ??

-Saurav

On Feb 6, 9:51 am, Saurav <[email protected]> wrote:
> Thanks Bruno for the tip.
>
> On Feb 5, 2:15 pm, bruno desthuilliers <[email protected]>
> wrote:
>
> > On 5 fév, 09:20, Saurav <[email protected]> wrote:
>
> > > Is there any way to retrieve all the model names in an app ??
>
> > from django.core.db.loading import get_models
> > import myapp
> > for model in get_models(myapp.models):
> >    print model.__name__
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to