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"
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
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',
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 (
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
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
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
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:
> >
> >
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:
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
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
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
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
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.
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
301 - 315 of 315 matches
Mail list logo