Thank.  Works perfect on first try!

I moved all class models to models.py and placed "from models import
*" into each of the other .py files.


On Thu, Dec 11, 2008 at 7:38 PM, djidjadji <djidja...@gmail.com> wrote:
>
> For point 1)
>
> Place the model class definitions in 1 or more separate .py files
> You can put more then 1 model class in a .py file when you use the
> multiple file approach
>
> eq. models.py       # all model classes in one file
>
> or   user.py
>      forum.py
>      comment.py
>
> And use import statements like
>
> from models import *
>
> or
>
> from user import *
> from comment import *
>
> in the model files that need other model definitions and in the .py
> files that handle the requests (the ones named in the app.yaml file)
>
> Some people use
>
> import models
>
> and they have to use
>
> customer = models.User(......)
>
> instead of
>
> customer = User(......)
>
> At Python interpreter level it must have a different result, but I
> have no problem using the "from import *" method
>
> For point 2). I use this method and have not encountered the mentioned error.
>
> 2008/12/11 Neo42 <matrixne...@gmail.com>:
>>
>> If I am using multiple .py files in my project (each requiring
>> different levels of authentication, login: required, login: admin, and
>> the other is for anonymous access), how should I handle my datastore
>> class definitions?
>>
>> I have 2 issues:
>>
>> 1) I am afraid of forgetting to update the class definition in
>> file1.py when I update file2.py 's class definition.  Is there a way
>> to ease my concern?  Perhaps using imports?  How do I do this?
>>
>> 2) At least on my local server, when I access the the datastore
>> through file1.py, it breaks's file2.py's access to the datastore until
>> I stop and start the local server again.  If I fix issue 1, will it
>> fix issue 2?
>>
>> Thanks,
>> -Neo
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply via email to