Re: Importing classes without project name, possible?

2006-05-28 Thread jeremy bornstein
t your classes without referring to the project > name. > > Example: > from mysite.myapp.models import myclass > > Correct me if I'm wrong, but if I were to copy the app to another > project I'd have to edit each file that refers to it and change > "mysite"

Importing classes without project name, possible?

2006-05-28 Thread [EMAIL PROTECTED]
Is there a way to import your classes without referring to the project name. Example: from mysite.myapp.models import myclass Correct me if I'm wrong, but if I were to copy the app to another project I'd have to edit each file that refers to it and change "mysite" to the name of the n

Re: Importing external modules/classes

2006-04-14 Thread DavidA
Hi Cary, What I did to avoid all the PYTHONPATH stuff was to just 'install' my python library using distutils. I set up a trivial setup.py script and then I just run 'python setup.py install' for my library whenever I make changes. from distutils.core import setup setup(name='pf',

Re: Importing external modules/classes

2006-04-13 Thread arthur debert
Hi Cary. that depends if you're using magic-removal or trunk. On the m-r branch there are no "magic" modules, whatever is on your path can be imported as usual. if you're using trunk, you must import inside your models methods, or user module_constants (

Re: Importing external modules/classes

2006-04-13 Thread Joseph Kocherhans
On 4/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I've developed a library of code in python that I reuse across multiple > projects, and I wanted to be able to use some of these classes/modules > with Django but I've had some problems. I have defined the PYTHONP

Importing external modules/classes

2006-04-13 Thread [EMAIL PROTECTED]
some of these classes/modules with Django but I've had some problems. I have defined the PYTHONPATH env variable (in my .bash_profile on OS X and Linux), but Django doesn't seem to recognize/acknowledge it as far as I can tell. What do I need to do to be able to import my own classes not located under

Re: Problem adding new classes to a model

2005-12-30 Thread Tom Tobin
On 12/30/05, aaloy <[EMAIL PROTECTED]> wrote: > OK. That should be the problem! > It would be nice to have an option to generate these inserts also.. There is. :-) django-admin.py sqlall model_module_goes_here or just django-admin.py sqlinitialdata model_module_goes_here If you don't need

Re: Problem adding new classes to a model

2005-12-30 Thread aaloy
2005/12/30, Adrian Holovaty : > > On 12/30/05, aaloy wrote: > > The new table appears on the admin interface, and I have introduced > > data manually on it I can see it, but when I try to modify o add a new > > record I get the exception: > > > >

Re: Problem adding new classes to a model

2005-12-30 Thread Adrian Holovaty
On 12/30/05, aaloy <[EMAIL PROTECTED]> wrote: > The new table appears on the admin interface, and I have introduced > data manually on it I can see it, but when I try to modify o add a new > record I get the exception: > > Exception Type: ContentTypeDoesNotExist > Exception Value:

Problem adding new classes to a model

2005-12-30 Thread aaloy
Hello! I have a problem when I try to add new classes to a model. The steps I follow are: * I create the new classes * I use the administrative tool to generate the sql * I create the new tables from the generated sql. * I refresh the Django web admin The new table appears on the admin

Re: Middleware Old-Style Classes

2005-10-24 Thread Carlo C8E Miron
2005/10/24, Carlo C8E Miron <[EMAIL PROTECTED]>: > A quick investigation > > 5)15:05:20 [EMAIL PROTECTED]:~/src/django/svn/django/trunk/django > 0$ grep -R "class[^(]*:" $(find . -name "*.py")|grep -v \.svn|wc -l > 100 > > seems to reveal tha

Re: Middleware Old-Style Classes

2005-10-24 Thread Carlo C8E Miron
2005/10/17, Adrian Holovaty <[EMAIL PROTECTED]>: > > On 10/17/05, Shaleh <[EMAIL PROTECTED]> wrote: > > Why is that? Moving forward the Python people expect all classes to be > > defined as "new-style". Support for old-style is there simply to allow > &g

Re: Middleware Old-Style Classes

2005-10-17 Thread Adrian Holovaty
On 10/17/05, Shaleh <[EMAIL PROTECTED]> wrote: > Why is that? Moving forward the Python people expect all classes to be > defined as "new-style". Support for old-style is there simply to allow > for backwards compatibility. Because we haven't taken the time to s

Re: Middleware Old-Style Classes

2005-10-17 Thread Shaleh
Why is that? Moving forward the Python people expect all classes to be defined as "new-style". Support for old-style is there simply to allow for backwards compatibility.

Middleware Old-Style Classes

2005-10-13 Thread Andreas Stuhlmüller
Is there a reason for the middleware being old-style classes? If middleware was defined as Middleware(object) we could extend it like this without modifying Django's source: class MyCacheMiddleware(CacheMiddleware): def process_request(self, request): if check_request(request

<    1   2   3   4