Re: Schema Evolution code

2006-12-14 Thread Steve Hutton

On 2006-12-14, Victor Ng <[EMAIL PROTECTED]> wrote:
>
> The patch I previous sent in mostly adds a couple functions to the
> psycopg2 backend in the introspection module.  The only big changes
> that affect the mainline django code are in django.core.management.
>
> I'm using my patches, so that's been tested through 3 schema updates
> in production.  As previously mentioned -there are those 2 remaining
> bugs in the schema-evo code, but they're not show stoppers for me.
>
> I see no reason why people need to use the latest trunk to test beta
> quality features.  That just makes no sense - if you need beta
> features - use a branch, or apply my patch to your own copy of trunk.
> Is there a problem that I'm not seeing?  I'm quite sure that all the
> code that my patch modifies hasn't been touched in over a month, so it
> should apply cleanly to trunk.

Victor, thanks very much for your efforts on this.  I will be starting
a new project soon and would like to test schema evolution.

Can you explain the differences between your patch and the schema
evolution branch itself?  Are you proposing that your changes be rolled
be rolled into the schema evolution branch?

Steve


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



strange admin interface issues runserver vs. apache

2006-12-14 Thread miked

Hi All -- Sorry if this is a newbie faux pas. I am having an issue with
viewing the adding admin interfaces I created for a number of my
models. Everything appears fine when accessing the admin site using the
development server, but when I try to view my changes running through
Apache, none of the model interfaces show up on the admin home page.
(Yes, I've tried restarting Apache)

Regards

Mike


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: My second web site that use django, http://beyking.51boo.com

2006-12-14 Thread Igor Guerrero
Very cool,

Just something apparently the rich editor FCK, dont have some languages, It
can be fix by copying the en.js to es.js(for Spanish).

It's Amazing how small are Django application!!!

On 12/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> This is a weblog application, source code is open
>
>
> >
>


-- 
:::lxuser 391715:::
http://igordevlog.blogspot.com/


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---


extracting field information from models

2006-12-14 Thread Milan Andric

Hello,

I would like to loop through the fields in my model and print the names
(verbose_name) and value of the fields.  I've been hacking at it for
sometime but can't figure it out.  I had some help from Magus on IRC
but still can't find solution.
See: http://simon.bofh.ms/logger/django/2006/12/13/19/57/

Q: Why not just type it out in the template, so you actually get a
decent display?
A: I'm lazy, and the old problem of "there's lots of fields", like 60
or so.

Here's what I'm trying in my view.  I want a rudimentary display of an
Application, the object is app.  In the template I would just loop over
app_fields.

app_fields = []
for f in app._meta.fields:
app_fields.append(
{
 'label':f.verbose_name,
 'value':f.__getattribute__(f._meta.fields[0].attname)
}
)
app_fields.append(
{
 'label':f.verbose_name,
 'value':f.__getattribute__(f.id)
}
)

return render_to_response( 'workshops/application_detail.html',
{
'app': app,
'app_fields': app_fields,
}, context_instance=RequestContext(request),
)


I keep running into problems with special fields like AutoField,
ForeignKey and BooleanField.
Like:
'BooleanField' object has no attribute 'id'  or
'BooleanField' object has no attribute '_meta'.

If you have comments or advice, much appreciated.

--
Milan


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



My second web site that use django, http://beyking.51boo.com

2006-12-14 Thread [EMAIL PROTECTED]

This is a weblog application, source code is open


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Estimate memory/cpu of django?

2006-12-14 Thread mamcxyz

Exist any info about estimates values for memory and cpu for django?


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Using django's test facility

2006-12-14 Thread ginstrom

I am having trouble using django's test facility.

I have written a unit test (copied from the example on the website):

# Issue a GET request
response = self.client.get('/archive/')

# Check that the respose is 200 OK
self.failUnlessEqual(response.status_code, 200)

This test fails with a status code 404
The full code is below my sig.

However, this page does render for me, and when I perform the same
command from the shell, the response code is 200 as expected.

>>> from django.test.client import Client
>>> client = Client()
>>> response = client.get('/archive/')
>>> response.status_code
200
>>>

What am I doing wrong?

Thanks,
Ryan Ginstrom

"""Unit tests for archive unit"""

import unittest
from django.test.client import Client

class ArchiveTest(unittest.TestCase):
def setUp(self):
# Every test needs a client
self.client = Client()
def test_index(self):
# Issue a GET request
response = self.client.get('/archive/')

# Check that the respose is 200 OK
self.failUnlessEqual(response.status_code, 200)


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sqlite3 and Python 2.5

2006-12-14 Thread Jeremy Dunck

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
> So 'DATABASE_NAME' should be the full name of a non-existant file. I
> had thought they wanted the path to where the file was located.
>
> !!Works fine now!!
>
> Two problems for Django with Python 2.5

FYI, the 0.95 tarball on the site is pretty out-dated.  It was made
from svn revision 3491, while trunk is now at 4203.

The relavent code is already on trunk in django.db.backends.sqlite3:

try:
try:
from sqlite3 import dbapi2 as Database
except ImportError:
from pysqlite2 import dbapi2 as Database
except ImportError, e:
import sys
from django.core.exceptions import ImproperlyConfigured
if sys.version_info < (2, 5, 0):
module = 'pysqlite2'
else:
module = 'sqlite3'
raise ImproperlyConfigured, "Error loading %s module: %s" % (module, e)

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Model inheritance

2006-12-14 Thread James Bennett

On 12/14/06, Crispin Bennett <[EMAIL PROTECTED]> wrote:
> I assume it would be possible to get at child instances via some kind
> of introspection on instances of the base class (ie. so I could
> iterate usefully over collections of base class instances)?

You may want to read this thread from the developers list, which goes
through some of how this will work (and contains references to earlier
threads discussing the full API):

http://groups.google.com/group/django-developers/browse_thread/thread/7d40ad373ebfa912/

> I'll look into how to do such a thing, but, being new to both python
> and django, would like to know first if such a thing is feasible.

Not at the moment. Representing class hierarchies robustly and
efficiently in a relational database (which isn't designed for
hierarchical relations) is tricky at best, which I think is one of the
reasons behind the delay in getting it working "properly".

Your best bet right now is a one-to-one relationship, which exposes an
API not dissimilar from the one Malcolm has described -- querying
against a particular model class only returns instances of that model
class, but fields from parent or child classes will be accessible if
you explicitly ask for them from a particular instance (for example,
if you have a class Thing and a class Animal related to it, each
Animal will have a 'thing' attribute which will query the fields of
the related Thing object).

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Template tags and contexts

2006-12-14 Thread limodou

You can run your code outside of the block tag, so the block tag will
not push your context into the stack.

-- 
I like python!
UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Model inheritance

2006-12-14 Thread Crispin Bennett

On 12/14/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> Django does have the ability to do a sort of model inheritance, using
> OneToOneFields. This establishes a 1-1 relationship between a base
> class and a child class.

I assume it would be possible to get at child instances via some kind
of introspection on instances of the base class (ie. so I could
iterate usefully over collections of base class instances)?

I'll look into how to do such a thing, but, being new to both python
and django, would like to know first if such a thing is feasible.

Cheers,

CB.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sqlite3 and Python 2.5

2006-12-14 Thread kbochert

So 'DATABASE_NAME' should be the full name of a non-existant file. I
had thought they wanted the path to where the file was located.

!!Works fine now!!

Two problems for Django with Python 2.5

bug 1)
 ez_setup.py in Django .95 folder should have:
DEFAULT_VERSION = "0.6c3"
instead of
DEFAULT_VERSION = "0.6c1"

bug 2)
\Django\django\db\backends\sqlite3\base.py
should have:
from sqlite3 import dbapi2 as Database
instead of
from pysqlite2 import dbapi2 as Database

(presumably this gets copied to
\Python25\Lib\site-packages\Django-0.95-py2.5.egg\django\db\backends\sqlite3\base.py
during setup).

Thanks for the help -- I might have given up without it
Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Model inheritance

2006-12-14 Thread Russell Keith-Magee

On 12/15/06, Crispin Bennett <[EMAIL PROTECTED]> wrote:
>  But out of interest, does anyone here know what those
> semantic changes relate to?

They relate to the new model inheritance code. Usage of 1-1 relations
will change a bit when the model inheritance features become
available.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sqlite3 and Python 2.5

2006-12-14 Thread Joseph Heck
The the name to a file in a directory - SQLite databases are a single file,
and it won't be able to create one if a directory already exists with the
same name.

-joe

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
>
> I tried to do:
> Python manage.py syncdb
> and got the error "No module named pysqlite2". I edited the file
> \Python25\Lib\site-packages\Django-
> 0.95-py2.5.egg\django\db\backends\sqlite3\base.py
> to read:
> from sqlite3 import dbapi2 as Database
> instead of
> from pysqlite2 import dbapi2 as Database
> and the error went away.
>
> Is this legitimate or have I messed something up?
>
>
> Now the error is
>
> C:\Django\gtd>python manage.py syncdb
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File
> "C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
> nt.py", line 1319, in execute_manager
> execute_from_command_line(action_mapping, argv)
>   File
> "C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
> nt.py", line 1243, in execute_from_command_line
> action_mapping[action]()
>   File
> "C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
> nt.py", line 446, in syncdb
> cursor = connection.cursor()
>   File
> "C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\s
> qlite3\base.py", line 48, in cursor
> detect_types=Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES)
> sqlite3.OperationalError: unable to open database file
> from sqlite3  "unable to open database file"
>
>
> I have created a directory, and set 'DATABASE NAME' in settings to
> point to it.
> The documentation claims that the database will be created
> automatically when using sqlite3.
> Is this really the case?
>
> Karl
>
>
> >
>


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---


Sqlite3 and Python 2.5

2006-12-14 Thread kbochert

I tried to do:
Python manage.py syncdb
and got the error "No module named pysqlite2". I edited the file
\Python25\Lib\site-packages\Django-0.95-py2.5.egg\django\db\backends\sqlite3\base.py
to read:
from sqlite3 import dbapi2 as Database
instead of
from pysqlite2 import dbapi2 as Database
and the error went away.

Is this legitimate or have I messed something up?


Now the error is

C:\Django\gtd>python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 1319, in execute_manager
execute_from_command_line(action_mapping, argv)
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 1243, in execute_from_command_line
action_mapping[action]()
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 446, in syncdb
cursor = connection.cursor()
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\s
qlite3\base.py", line 48, in cursor
detect_types=Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES)
sqlite3.OperationalError: unable to open database file
 from sqlite3  "unable to open database file"


I have created a directory, and set 'DATABASE NAME' in settings to
point to it.
The documentation claims that the database will be created
automatically when using sqlite3.
Is this really the case?

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Sqlite3 and Python 2.5

2006-12-14 Thread kbochert

>From Django Djumpstart I attemptd:
python manage.py syncdb
and got an error:
C:\Django\gtd>python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 1319, in execute_manager
execute_from_command_line(action_mapping, argv)
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 1243, in execute_from_command_line
action_mapping[action]()
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 426, in syncdb
from django.db import connection, transaction, models,
get_creation_module
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\__init__.p
y", line 11, in 
backend = __import__('django.db.backends.%s.base' %
settings.DATABASE_ENGINE
, '', '', [''])
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\s
qlite3\base.py", line 13, in 
raise ImproperlyConfigured, "Error loading pysqlite2 module: %s" %
e
django.core.exceptions.ImproperlyConfigured: Error loading pysqlite2
module: No
module named pysqlite2

I changed   File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\s
qlite3\base.py"
to read
from sqlite3 import dbapi2 as Database
instead of
from pysqlite2 import dbapi2 as Database

and fixed that error. Now the error is:

 C:\Django\gtd>python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 1319, in execute_manager
execute_from_command_line(action_mapping, argv)
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 1243, in execute_from_command_line
action_mapping[action]()
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\core\manageme
nt.py", line 446, in syncdb
cursor = connection.cursor()
  File
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\s
qlite3\base.py", line 48, in cursor
detect_types=Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES)
sqlite3.OperationalError: unable to open database file

I have edited 'DATABASE_NAME' in the settings file to point to a
directory to hold my database. The documentation claims that the
database will be created automatically when using sqlite.

Is this the case? 

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Paths in Python 2.5

2006-12-14 Thread kbochert

Thanks but I don't have, and don't want an irc client, so I'll just
struggle along and try not to ask stupid questions. My problem is that
Python 2.5 and sqlite3 seems to be a buggy combination. (Is that true?)
Maybe sqlite3 hasn't really been integrated yet?

I have had to edit
"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\s
qlite3\base.py"
for instance, to refer to sqlite3 instead of  pysqlite.

I also find that the messages I have posted here are typically the
4-5th attempt, most simply vanishing. (replies seem to be reliable)

Please forgive my frustration
Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Paths in Python 2.5

2006-12-14 Thread Jeremy Dunck

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
> Jeremy Dunck wrote:
> > On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
...
> > Python's path (which is the list included in sys.path) is totally
> > separate from the window path.
> >
> So how do I put Django on this path?
>
> > You probably want to associate the .py file extension with
> > c:\python25\python.exe so that you can directly run django-admin.py
> > (using the windows path).
> >
> I suppose I will when I get tired of typing 'python' befor execution.
> Seems pretty trivial tho, given path names like
>
> "C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\sqlite3\base.py",
>
>
> :-(

On windows, properly configured, I run django-admin.py like this:

c:\>django-admin.py runserver

:-)

I don't mean to be insulting, but it's clear you're new to python.
Please consider getting on the IRC channel #django on
irc.freenode.net.  I'd be happy to help you get python and django
configured.

Speak my nick (jdunck) and I'll respond.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Model inheritance

2006-12-14 Thread Crispin Bennett

On 12/14/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
>
> Yes and No.
>
> Django does have the ability to do a sort of model inheritance, using
> OneToOneFields. This establishes a 1-1 relationship between a base
> class and a child class. For example:
>
> class Base(Model):
>name = CharField()
>
> class Article(Model):
>base = OneToOneField(MyBase)
>length = IntegerField()
>
> class Author(Model):
>base = OneToOneField(MyBase)
>age = IntegerField()
>
> In this case, each Article is required to reference a single Base
> instance (likewise for Author). An article instance can ask for
> base.name to get the name of the article; author.base.name will give
> the name of the author.
>
> Obviously, this is less than ideal, and there are a few gotchas - for
> example, you have to manually create the base class instances.
> However, it does work.

OK, thanks. That might be worth a look for the time being. I note
though at 
http://www.djangoproject.com/documentation/model_api/#one-to-one-relationships
it says "The semantics of one-to-one relationships will be changing
soon, so we don't recommend you use them. If that doesn't scare you
away, keep reading." It doesn't scare me that much, since this is a
toy app for my own use that I'm happy to keep in a state of constant
evolution. But out of interest, does anyone here know what those
semantic changes relate to?

>
> There is a work-in-progress to add a more formal inheritance structure
> to Django - search the developers archives and the wiki for a detailed
> discussion of the form this inheritance will take.

Yes, I see that now at
http://code.djangoproject.com/wiki/ModelInheritance. Hadn't done my
research properly before asking here.  Thanks.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Switching branches (was "Schema Evolution code")

2006-12-14 Thread Tim Chase

>> Are there any "best practices" tips for swapping among them for
>> testing/experimenting?  Preferably without causing /too/ much
>> damage. :)
> 
> Hey Tim,
> 
> I've added some more instructions to the "Using branches" part of our
> documentation. Let me know if this helps.
> 
> http://www.djangoproject.com/documentation/contributing/#using-branches

Yes, thanks!  I think with a combo of symlinks and the other 
response regarding a personalized environment, I think my final 
solution will be to

1) adjust my $PYTHONPATH to point to a ~/projects/django symlink
2) redirect that symlink to point to various branches of interest

My kudos to the Django team...a while back I had started my own 
framework (what Python programmer hasn't? ;) with a number of 
goals in mind.  However, as I learned about Django, I found that 
it already had implemented nearly all of what I wanted.  There 
are still the two aforementioned issues that are solved in 
branches (row-level permissions and schema evolution), but it 
looks like those will come down the pike and eventually merge 
with the trunk.  Thanks!

-tkc





--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Paths in Python 2.5

2006-12-14 Thread kbochert


Jeremy Dunck wrote:
> On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
> >
> > The command
> > C:>django-admin.py
> > does find it (tho it doesn't know what to do with it).
> >
> > It seems Python does not understand the path environment variable
> > or is there something I'm missing?
>
> Python's path (which is the list included in sys.path) is totally
> separate from the window path.
>
So how do I put Django on this path?

> You probably want to associate the .py file extension with
> c:\python25\python.exe so that you can directly run django-admin.py
> (using the windows path).
>
I suppose I will when I get tired of typing 'python' befor execution.
Seems pretty trivial tho, given path names like

"C:\Python25\lib\site-packages\django-0.95-py2.5.egg\django\db\backends\sqlite3\base.py",


:-(

> From there, you'll want to also make sure that c:\django is included
> in your Python path.
You mean sys.path?

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Schema Evolution code

2006-12-14 Thread Victor Ng

The patch I previous sent in mostly adds a couple functions to the
psycopg2 backend in the introspection module.  The only big changes
that affect the mainline django code are in django.core.management.

I'm using my patches, so that's been tested through 3 schema updates
in production.  As previously mentioned -there are those 2 remaining
bugs in the schema-evo code, but they're not show stoppers for me.

I see no reason why people need to use the latest trunk to test beta
quality features.  That just makes no sense - if you need beta
features - use a branch, or apply my patch to your own copy of trunk.
Is there a problem that I'm not seeing?  I'm quite sure that all the
code that my patch modifies hasn't been touched in over a month, so it
should apply cleanly to trunk.

vic

On 12/14/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>
> I know the company line on the SOC Schema Evolution code is that it will
> be integrated into the trunk after enough people have tested it, but I
> think this creates a chicken and egg problem. People aren't going to use
> it until it's in trunk and it won't be in trunk until enough people test
> it.
>
> Does it impact normal use without using schema evolution? In other
> words, could it be integrated into trunk with the proviso that
>
> "The Schema Evolution feature should be considered beta. If you use this
> feature, please test the results carefully and report any bugs you find.
> If you don't use Schema Evolution, you shouldn't be affected."
>
> I'd really like to try it, but I don't have time to keep up to date with
> two branches.
>
> Todd
>
> On Thu, 2006-12-14 at 21:22 +0800, Russell Keith-Magee wrote:
> > On 12/13/06, Steve Hutton <[EMAIL PROTECTED]> wrote:
> >
> > > Does it have a realistic chance of being accepted into core if it's found
> > > to be bug free?  Is it fully documented?  Is the design controversial or
> > > does it follow a community consensus?
> >
> > There was discussion about the general problem of schema evolution
> > before the SOC project was started. The discussion was started by
> > Jacob, and other committers (Luke and Malcolm) weighed in at the time,
> > along with many other interested onlookers. The resulting design is on
> > the wiki.
> >
> > Assuming that the implementation matches the proposal, I would say
> > there is a realistic chance of it getting accepted into core. However,
> > this would require that the implementation is up to date, and bug free
> > (including tests to validate this status that are integrated into the
> > Django system tests).
> >
> > Yours,
> > Russ Magee %-)
> >
> > >
>
>
> >
>


-- 
"Never attribute to malice that which can be adequately explained by
stupidity."  - Hanlon's Razor

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Paths in Python 2.5

2006-12-14 Thread Jeremy Dunck

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
> The command
> C:>django-admin.py
> does find it (tho it doesn't know what to do with it).
>
> It seems Python does not understand the path environment variable
> or is there something I'm missing?

Python's path (which is the list included in sys.path) is totally
separate from the window path.

You probably want to associate the .py file extension with
c:\python25\python.exe so that you can directly run django-admin.py
(using the windows path).

>From there, you'll want to also make sure that c:\django is included
in your Python path.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Switching branches (was "Schema Evolution code")

2006-12-14 Thread Adrian Holovaty

On 12/14/06, Tim Chase <[EMAIL PROTECTED]> wrote:
> Now I'd like to toy with both the Schema Evolution and the
> row-level user privs branches.
>
> Are there any "best practices" tips for swapping among them for
> testing/experimenting?  Preferably without causing /too/ much
> damage. :)

Hey Tim,

I've added some more instructions to the "Using branches" part of our
documentation. Let me know if this helps.

http://www.djangoproject.com/documentation/contributing/#using-branches

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Switching branches (was "Schema Evolution code")

2006-12-14 Thread James Bennett

On 12/14/06, Tim Chase <[EMAIL PROTECTED]> wrote:
> Are there any "best practices" tips for swapping among them for
> testing/experimenting?  Preferably without causing /too/ much
> damage. :)

I can only speak to Unix-based systems, but what I've done with lots
of things of this nature is write a little script which will rewrite
the .profile and .rc files for my shell to have various environment
variables (in this case, PYTHONPATH) point to different locations,
then use 'source' to force the files to reload.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Paths in Python 2.5

2006-12-14 Thread kbochert

I setup my path env var:

C:\Django>path
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program
Files\ATI Tech
nologies\ATI Control
Panel;C:\Apps\Eps12\Bin;C:\Python25;c:\Python25\Scripts;c:\
Django\django\bin

And I get:

C:\Django>python django-admin.py
python: can't open file 'django-admin.py': [Errno 2] No such file or
directory

Python can't find django-admin.py, despite a file of that name being in
both
C:\python\scripts  and c:\Django\django\bin

The command
C:>django-admin.py
does find it (tho it doesn't know what to do with it).

It seems Python does not understand the path environment variable
or is there something I'm missing?

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Switching branches (was "Schema Evolution code")

2006-12-14 Thread Tim Chase

> If you don't use Schema Evolution, you shouldn't be affected."
> 
> I'd really like to try it, but I don't have time to keep up to date with
> two branches.

Early on, I naively just did the generic install of Django which 
put it in the usual system-wide place.

Now I'd like to toy with both the Schema Evolution and the 
row-level user privs branches.

Are there any "best practices" tips for swapping among them for 
testing/experimenting?  Preferably without causing /too/ much 
damage. :)

Thanks,

-tkc




--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Schema Evolution code

2006-12-14 Thread Todd O'Bryan

I know the company line on the SOC Schema Evolution code is that it will
be integrated into the trunk after enough people have tested it, but I
think this creates a chicken and egg problem. People aren't going to use
it until it's in trunk and it won't be in trunk until enough people test
it.

Does it impact normal use without using schema evolution? In other
words, could it be integrated into trunk with the proviso that

"The Schema Evolution feature should be considered beta. If you use this
feature, please test the results carefully and report any bugs you find.
If you don't use Schema Evolution, you shouldn't be affected."

I'd really like to try it, but I don't have time to keep up to date with
two branches.

Todd

On Thu, 2006-12-14 at 21:22 +0800, Russell Keith-Magee wrote:
> On 12/13/06, Steve Hutton <[EMAIL PROTECTED]> wrote:
> 
> > Does it have a realistic chance of being accepted into core if it's found
> > to be bug free?  Is it fully documented?  Is the design controversial or
> > does it follow a community consensus?
> 
> There was discussion about the general problem of schema evolution
> before the SOC project was started. The discussion was started by
> Jacob, and other committers (Luke and Malcolm) weighed in at the time,
> along with many other interested onlookers. The resulting design is on
> the wiki.
> 
> Assuming that the implementation matches the proposal, I would say
> there is a realistic chance of it getting accepted into core. However,
> this would require that the implementation is up to date, and bug free
> (including tests to validate this status that are integrated into the
> Django system tests).
> 
> Yours,
> Russ Magee %-)
> 
> > 


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Tips/advice on model and application design?

2006-12-14 Thread Joseph Heck
It really just depends on how you're accessing the data. I tend to optimize
for developer simplicity first, and then go in and adjust/split/modify code
as needed when performance isn't where it needs to be for whatever
application I'm working with.

The case where multiple models might work a little better than fewer, larger
models is where you find yourself with either a lot of sparse data (some
significant portion of the model being null or empty), or the need to
consistently edit just a small portion of the data (one bit of metadata gets
updated a lot, the rest of the information doesn't).

But practically, I'd recommend building your app so that it makes the most
sense to you, and then seeing how the performance rolls out. Worrying about
"that might make the performance bad" from the very beginning isn't usually
a good idea.

-joe

On 12/14/06, Austin Govella <[EMAIL PROTECTED]> wrote:
>
>
> I'm new to Django, so I was looking for some advice on good model and
> app design and on how that affects performance.
>
> My first app has nine models, and after working with it for a bit, it
> seems like it's actually two apps: one for meta data and another for
> content management.
>
> Are there any rules of thumb for when you should separate out some
> functionality into its own app? Is there a certain number of models
> that would suggest you probably have more than one app?
>
> Is there any impact on Django's performance? I.e. is an app with four
> models faster than an app with 20?
>
> If I'm importing models from one app into another, is that
> faster/slower than just having all the models in one app?
>
> (In my case, I'd move the four meta data models to a separate app and
> import just one of them into the content management app. Is this
> actually slower than just keeping all the models in one single app?)
>
>
>
> Thanks,
> --
> Austin Govella
> Thinking & Making: IA, UX, and IxD
> http://thinkingandmaking.com
> [EMAIL PROTECTED]
>
> >
>


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---


Re: Would Django be a good framework for developing and engineering/science application

2006-12-14 Thread T. Size

Jay,

Thank you for your comments.  At least it looks like I will be able to
use Django.  I guess the next thing for me to do is to spend alot of
time with the documentation and built a couple of simple apps/tutorials
to flush out my understanding of how Django will work.

Regards.
Thomas


Jay Parlar wrote:
> On 12/14/06, T. Size <[EMAIL PROTECTED]> wrote:
> >
> > I would appreaciate any comments about if Django is a good framework of
> > developing an application like is described below.  If it is a good
> > framework for this I would appreciate pointers to applicable
> > documentation or examples.
> >
> > In the near future I will be developing an application that will be
> > used as a tool for doing the electrical engineering for making
> > electrical power transformers.  Individuals from other parts of the
> > company will have to access parts but not all of system.
> >
> > Anyway here are the details
> > 1.  An electrical engineer will log into the system, access one of
> > several design programs and after completing a few forms submit for the
> > program to perform iterations.  Output will be saved to a database and
> > portions of the output will be published to other parts of the company.
> >  I have libraries in python for doing most of the engineering part of
> > this work right now.  It could take several minutes for each
> > transformer design to run making the iterations.
> > 2.  Managers will login the system to run reports.  Few items if any
> > can be changed by management but they will do a number of reports.
> > Django's CRUD system looks very promising to me for this part.
> > 3.  Purchasing agents will update prices for components and get reports
> > of requirements for recently released jobs.
> > 4.  Authentication by person and role will be very important.
> > 5.  The deployment will be on an intranet initially but web access in
> > the future would be a great asset thus my interest in using a web
> > framework.
> >
> > Most of the examples I have seen for Django seem to focus on custom CMS
> > type applications.  Atleast the engineering function described above is
> > more of a servlet (although a big one) type application.
> >
>
> Well, I've done something that sounds reasonably similar. In-house
> intranet app for an engineering company. We had some in-house Python
> tools that were used pretty heavily, but each user had to run their
> own version of it, and we couldn't place any controls on how it was
> used.
>
> So, I created a Django app. Engineers would log in, fill in the
> necessary info into the forms, and hit Submit. Processing would fire
> stuff off to another dedicated server, a process that could take up to
> a minute. Eventually, it'd finish, and send the data back to the
> Django app, presenting the user with the final results (done with a
> little AJAX).
>
> Certain admins could then log in and track what different people had
> done, as well as grant and remove permissions for individual users to
> perform certain actions.
>
> So essentially, it was a big Django app wrapped around tens of
> thousands of lines of Python code that was previously used in the
> end-user tool. Worked like a charm, everyone seemed pretty happy with
> the system.
>
> Hope that helps. I know I didn't offer too much in the way of details,
> but essentially, it sounds like I did what you plan on doing.
>
> The only problem I ran into was getting the AJAX stuff going, but
> that's only because this was both my first ever Django app, and my
> first time trying out AJAX. I simply used the AJAX so the "Submit"
> button would immediately bring the engineer to a new page, and I could
> keep them up to date on the status as the separate server did its
> processing.
> 
> Jay P.


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: null ordering in mysql

2006-12-14 Thread Don Arbow

On Dec 14, 2006, at 12:49 AM, MC wrote:
>
> Problem:
> I order dates and null values in ascending order under MySQL. To my
> surprise, null values are listed first, then actual dates. Turns out
> that in MySQL, null values are LOWER than non-null values, whereas
> Postgresql is the reverse. As outlined here
> http://troels.arvin.dk/db/rdbms/#select-order_by, it seems the only  
> way
> to reverse the order is by prepending a - sign and switching from ASC
> to DESC. Unfortunately, this is the same syntax Django uses for
> ordering!
>
> Solution:
> I couldn't think of an easy solution through the model API or using
> custom managers. I suppose I could write custom SQL, but it would be
> nicer to use the model API. I could use a default value like the year
> 3000 and filter for display. Any suggestions? Thanks for your help!



Under relational database theory, nulls are not less than or greater  
than any value, including other nulls. Because of this, you should  
never count on where a particular database puts those values. The  
page you quoted explains the allowances that database authors have  
made to work around the problem. The page didn't even mention sqlite,  
which follows mysql's convention.

I would say this is something that Django should stay away from, too  
many differences, even more when you include aggregates such as min()  
and max(). For example in Postgres, min() and max() ignore nulls in  
columns unless all column values are null, so this behavior is not  
consistent with its column sorting routines. I think If you want  
minimum or maximum values in your tables, they should be explicitly  
coded.

Don



--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Somewhat awkward ImageField usage

2006-12-14 Thread Andy Dustman

I have this model:

class Photo(Model):

title = CharField(
maxlength = 80,
)
description = TextField()
photo = ImageField(
upload_to = "photos/%Y/%m/%d",
height_field = "H",
width_field = "W",
)
W = PositiveSmallIntegerField("Width", null=True, editable=False)
H = PositiveSmallIntegerField("Height", null=True, editable=False)

W and H are both set to null=True, because I found that if you used
the default of null=False, and created the columns as NOT NULL, you'd
get a database error upon the initial add because the columns were
being set to NULL. However, if you set them to null=True so that they
can contain NULL, they *do* get the dimensions saved to them. There
seems to be an intermediate step where the row is first inserted with
NULLs for those fields and then it is updated. The workaround is to
null=True and editable=False so that the user can't futz with these
values, but it would be better if null=False worked.

The docs (trunk) currently say about ImageField's height_field and
width_field that the referenced fields are auto-populated "each time a
model instance is saved" but that seems to not be literally true.

If this seems bug-worthy, let me know.
-- 
Patriotism means to stand by the country. It does
not mean to stand by the president. -- T. Roosevelt

This message has been scanned for memes and
dangerous content by MindScanner, and is
believed to be unclean.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread kbochert

Found it. Highlite the text with the mouse, then right-click copies to
clipboard
Right-click on the dos box with nothing highlighted causes a paste!

(I think Bill has something against dos boxes!)

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Installation problems

2006-12-14 Thread kbochert

I need some help installing Django. (not a good sign for my ability to
use it!)
I have installed Python25 on Windows2000, and added it to the path.
Its at C:\Python25
I downloaded and unzipped Django 0.95 to C:\Django-0.95
I opened a console in c:Django-.095 and entered 'sudo python setup.py
install'
It replied 'sudo' is not recognized.
I opened a console in c:Django-.095 and entered 'python setup.py
install'

I have a firewall. It asked if I wanted to allow the connection to the
internet. I answered yes, and saw a short burst of traffic.

It connected to the internet, and I got  a long message:

Downloading http://cheeseshop  ...   5.egg
Traceback:
File "setup.py", line 2, in 
  ez_setup.use_setuptools()
...
   ...
File "C:\Python25\lib\urllib2.py", line 499, in http_error_default
  raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

What was not found, and what do I do about it?


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



OneToOneField and edit_inline

2006-12-14 Thread Dirk Eschler

Hello,

i'm having some problems with the OneToOneField. I have a content app with a 
class Content that i want to use as base class in several other classes (like 
Project in the below example):

class Content(models.Model):
title = models.CharField('Title', maxlength=255, core=True)
body  = models.TextField('Body text')

class Project(models.Model):
content  = models.OneToOneField(Content, edit_inline=models.TABULAR, 
num_in_admin=1, core=True, related_name='project_content')
subtitle = models.CharField('Subtitle', maxlength=255)

class Admin:
pass

Now when i try to add a project through the admin interface, i don't get the 
Content fields inlined, but only a empty input dropdown. Am i missing 
something obvious?

I'm using Django-0.95.

Best Regards,
Dirk Eschler

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



For EVERY Pakistani Muslim... amendments in hudood ordinance

2006-12-14 Thread Eminaeem
This is for EVERY Pakistani Muslim to know about the amendments in
hudood ordinance, so called "Adults' rights ordinance"...

Please download and listen to the following...

http://www.tanzeem.org/tanzeemeislami/2006-12-08.ra

This is not an enforcement, but a humble request. Don't just listen to
the puppet politicians; this bill is against our religion, our faith,
Islam. And you know quality of faith in our politicians.

Please listen and forward as much as you can.

Also, subscribe to get weekly jummah biyanaat by subscribing at
http://www.tanzeem.org/

Jazakallah

 



--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---


Re: Would Django be a good framework for developing and engineering/science application

2006-12-14 Thread Jay Parlar

On 12/14/06, T. Size <[EMAIL PROTECTED]> wrote:
>
> I would appreaciate any comments about if Django is a good framework of
> developing an application like is described below.  If it is a good
> framework for this I would appreciate pointers to applicable
> documentation or examples.
>
> In the near future I will be developing an application that will be
> used as a tool for doing the electrical engineering for making
> electrical power transformers.  Individuals from other parts of the
> company will have to access parts but not all of system.
>
> Anyway here are the details
> 1.  An electrical engineer will log into the system, access one of
> several design programs and after completing a few forms submit for the
> program to perform iterations.  Output will be saved to a database and
> portions of the output will be published to other parts of the company.
>  I have libraries in python for doing most of the engineering part of
> this work right now.  It could take several minutes for each
> transformer design to run making the iterations.
> 2.  Managers will login the system to run reports.  Few items if any
> can be changed by management but they will do a number of reports.
> Django's CRUD system looks very promising to me for this part.
> 3.  Purchasing agents will update prices for components and get reports
> of requirements for recently released jobs.
> 4.  Authentication by person and role will be very important.
> 5.  The deployment will be on an intranet initially but web access in
> the future would be a great asset thus my interest in using a web
> framework.
>
> Most of the examples I have seen for Django seem to focus on custom CMS
> type applications.  Atleast the engineering function described above is
> more of a servlet (although a big one) type application.
>

Well, I've done something that sounds reasonably similar. In-house
intranet app for an engineering company. We had some in-house Python
tools that were used pretty heavily, but each user had to run their
own version of it, and we couldn't place any controls on how it was
used.

So, I created a Django app. Engineers would log in, fill in the
necessary info into the forms, and hit Submit. Processing would fire
stuff off to another dedicated server, a process that could take up to
a minute. Eventually, it'd finish, and send the data back to the
Django app, presenting the user with the final results (done with a
little AJAX).

Certain admins could then log in and track what different people had
done, as well as grant and remove permissions for individual users to
perform certain actions.

So essentially, it was a big Django app wrapped around tens of
thousands of lines of Python code that was previously used in the
end-user tool. Worked like a charm, everyone seemed pretty happy with
the system.

Hope that helps. I know I didn't offer too much in the way of details,
but essentially, it sounds like I did what you plan on doing.

The only problem I ran into was getting the AJAX stuff going, but
that's only because this was both my first ever Django app, and my
first time trying out AJAX. I simply used the AJAX so the "Submit"
button would immediately bring the engineer to a new page, and I could
keep them up to date on the status as the separate server did its
processing.

Jay P.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Would Django be a good framework for developing and engineering/science application

2006-12-14 Thread T. Size

I would appreaciate any comments about if Django is a good framework of
developing an application like is described below.  If it is a good
framework for this I would appreciate pointers to applicable
documentation or examples.

In the near future I will be developing an application that will be
used as a tool for doing the electrical engineering for making
electrical power transformers.  Individuals from other parts of the
company will have to access parts but not all of system.

Anyway here are the details
1.  An electrical engineer will log into the system, access one of
several design programs and after completing a few forms submit for the
program to perform iterations.  Output will be saved to a database and
portions of the output will be published to other parts of the company.
 I have libraries in python for doing most of the engineering part of
this work right now.  It could take several minutes for each
transformer design to run making the iterations.
2.  Managers will login the system to run reports.  Few items if any
can be changed by management but they will do a number of reports.
Django's CRUD system looks very promising to me for this part.
3.  Purchasing agents will update prices for components and get reports
of requirements for recently released jobs.
4.  Authentication by person and role will be very important.
5.  The deployment will be on an intranet initially but web access in
the future would be a great asset thus my interest in using a web
framework.

Most of the examples I have seen for Django seem to focus on custom CMS
type applications.  Atleast the engineering function described above is
more of a servlet (although a big one) type application.

Any suggestions or pointers would be appreciated.
Thomas


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread Fredrik Lundh

Jeremy Dunck wrote:

> Here's a 3rd:  you can cut and paste from a dos box.  They change it
> on each version of windows, but I think on 2k, you click the icon for
> the dos window (or perhaps it's right-click the title bar), and select
> Mark.  Drag your cursor around to highlight a segment, and then hit
> enter.

you can also enable "Quick Edit Mode" under Properties, which lets you 
left-click and drag to select a region.




--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread Jeremy Dunck

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
> Now thats what I expected -- no error messages
>
> Interestingly, installing Django has taught me two things I never knew
> about WIN2K
> You can redirect stderr with '2>'
> The File syatem has symbolic links ( just no tools to access them!)

Here's a 3rd:  you can cut and paste from a dos box.  They change it
on each version of windows, but I think on 2k, you click the icon for
the dos window (or perhaps it's right-click the title bar), and select
Mark.  Drag your cursor around to highlight a segment, and then hit
enter.  The highlighted text will then be on the clipboard.

If those aren't the exact steps, poke at it-- I'm certain it's possible.  :)

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread kbochert

Now thats what I expected -- no error messages

Interestingly, installing Django has taught me two things I never knew
about WIN2K
You can redirect stderr with '2>'
The File syatem has symbolic links ( just no tools to access them!)

Thanks for the help.
Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread Aidas Bendoraitis
I ran out of ideas. :) Maybe somebody else has any thoughts regarding new lines?

Good luck with Django!
Aidas Bendoraitis [aka Archatas]



On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> firefox shows utf-8
>
> my firefox is 2.0
>
> On 12/14/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > And what encoding is showed in the page info? ...when you right click
> > somewhere in the page and choose "View Page Info" from the menu. Maybe
> > just the default character encoding in your firefox settings is set
> > wrongly?
> >
> > You can always override admin templates copying them into your
> > custom_templates/admin directory.
> >
> > Regards,
> > Aidas Bendoraitis
> >
> >
> >
> > On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> > > It's not my html page, but the django admin page.
> > >
> > > the head of admin page is like this:
> > >
> > >  > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> > > http://www.w3.org/1999/xhtml"; lang="zh-cn" xml:lang="zh-cn" >
> > > 
> > > 站点管理员
> > >  > > href="/oj/adminmedia/css/dashboard.css" />
> > > 
> > >
> > > no encoding here, but lang = 'zh-cn'.
> > >
> > > and all chinese characters in my pages and mysql are encoded in UTF-8.
> > > Locale of my server is like this:
> > >
> > > LANG=zh_CN.UTF-8
> > > LANGUAGE=zh_CN:zh:en_US:en
> > > LC_CTYPE="zh_CN.UTF-8"
> > > LC_NUMERIC="zh_CN.UTF-8"
> > > LC_TIME="zh_CN.UTF-8"
> > > LC_COLLATE="zh_CN.UTF-8"
> > > LC_MONETARY="zh_CN.UTF-8"
> > > LC_MESSAGES="zh_CN.UTF-8"
> > > LC_PAPER="zh_CN.UTF-8"
> > > LC_NAME="zh_CN.UTF-8"
> > > LC_ADDRESS="zh_CN.UTF-8"
> > > LC_TELEPHONE="zh_CN.UTF-8"
> > > LC_MEASUREMENT="zh_CN.UTF-8"
> > > LC_IDENTIFICATION="zh_CN.UTF-8"
> > > LC_ALL=
> > >
> > >
> > > On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > > > It might be that it treats new lines as \r\n when you are using some
> > > > windows-* encoding for your html pages. Check the source code. I would
> > > > rather use UTF-8 in any case.
> > > >
> > > > Regards
> > > > Aidas Bendoraitis [aka Archatas]
> > > >
> > > >
> > >
> > > --
> > > Yours, Zhongke Chen 陈忠克
> > >
> > > >
> > >
> >
> > >
> >
>
>
> --
> Yours, Zhongke Chen 陈忠克
>
> 欢迎访问温州本地Linux论坛:http://groups.google.com/group/linux-wz
>
> [EMAIL PROTECTED]/excel/ppt文件给我,请先转成PDF格式。谢谢!PLEASE
> contact me using [EMAIL PROTECTED] from now on. Other mail boxes
> have been deprecated. If you want to attach word/excel/powerpoint
> files for me, PLEASE convert them to pdf. Thanks a lot.
>
> >
>

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread Jay Parlar

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
> I can't ccut and paste from a dos box. Fortunately I just discovered
> that I can redirect stderr using '2>' !!
>

Ahh, I think I see what's happening. Django 0.95 is reasonably old
now, and by default, it tries to download setuptools 0.6c1, for
Python2.5. However, there is no 0.6c1 for Python2.5, the only one they
have available is 0.6c3.

So here's the easiest thing to try: In the Django 0.95 folder, there
should be a file called ez_setup.py. In it, near the top, is the
following line:

DEFAULT_VERSION = "0.6c1"

Change that to

DEFAULT_VERSION = "0.6c3"

And give the install a try again. If that doesn't work, then try
installing setuptools separately, by itself.

In the current SVN version of Django, the setuptools stuff has been
removed (at least, it was removed at one point, don't know if that's
true anymore). So this won't be a problem in the future.

You just happened to be one of the few people running Python2.5 and
Django 0.95. Most people running 2.5 are probably running Django out
of SVN, where this isn't an issue.

Let me know if this doesn't work.

Jay P.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread kbochert

I can't ccut and paste from a dos box. Fortunately I just discovered
that I can redirect stderr using '2>' !!

Traceback (most recent call last):
  File "setup.py", line 2, in 
ez_setup.use_setuptools()
  File "C:\Django-0.95\ez_setup.py", line 72, in use_setuptools
egg = download_setuptools(version, download_base, to_dir,
download_delay)
  File "C:\Django-0.95\ez_setup.py", line 126, in download_setuptools
src = urllib2.urlopen(url)
  File "C:\Python25\lib\urllib2.py", line 121, in urlopen
return _opener.open(url, data)
  File "C:\Python25\lib\urllib2.py", line 380, in open
response = meth(req, response)
  File "C:\Python25\lib\urllib2.py", line 491, in http_response
'http', request, response, code, msg, hdrs)
  File "C:\Python25\lib\urllib2.py", line 418, in error
return self._call_chain(*args)
  File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
  File "C:\Python25\lib\urllib2.py", line 499, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: manage.py - "test" not a known action - how do I do unittests?

2006-12-14 Thread Bob

Waylan -

I removed the egg and voila! manage.py now knows about "test."  Thanks
for your help.

- Bob


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Adding a foreign key to list_display makes Admin hang

2006-12-14 Thread Austin Govella

Not sure how to trouble-shoot this. (And I could've sowrn it worked yesterday.)

When I add a column that's a foreign key to list_display, admin hangs.
The change list just never loads. (The add/edit page loads and saves
just fine.)

I've tried deleting the database tables for the app and reinstalling
the models, but I get the same (nothing) happens.

Any pointers on where to look to find the problem?



Thanks,
-- 
Austin Govella
Thinking & Making: IA, UX, and IxD
http://thinkingandmaking.com
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: ImageField: Unique with number, not underscore?

2006-12-14 Thread Oliver Lavery
Yup, save() will be called whenever a model is written to the database,
including through a manipulator (again, afaik)

self.name is just for example purposes. You need to change the name of the
file in the ImageField or FileField object within your model. But yes, if
you do this from an overloaded save() method it should change the name of
the actual file (which will be written when the parent class save() method
is called).

Of course the only way to be sure is to try it and see. I actually have to
implement something like this in the next few days; if I get something
working I'll post the snippet.

Cheers,
~ol

On 12/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Hi.
>
> Terji7 schrieb:
> > Oliver Lavery wrote:
> > > It seems that the most obvious way would be to alter _save_FIELD_file
> in
> > > django/db/models/base.py ~ line 335.
> [...]
> >
> > That sounds like a horrible way to me. Rather use the save() method in
> > the models:
>
> The uploaded image file is being saved by a form manipulator, not by my
> implementation.
> Would that also trigger my modified save method? And would just
> updating self.name on the model also automagically rename the file?
>
> Sorry if I'm sounding ignorant here
>
> Daniel
>
>
> >
>


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---


Re: Installation on Python25

2006-12-14 Thread Jay Parlar

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
> Not that I am aware of. Windows 2000, Sygate personal firewall. Comcast
> cable.
> Plain vanilla I think.
>

Could you paste in the full text of the traceback?

Jay P.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread kbochert

Not that I am aware of. Windows 2000, Sygate personal firewall. Comcast
cable.
Plain vanilla I think.

Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread zhongke chen
firefox shows utf-8

my firefox is 2.0

On 12/14/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> And what encoding is showed in the page info? ...when you right click
> somewhere in the page and choose "View Page Info" from the menu. Maybe
> just the default character encoding in your firefox settings is set
> wrongly?
>
> You can always override admin templates copying them into your
> custom_templates/admin directory.
>
> Regards,
> Aidas Bendoraitis
>
>
>
> On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> > It's not my html page, but the django admin page.
> >
> > the head of admin page is like this:
> >
> >  > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> > http://www.w3.org/1999/xhtml"; lang="zh-cn" xml:lang="zh-cn" >
> > 
> > 站点管理员
> >  > href="/oj/adminmedia/css/dashboard.css" />
> > 
> >
> > no encoding here, but lang = 'zh-cn'.
> >
> > and all chinese characters in my pages and mysql are encoded in UTF-8.
> > Locale of my server is like this:
> >
> > LANG=zh_CN.UTF-8
> > LANGUAGE=zh_CN:zh:en_US:en
> > LC_CTYPE="zh_CN.UTF-8"
> > LC_NUMERIC="zh_CN.UTF-8"
> > LC_TIME="zh_CN.UTF-8"
> > LC_COLLATE="zh_CN.UTF-8"
> > LC_MONETARY="zh_CN.UTF-8"
> > LC_MESSAGES="zh_CN.UTF-8"
> > LC_PAPER="zh_CN.UTF-8"
> > LC_NAME="zh_CN.UTF-8"
> > LC_ADDRESS="zh_CN.UTF-8"
> > LC_TELEPHONE="zh_CN.UTF-8"
> > LC_MEASUREMENT="zh_CN.UTF-8"
> > LC_IDENTIFICATION="zh_CN.UTF-8"
> > LC_ALL=
> >
> >
> > On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > > It might be that it treats new lines as \r\n when you are using some
> > > windows-* encoding for your html pages. Check the source code. I would
> > > rather use UTF-8 in any case.
> > >
> > > Regards
> > > Aidas Bendoraitis [aka Archatas]
> > >
> > >
> >
> > --
> > Yours, Zhongke Chen 陈忠克
> >
> > >
> >
>
> >
>


-- 
Yours, Zhongke Chen 陈忠克

欢迎访问温州本地Linux论坛:http://groups.google.com/group/linux-wz

[EMAIL PROTECTED]/excel/ppt文件给我,请先转成PDF格式。谢谢!PLEASE
contact me using [EMAIL PROTECTED] from now on. Other mail boxes
have been deprecated. If you want to attach word/excel/powerpoint
files for me, PLEASE convert them to pdf. Thanks a lot.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to hack admin interface?...and should I?

2006-12-14 Thread va:patrick.kranzlmueller


Am 14.12.2006 um 17:05 schrieb Daniel Kvasnicka jr.:

>
> Hi djangees,
> I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as
> well and tried the tutorials.
> What I like about Django is (obviously) the auto-generated admin
> interface.
>
> However, what I need to know is how
> easy/difficult/deprecated/encouraged is to hack the auto-generated
> admin interface. I'm doing this app, where our customers login and  
> vote
> for features that we plan to implement in our services. And besides
> CRUD, I need to enable my boss to login and view a whole bunch of  
> stats
> about who voted for what and how is that particular guy important for
> us etc... So, my question is, how easy would it be to "add a page" to
> admin, that would have the same auth restrictions, same GUI but would
> only display bars and graphs generated from the DB? Or would you write
> an admin section from scratch in that case?

write custom views (or use generic views).
making your site _look_ like the admin is probably harder than  
writing the views.

adding a page to the admin is quite easy though:
just extend the index-template and link to your site ... and don´t  
forget to use
myview = staff_member_required(never_cache(myview))

patrick


>
> Right now I'm writing everything on my own in TurboGears. It's not  
> bad,
> since auth/auth management is pretty intuitive in TG, but it's kinda
> boring...
>
> Thanks for your opinions,
> Dan
>
>
> >


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Installation on Python25

2006-12-14 Thread Jay Parlar

On 12/14/06, kbochert <[EMAIL PROTECTED]> wrote:
>
> I need some help installing Django. (not a good sign for my ability to
> use it!)
> I have installed Python25 on Windows2000, and added it to the path.
> Its at C:\Python25
> I downloaded and unzipped Django 0.95 to C:\Django-0.95
> I opened a console in c:Django-.095 and entered 'python setup.py
> install'
> It connected to the internet, and I got  a long message:
>
> Downloading http://cheeseshop  ...   5.egg
> Traceback:
> File "setup.py", line 2, in 
>   ez_setup.use_setuptools()
> ...
>...
> File "C:\Python25\lib\urllib2.py", line 499, in http_error_default
>   raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
> urllib2.HTTPError: HTTP Error 404: Not Found
>
> I have a firewall. It asked if I wanted to allow the connection to the
> internet. I answered yes, and saw a short burst of traffic.
>
> What was not found, and what do I do about it?


Are you running behind a proxy server, by any chance? urllib2 can get
tripped up in that situation.

Jay P.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: help with tagging app

2006-12-14 Thread Bret Walker

Did anything ever come of Luke's work?

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Installation on Python25

2006-12-14 Thread kbochert

I need some help installing Django. (not a good sign for my ability to
use it!)
I have installed Python25 on Windows2000, and added it to the path.
Its at C:\Python25
I downloaded and unzipped Django 0.95 to C:\Django-0.95
I opened a console in c:Django-.095 and entered 'python setup.py
install'
It connected to the internet, and I got  a long message:

Downloading http://cheeseshop  ...   5.egg
Traceback:
File "setup.py", line 2, in 
  ez_setup.use_setuptools()
...
   ...
File "C:\Python25\lib\urllib2.py", line 499, in http_error_default
  raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

I have a firewall. It asked if I wanted to allow the connection to the
internet. I answered yes, and saw a short burst of traffic.

What was not found, and what do I do about it?
Thanks
Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Filtering firstof vars in templates

2006-12-14 Thread ElGranAzul

Hi, i'm testing the firstof tag in templates, but i want to filter some
vars. In this case, the vars are dates, and usually y use {{
week|date:"W" }} to get the week number (week is a full date), but i
also want to get the same with {{ day|date:"W" }} (also a full date).

It,of course, can be done with some if, but firstof seems to be my best
friend here ;). I've tried with {% firstof week|date:"W" day|date:"W"
%} and it doesn't work (at least with last cvs version), and wrapping
it with {% filter date:"W" %} seems to not work because it handle the
vars as text, not a date.

I've googled a lot in this list and read the docs in the webpage, but i
have not find something about it. If it's not possible, it could be a
good feature request for the next version ;), and if is possible,
someone could point me how do it? thanks. :)


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



How to hack admin interface?...and should I?

2006-12-14 Thread Daniel Kvasnicka jr.

Hi djangees,
I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as
well and tried the tutorials.
What I like about Django is (obviously) the auto-generated admin
interface.

However, what I need to know is how
easy/difficult/deprecated/encouraged is to hack the auto-generated
admin interface. I'm doing this app, where our customers login and vote
for features that we plan to implement in our services. And besides
CRUD, I need to enable my boss to login and view a whole bunch of stats
about who voted for what and how is that particular guy important for
us etc... So, my question is, how easy would it be to "add a page" to
admin, that would have the same auth restrictions, same GUI but would
only display bars and graphs generated from the DB? Or would you write
an admin section from scratch in that case?

Right now I'm writing everything on my own in TurboGears. It's not bad,
since auth/auth management is pretty intuitive in TG, but it's kinda
boring...

Thanks for your opinions,
Dan


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Installation on Python25

2006-12-14 Thread kbochert

I need some help installing Django. (not a good sign for my ability to
use it!)
I have installed Python25 on Windows2000, and added it to the path.
Its at C:\Python25
I downloaded and unzipped Django 0.95 to C:\Django-0.95
I opened a console in c:Django-.095 and entered 'python setup.py
install'
It connected to the internet, and I got  a long message:

Downloading http://cheeseshop  ...   5.egg
Traceback:
File "setup.py", line 2, in 
  ez_setup.use_setuptools()
...
   ...
File "C:\Python25\lib\urllib2.py", line 499, in http_error_default
  raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

I have a firewall. It asked if I wanted to allow the connection to the
internet. I answered yes, and saw a short burst of traffic.

What was not found, and what do I do about it?
Thanks
Karl


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Help with get absolute url

2006-12-14 Thread conrad22

You were quite right, Wayne, there was a mistake in my model (Charfield
instead of SlugField)...so don't I feel stupid!
A million thanks to everyone anyway!

(I feel quite well qualified to write an idiot's guide now...)


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Schema Evolution code

2006-12-14 Thread Victor Ng
If anyone wants to poke at our schema evolution code you should be
able to apply this patch attached.

It's mostly working.  The bugs I know about are:

1) M2M fields can't be repointed at new tables properly
2) there's some weird quirk with modifying null and db_index at the
same time.  i have to run the sqlevolve command twice to get the
column to get altered and to have the index added.

The patch also fixes a couple problems I discovered in Django's
existing syncdb command and the way it handles unique and db_index
arguments.  Those bugs were:

1) syncdb sometimes seems to 'miss' setting up foreign key constraints
between applications.
2) foreign key constraints were specified inconsistently.  Sometimes a
'REFERENCES' clause was added to the CREATE TABLE and sometimes a
CREATE CONSTRAINT was used.  This caused problems with figuring out
the names of the constraints I needed to remove.
3) indexes were created multiple times sometimes in cases where a
primary key was set.
4) indexes were *not* created for unique columns.  technically not a
bug, but i can't see why you wouldn't want an index.  For small
tables, the cost of the inserting a record against an index is small -
it's a small table and there just aren't that many inserts.  For large
tables, the lack of an index means you're going to incur a table scan.

Again - this code is ugly and needs to be cleaned up a lot, but it's
working well enough for us against postgresql+psycopg2.  It doesn't
work on any other backend.

Test cases are in the tests/evolvedb/runtests.py script.

You'll need to symlink from
tests/evolvedbtests/db_settings/settings.py.postgresql script to
tests/evolvedbtests/backend_settings.py.

All the existing django tests seem to pass with my patches applied.

There's no documentation but there's ~40 odd tests checked into that
evolvedb tests directory.

Unfortunately, I'm pressed for time for the forseeable future and I
don't think I'll be able to spend a lot more time working on this
code.

vic

On 12/14/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> On 12/13/06, Steve Hutton <[EMAIL PROTECTED]> wrote:
>
> > Does it have a realistic chance of being accepted into core if it's found
> > to be bug free?  Is it fully documented?  Is the design controversial or
> > does it follow a community consensus?
>
> There was discussion about the general problem of schema evolution
> before the SOC project was started. The discussion was started by
> Jacob, and other committers (Luke and Malcolm) weighed in at the time,
> along with many other interested onlookers. The resulting design is on
> the wiki.
>
> Assuming that the implementation matches the proposal, I would say
> there is a realistic chance of it getting accepted into core. However,
> this would require that the implementation is up to date, and bug free
> (including tests to validate this status that are integrated into the
> Django system tests).
>
> Yours,
> Russ Magee %-)
>
> >
>


-- 
"Never attribute to malice that which can be adequately explained by
stupidity."  - Hanlon's Razor


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---


schema_evo.patch.gz
Description: GNU Zip compressed data


Tips/advice on model and application design?

2006-12-14 Thread Austin Govella

I'm new to Django, so I was looking for some advice on good model and
app design and on how that affects performance.

My first app has nine models, and after working with it for a bit, it
seems like it's actually two apps: one for meta data and another for
content management.

Are there any rules of thumb for when you should separate out some
functionality into its own app? Is there a certain number of models
that would suggest you probably have more than one app?

Is there any impact on Django's performance? I.e. is an app with four
models faster than an app with 20?

If I'm importing models from one app into another, is that
faster/slower than just having all the models in one app?

(In my case, I'd move the four meta data models to a separate app and
import just one of them into the content management app. Is this
actually slower than just keeping all the models in one single app?)



Thanks,
--
Austin Govella
Thinking & Making: IA, UX, and IxD
http://thinkingandmaking.com
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Template tags and contexts

2006-12-14 Thread PoBK

On Nov 13, 9:31 pm, "PoBK" <[EMAIL PROTECTED]> wrote:
> Umm guys,
>
> I think I'm being a bit dense this evening...
>
> I'm attempting to build set of template tags for some widget framework.
>
> The current way it works is:
>
> {% use_widget [pythonic path to widget] [args if required]%} tag loads
> a module/class. The class does it's magic, and and sets a load of
> variables in the context, to be rendered by the other tag {%
> render_widget_resources [type] %}.
>
> Ok, so I've got the first bit working wonderfully... the widget loads
> and it works perfectly.
>
> Now, the bit that isn't working is the resource rendering. I've hit a
> submerged rock, and I'm not entirely sure how to go about working my
> way around it.
>
> The particular rock I've struck is the context stack. That is for each
> {% block %} tag, the context gets pushed up the stack, and then popped
> at the {% endblock %}. So elements that I put in at one level are gone
> at the next. Which is a slight pain in the rear end.
>
> Anyone have any ideas about going about convincing the Django
> templating engine to play nice and give me back my variables when I
> want them? How do the context processors persist elements in throughout
> the stack?

*ping*

No ideas?

-- 
Richard


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Help with get absolute url

2006-12-14 Thread Waylan Limberg

This isn't working for you?

  {% for organisation in object.organisation_set.all %}
{{
organisation.org_name }}
  {% endfor %}

If the name works, but not get_absolute_url I'd say you have something
wrong with your model. Open a shell and play with you model to make
sure everything is working right.


-- 

Waylan Limberg
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: manage.py - "test" not a known action - how do I do unittests?

2006-12-14 Thread Waylan Limberg

On 12/14/06, Bob <[EMAIL PROTECTED]> wrote:
>
> Waylan -
> I have revision 4198, so that's okay, and my PYTHONPATH does not have
> anything about Django or site-packages in it at all.  However, when I
> run python and print sys.path, I see:
>
> ['', 'c:\\Python24\\lib\\site-packages\\setuptools-0.6c1-py2.4.egg',
> 'c:\\Python24\\lib\\site-packages\\django-0.95-py2.4.egg', ...
>
> I bet that egg is still referring to an earlier version.  Now I just
> need to figure out how that egg is getting on the path.
> - Bob
>
>
Anything in site-packages is automatically added to your path. That's
a python feature -  and the best place for third part packages. I
would suggest moving/deleting that egg. Until you do, you'll (almost)
always get that version of django.


-- 

Waylan Limberg
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: help with tagging app

2006-12-14 Thread Rob Slotboom

> >That's easy.

Hi Timm,

Okay, this is a very simple example :-)
But Luke Plant's Tagging App modell is realy a bit more comple.

See>>

http://groups-beta.google.com/group/django-users/browse_frm/thread/a7cbd4fd843583be/5ef4a59b78dbb2e1?lnk=gst&rnum=1&hl=nl#5ef4a59b78dbb2e1


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Schema Evolution code

2006-12-14 Thread Russell Keith-Magee

On 12/13/06, Steve Hutton <[EMAIL PROTECTED]> wrote:

> Does it have a realistic chance of being accepted into core if it's found
> to be bug free?  Is it fully documented?  Is the design controversial or
> does it follow a community consensus?

There was discussion about the general problem of schema evolution
before the SOC project was started. The discussion was started by
Jacob, and other committers (Luke and Malcolm) weighed in at the time,
along with many other interested onlookers. The resulting design is on
the wiki.

Assuming that the implementation matches the proposal, I would say
there is a realistic chance of it getting accepted into core. However,
this would require that the implementation is up to date, and bug free
(including tests to validate this status that are integrated into the
Django system tests).

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Re: Query returning all items with no M2M 'to_*_id' relationships

2006-12-14 Thread Russell Keith-Magee

On 12/12/06, naitsirhc <[EMAIL PROTECTED]> wrote:

> This seems to be working quite well, and stays generic enough to use
> for any M2M non-symmetrical field for a given model.  Any thoughts,
> comments, criticisms?

Obviously, it would be nice to be able to support this sort of thing
without having to resort to custom SQL and custom managers, but with
Django as-is, this looks like a reasonable enough solution to the
problem.

There was some recent talk about adding aggregate clauses to the
Django query language. With richer aggregates, 'orphan finding'
(amongst many other things) would be much easier; however, discussion
didn't get much further than the proposal phase.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Model inheritance

2006-12-14 Thread Russell Keith-Magee

On 12/14/06, Crispin Bennett <[EMAIL PROTECTED]> wrote:
>
> My first experiment with Django is a kind of wiki that involves being
> able to add a variety of different types of pages, each with their own
> set of fields. The obvious way to do this would be to create a base
> model page class which various page types inherit. But I can't imagine
> how the Django ORM layer handles this.
>
> Would I be barking up the wrong tree?

Yes and No.

Django does have the ability to do a sort of model inheritance, using
OneToOneFields. This establishes a 1-1 relationship between a base
class and a child class. For example:

class Base(Model):
   name = CharField()

class Article(Model):
   base = OneToOneField(MyBase)
   length = IntegerField()

class Author(Model):
   base = OneToOneField(MyBase)
   age = IntegerField()

In this case, each Article is required to reference a single Base
instance (likewise for Author). An article instance can ask for
base.name to get the name of the article; author.base.name will give
the name of the author.

Obviously, this is less than ideal, and there are a few gotchas - for
example, you have to manually create the base class instances.
However, it does work.

There is a work-in-progress to add a more formal inheritance structure
to Django - search the developers archives and the wiki for a detailed
discussion of the form this inheritance will take. This work is being
performed by Malcolm Treddinick.

Last time I heard from him, he was close, but not quite finished, and
there were a few issues in other areas holding him up. However, he's
been a bit quiet of late.

Malcolm? You still out there? How goes the struggle?

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: null ordering in mysql

2006-12-14 Thread DavidA

MC wrote:
> Problem:
> I order dates and null values in ascending order under MySQL. To my
> surprise, null values are listed first, then actual dates. Turns out
> that in MySQL, null values are LOWER than non-null values, whereas
> Postgresql is the reverse. As outlined here
> http://troels.arvin.dk/db/rdbms/#select-order_by, it seems the only way
> to reverse the order is by prepending a - sign and switching from ASC
> to DESC. Unfortunately, this is the same syntax Django uses for
> ordering!
>
> Solution:
> I couldn't think of an easy solution through the model API or using
> custom managers. I suppose I could write custom SQL, but it would be
> nicer to use the model API. I could use a default value like the year
> 3000 and filter for display. Any suggestions? Thanks for your help!

You could use extra() to add an expression column and then order by
that. Something like:

>>> s = Strategy.objects.all().extra(select={'mycol': 'case when name is null 
>>> then 1 else 0 end'}).order_by('mycol', 'name')

This adds a new column to the select using the case expression and
aliased to 'mycol' which you can then reference in the order_by()
clause. By making null's have a value of 1, it forces them to be sorted
below non-nulls.

-Dave


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: manage.py - "test" not a known action - how do I do unittests?

2006-12-14 Thread Bob

Waylan -
I have revision 4198, so that's okay, and my PYTHONPATH does not have
anything about Django or site-packages in it at all.  However, when I
run python and print sys.path, I see:

['', 'c:\\Python24\\lib\\site-packages\\setuptools-0.6c1-py2.4.egg',
'c:\\Python24\\lib\\site-packages\\django-0.95-py2.4.egg', ...

I bet that egg is still referring to an earlier version.  Now I just
need to figure out how that egg is getting on the path.
- Bob


On Dec 13, 3:27 pm, "Waylan Limberg" <[EMAIL PROTECTED]> wrote:
> On 12/13/06, Bob <[EMAIL PROTECTED]> wrote:
>
>
>
> > Don -
>
> > How do I check the revision?  import django; django.__version__ prints
> > '0.95' but not the revision number.On the command line from within your 
> > django_src directory do:
>
> svn info
>
> That should tell you the revision number among other info.
>
>
>
> > I just updated from svn with:
> > svn cohttp://code.djangoproject.com/svn/django/trunk/
> > but I still get the same behavior - manage.py doesn't know about
> > "test".Check to make sure your project is using the correct version of 
> > Django
> on your system. My guess is you have multiple copies and its using the
> wrong one.
>
> ./manage.py --version
>
> should return `0.96-pre` not 0.95
>
> Check your Pythonpath to make sure it's pointing at the right Django source.
> 
> --
> 
> Waylan Limberg
> [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread Aidas Bendoraitis
And what encoding is showed in the page info? ...when you right click
somewhere in the page and choose "View Page Info" from the menu. Maybe
just the default character encoding in your firefox settings is set
wrongly?

You can always override admin templates copying them into your
custom_templates/admin directory.

Regards,
Aidas Bendoraitis



On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> It's not my html page, but the django admin page.
>
> the head of admin page is like this:
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> http://www.w3.org/1999/xhtml"; lang="zh-cn" xml:lang="zh-cn" >
> 
> 站点管理员
>  href="/oj/adminmedia/css/dashboard.css" />
> 
>
> no encoding here, but lang = 'zh-cn'.
>
> and all chinese characters in my pages and mysql are encoded in UTF-8.
> Locale of my server is like this:
>
> LANG=zh_CN.UTF-8
> LANGUAGE=zh_CN:zh:en_US:en
> LC_CTYPE="zh_CN.UTF-8"
> LC_NUMERIC="zh_CN.UTF-8"
> LC_TIME="zh_CN.UTF-8"
> LC_COLLATE="zh_CN.UTF-8"
> LC_MONETARY="zh_CN.UTF-8"
> LC_MESSAGES="zh_CN.UTF-8"
> LC_PAPER="zh_CN.UTF-8"
> LC_NAME="zh_CN.UTF-8"
> LC_ADDRESS="zh_CN.UTF-8"
> LC_TELEPHONE="zh_CN.UTF-8"
> LC_MEASUREMENT="zh_CN.UTF-8"
> LC_IDENTIFICATION="zh_CN.UTF-8"
> LC_ALL=
>
>
> On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > It might be that it treats new lines as \r\n when you are using some
> > windows-* encoding for your html pages. Check the source code. I would
> > rather use UTF-8 in any case.
> >
> > Regards
> > Aidas Bendoraitis [aka Archatas]
> >
> >
>
> --
> Yours, Zhongke Chen 陈忠克
>
> >
>

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread zhongke chen
It's not my html page, but the django admin page.

the head of admin page is like this:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; lang="zh-cn" xml:lang="zh-cn" >

站点管理员



no encoding here, but lang = 'zh-cn'.

and all chinese characters in my pages and mysql are encoded in UTF-8.
Locale of my server is like this:

LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh:en_US:en
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=


On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> It might be that it treats new lines as \r\n when you are using some
> windows-* encoding for your html pages. Check the source code. I would
> rather use UTF-8 in any case.
>
> Regards
> Aidas Bendoraitis [aka Archatas]
>
>

-- 
Yours, Zhongke Chen 陈忠克

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: ImageField: Unique with number, not underscore?

2006-12-14 Thread [EMAIL PROTECTED]

Hi.

Terji7 schrieb:
> Oliver Lavery wrote:
> > It seems that the most obvious way would be to alter _save_FIELD_file in
> > django/db/models/base.py ~ line 335.
[...]
>
> That sounds like a horrible way to me. Rather use the save() method in
> the models:

The uploaded image file is being saved by a form manipulator, not by my
implementation.
Would that also trigger my modified save method? And would just
updating self.name on the model also automagically rename the file?

Sorry if I'm sounding ignorant here

Daniel


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Django on a server with thin clients

2006-12-14 Thread Lars Stavholm

Joseph Heck wrote:
> You can avoid the test database issue by having the students use SQLite as
> the database backend. They can store the database in their home directories
> and be good to go.
> 
> -joe

In addition, depending on your thin client solution, if you start
tracd locally on your thin client (the actual binary file is on the
server, but the process runs on the local CPU), then it is of course
local and you can use the default port number for each student.
This method of starting applications is available in the LTSP thin
client solution, and it might/should be available in other solutions.
/L

> On 12/13/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>>
>> This is going to sound like an odd question, but I'm hoping people will
>> have some ideas.
>>
>> I teach CS in a high school, and next semester my lab is going to be
>> replaced with a thin client lab running on Ubuntu. My seniors and I are
>> working on a Django project and will all be trying to run the
>> development server on different clients of what is, for all practical
>> purposes, the same box.
>>
>> I've identified two potential problems:
>>
>> * everyone will need to be assigned a port number to use (I'm
>> thinking 8000 + n, where n is the computer number in the lab)
>>
>> * we'll need to set up separate test databases for each developer
>> (not sure how to do that so that Subversion doesn't get annoyed
>> at having settings.py changed every 2 seconds, yet, but I'll get
>> it)
>>
>> Are there any other gotchas that people can think of offhand?
>>
>> I have some time over break to try to get some infrastructure in place
>> to forestall potential problems, so any heads-up anyone can give me
>> would be very appreciated.
>>
>> Thanks,
>> Todd
>>
>>
> 
> 
> > 


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Help with get absolute url

2006-12-14 Thread conrad22

In other words, why can't I simply put

{{organisation.get_absolute_url}}

to return the organisation's detail page?

Surely the whole point of the get_absolute_url is to be able to call an
object from wherever?
So what would I put in the model and/or urls.py to be able to do this?
At the moment I just
have:

   def get_absolute_url(self):
return self.slug

for the Organisation model.?

Can't I just define this further?

With thanks in advance


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



null ordering in mysql

2006-12-14 Thread MC

Problem:
I order dates and null values in ascending order under MySQL. To my
surprise, null values are listed first, then actual dates. Turns out
that in MySQL, null values are LOWER than non-null values, whereas
Postgresql is the reverse. As outlined here
http://troels.arvin.dk/db/rdbms/#select-order_by, it seems the only way
to reverse the order is by prepending a - sign and switching from ASC
to DESC. Unfortunately, this is the same syntax Django uses for
ordering!

Solution:
I couldn't think of an easy solution through the model API or using
custom managers. I suppose I could write custom SQL, but it would be
nicer to use the model API. I could use a default value like the year
3000 and filter for display. Any suggestions? Thanks for your help!


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: alternatives to edit_inline

2006-12-14 Thread patrick k.

I´m also interested in this extension.

does anyone has some information?

thanks,
patrick

Am 13.12.2006 um 23:35 schrieb Justin:

>
> It looks like this edit_external option may be what you're looking  
> for:
> http://code.djangoproject.com/ticket/1476
>
> Does anyone know if this enhancement is in the works? It would be
> really neat.
>
>
> >


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---