New invented car options

2007-10-25 Thread Ahmed

New invented car options
http://dream-cars.bravehost.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: translation and flatpages

2007-10-25 Thread Malcolm Tredinnick

On Thu, 2007-10-25 at 23:25 -0700, AniNair wrote:
> Cannot internationalize them?

It's generally considered polite to wait a bit more than 16 hours before
posting a "hurry up" repost when nobody has responded.

There is no core Django support for translating content stored in the
database. Do a google search for django-multilingual for one
alternative.

Regards,
Malcolm

-- 
Many are called, few volunteer. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: translation and flatpages

2007-10-25 Thread AniNair

Cannot internationalize them?


--~--~-~--~~~---~--~~
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: Entering Greek, cyrillic, or other 'weird' text

2007-10-25 Thread Kenneth Gonsalves


On 26-Oct-07, at 10:49 AM, Robert Bunting wrote:

>> so is this a legacy database - meaning a database which had data
>> before you upgraded to unicode django? In that case, we have seen in
>> postgres that the old data is b0rked and needs to be reentered,
>> otherwise it wont work. You need to either re-enter the data or write
>> scripts to transform the b0rked data.
>>
>
> That sounds rather worrying, from someone who has a big database and
> will soon be upgrading to unicode django.  Do you have any more
> details?  Was it simply due to a database encoding change (in which
> case databases which are already in utf-8 should be ok?), or did you
> hit some more fundamental problem?

my database was unicode from the begining. After upgrading to the  
unicode revision, many (not all) non-ascii characters stopped  
rendering properly. They would render on the web page, but not on the  
admin pages. This was in finnish, particularly the letter ä. We had  
to re enter all the data that had these characters. The same problem  
happened for a set of polish sites - here there was a huge amount of  
data, so the owner shifted from postgres to sqllite to solve the  
problem. I have some sites in Indian languages which were not  
affected however.

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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: static images with built-in django server

2007-10-25 Thread girzel

Me too, I can't get this to work and it's driving me crazy. My main
problem seems to be that Django is looking inside the Django site
package within my Python framework for the media (when I try to load
an image directly, for instance, it tells me "Page not found: /Library/
Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/
django/contrib/admin/media/img/image.gif") and I don't know how to
tell it to look in my site installation instead of python.

I'm using Python 2.5, Mac OSX, the svn version of Django, my
development server runs at http://127.0.0.1:8000/

In template I've tried:
http://127.0.0.1:8000/media/img/image.gif";>
and


In the site package urls I've got:
(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': 'media'})
I also tried writing out document_root as the full absolute path to
the media directory on my computer.

MEDIA_ROOT = './media/' (relative path from settings.py, I also tried
a full absolute path)
MEDIA_URL = 'media/'

for completeness' sake, the absolute path to my media folder ought to
be /Users//Documents/Django//media/

I tried all the above in various configurations. It's voodoo at this
point and the gods are not smiling. If anyone can see what my problem
is I'd be very grateful for a pointer...

Thanks,
Eric


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



AsianAirfares.com Beats Closest Competitor 6 Out of 10 in International Travel Comparison

2007-10-25 Thread [EMAIL PROTECTED]

 AsianAirfares.com Beats Closest Competitor 6 Out of 10 in
International Travel Comparison


AsianAirfares.com Beats Closest Competitor 6 out of 10 in
International Travel Comparison (Car Rentals, Hotels, Air Tickets,
Cruises).

New York, NY, October 24, 2007 --(PR.com)-- AsianAirfares.com,
http://www.asianairfares.com/ the recently launched Web site for low
prices in international Travel, today released results from an
independent, third party audit of online travel sites.

The study reported AsianAirfares.com as having some of the lowest
international travel deals on Car Rentals, Hotels, Airfares and
Cruises versus top Asian US and European Internet travel web sites.

AsianAirfares.com returned a lower Car Rentals, Hotels Rates and
International Airfares nearly twice as its closest competition.

Global air traffic is set to be boosted in the next three years by a
rise in travel between US, Europe and Asia, thanks to growth in both
China and India.

The booming economies of China and India are set to fuel growth in
passenger numbers. We are seeing the emergence of India and China as
the major economic forces in the region. They will lead the next surge
in travel.

AsianAirfares.com is already providing its Global Consumers with a
different kind of travel website experience and saving them time and
money with a quick and easy way when booking.

Book your next travel with AsianAirfares.com and make your new
experience as pleasant as possible

About Asianairfares.com
AsianAirfares.com http://www.asianairfares.com/ invites you to
discover their new online travel reservation system designed to save
time and money. Now visitors to AsianAirfares.com can shop 24/7 for
the best possible travel deals on hotel rooms, last-minute vacation
packages, car rentals, cruises, airline tickets, and travel insurance.

Travelers can select from over 55,000 hotels and resorts worldwide
including 12,000+ Hot Rate hotels, 28 car rental companies, all major
cruise lines and hundreds of airlines to book travel services
instantly and securely.

Through broad choices, low prices and excellent customer service,
AsianAirfares.com and its wholly- owned subsidiaries -
IndianAirfares.com, ValueAirtickets.com, AsianAirtickets.com,
ValueAirlines.com , and NewAirtickets.com- (currently in Development)
Can take you to where you want to go.


--~--~-~--~~~---~--~~
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: Entering Greek, cyrillic, or other 'weird' text

2007-10-25 Thread Robert Bunting


On Oct 24, 10:27 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:

> so is this a legacy database - meaning a database which had data
> before you upgraded to unicode django? In that case, we have seen in
> postgres that the old data is b0rked and needs to be reentered,
> otherwise it wont work. You need to either re-enter the data or write
> scripts to transform the b0rked data.
>

That sounds rather worrying, from someone who has a big database and
will soon be upgrading to unicode django.  Do you have any more
details?  Was it simply due to a database encoding change (in which
case databases which are already in utf-8 should be ok?), or did you
hit some more fundamental problem?


--~--~-~--~~~---~--~~
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: Scaling the server

2007-10-25 Thread simonbun

> Well, I have another server available now ;)

And you're using it for serving static content I hope? Your previous
setup with Apache serving everything with KeepAlive off can bring many
a server to its knees. If you serve a html page with for example 30
css, js and image files, you make a single request that needs 31 free
Apache processes. This will usually mean spawning quite a bit of extra
processes, which is somewhat costly in terms of CPU usage. On top of
that, all of those processes load all enabled Apache libraries and
usually end up consuming quite a bit of memory (especially with
mod_python as a static module).

I think you'll see a great performance boost if you let Lighttpd or
Nginx handle your static files. In which case (and imho only case) you
can have Apache's KeepAlive set to off.

In fact, I don't think you absolutely need a second physical server
for serving the static content. Unless serving files is quite a big
part of your operation of course. Do some stress tests with Lighttpd
or Nginx running alongside Apache and see how the server holds out.

Regards,
Simon


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



authentication on generic views

2007-10-25 Thread Mike Maravillo
Hi,

I'm using the django.views.generic.list_detail.object_list generic view
because of the handy pagination.  However, I need to have the user
accessing the page to be authenticated first.  Is there any other way
than doing the check on the template?  Thanks very much.

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: elance'in django programmers

2007-10-25 Thread [EMAIL PROTECTED]

Well the more skills you have as a programmer... the more work is
available to you... but also the more skills you have...the more you
expect to be paid.

Someone that knows only PHP ... or only knows Flash Actionscript,
etc shouldn't expect to get paid as much as a developer who is
knowledgeable in many languages.  Similarly, a newbie programmer with
only a few months experience, or no 'professional' experience,
shouldn't expect to be paid the same as a developer with many years of
software/web application development experience under their belt.

On Oct 25, 10:42 pm, Roboto <[EMAIL PROTECTED]> wrote:
> That's true, I didn't think about this at first - it's difficult to
> make it as a programmer with market dilution.
>
> On Oct 25, 10:38 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
>
> > Speaking as someone who's tried their hand at both sides of the coin,
> > I definitely agree with you, Ross. I'm currently employed, but when I
> > was trying to make it as a contractor (because a job fell through), I
> > couldn't land a single job because of the market dillution. Working in
> > PHP as I was, I found that I was competing against high school and
> > college students, whose bills are paid by their parents, and can
> > afford to spend weeks on end getting paid next to nothing. And yes,
> > the quality of their work showed.
>
> > The trouble with most good developers is that they're not willing to
> > work for cheap change. And it often has little to do with getting paid
> > appropriately for their skill level. For me, and many others, the high
> > price is necessary because we have families and mortgages to support.
> > Contracting for a low price is only good for a certain type of people,
> > and that pool doesn't contain very many quality developers.
>
> > Just keep in mind that contractors don't have an endless pool of jobs
> > to choose from, where they can just pick whatever price they feel
> > like. They have to make sure that each job can sustain them until they
> > secure another job. It's not a fun way to live unless you're already
> > very well established.
>
> > -Gul


--~--~-~--~~~---~--~~
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: LimitRequestBody 102400

2007-10-25 Thread Roboto

Actually, yea I'm using mod_python right now.


On Oct 25, 10:25 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Oct 26, 11:15 am, Roboto <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I'm trying to stop people from uploading like 3mb images and crashing
> > the server.  I think, think, that to some degree my limiters are
> > working.  In my apache config I've set LimitRequestBody 307200.  That
> > should be about 300k.  Now when I upload an image greater than that, I
> > can see that Apache cuts it off somehow, and then I get a 404 error
> > page mixed in with a 500 error for some reason.
>
> > Is it working as intended?  How do I get control over what is occuring?
>
> Are you using mod_python to host Django? If so, you may be hitting
> mod_python bug described in:
>
>  https://issues.apache.org/jira/browse/MODPYTHON-240
>
> Although not sure why you are getting 404 unless your Apache can't
> find its standard 500 error document or something and is then trying
> to raise a 404 error for it.
>
> If you are using mod_python, you might look at mod_wsgi instead as it
> implements support for LimitRequestBody correctly.
>
> Graham


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread Roboto

That's true, I didn't think about this at first - it's difficult to
make it as a programmer with market dilution.

On Oct 25, 10:38 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> Speaking as someone who's tried their hand at both sides of the coin,
> I definitely agree with you, Ross. I'm currently employed, but when I
> was trying to make it as a contractor (because a job fell through), I
> couldn't land a single job because of the market dillution. Working in
> PHP as I was, I found that I was competing against high school and
> college students, whose bills are paid by their parents, and can
> afford to spend weeks on end getting paid next to nothing. And yes,
> the quality of their work showed.
>
> The trouble with most good developers is that they're not willing to
> work for cheap change. And it often has little to do with getting paid
> appropriately for their skill level. For me, and many others, the high
> price is necessary because we have families and mortgages to support.
> Contracting for a low price is only good for a certain type of people,
> and that pool doesn't contain very many quality developers.
>
> Just keep in mind that contractors don't have an endless pool of jobs
> to choose from, where they can just pick whatever price they feel
> like. They have to make sure that each job can sustain them until they
> secure another job. It's not a fun way to live unless you're already
> very well established.
>
> -Gul


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread Marty Alchin

Speaking as someone who's tried their hand at both sides of the coin,
I definitely agree with you, Ross. I'm currently employed, but when I
was trying to make it as a contractor (because a job fell through), I
couldn't land a single job because of the market dillution. Working in
PHP as I was, I found that I was competing against high school and
college students, whose bills are paid by their parents, and can
afford to spend weeks on end getting paid next to nothing. And yes,
the quality of their work showed.

The trouble with most good developers is that they're not willing to
work for cheap change. And it often has little to do with getting paid
appropriately for their skill level. For me, and many others, the high
price is necessary because we have families and mortgages to support.
Contracting for a low price is only good for a certain type of people,
and that pool doesn't contain very many quality developers.

Just keep in mind that contractors don't have an endless pool of jobs
to choose from, where they can just pick whatever price they feel
like. They have to make sure that each job can sustain them until they
secure another job. It's not a fun way to live unless you're already
very well established.

-Gul

--~--~-~--~~~---~--~~
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: Error with Psycopg2: argument of type _QuerySet is not iterable

2007-10-25 Thread [EMAIL PROTECTED]

>> TypeError: argument of type '_QuerySet' is not iterable

> So what is dir(User.objects.filter(...)) telling you? Does it have an
> __iter__ method? Does it look at all like a QuerySet? What version of
> Django and pysopg2 are you using?

I'm using Django Development and Psycopg 2.0.6.

Here's the dir(), and it does have an __iter__ method:

['__and__', '__class__', '__delattr__', '__dict__', '__doc__',
'__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__',
'__len__', '__module__', '__new__', '__or__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__',
'_clone', '_combine', '_distinct', '_filter_or_exclude', '_filters',
'_get_data', '_get_sql_clause', '_limit', '_max_related_depth',
'_offset', '_order_by', '_params', '_result_cache', '_select',
'_select_related', '_tables', '_where', 'complex_filter', 'count',
'create', 'dates', 'delete', 'distinct', 'exclude', 'extra', 'filter',
'get', 'get_or_create', 'in_bulk', 'iterator', 'latest', 'model',
'order_by', 'select_related', 'values']

I'll work on reproducing it outside of my app; If I can easily
reproduce it, I'll post it to Django Developers. 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: LimitRequestBody 102400

2007-10-25 Thread Graham Dumpleton

On Oct 26, 11:15 am, Roboto <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I'm trying to stop people from uploading like 3mb images and crashing
> the server.  I think, think, that to some degree my limiters are
> working.  In my apache config I've set LimitRequestBody 307200.  That
> should be about 300k.  Now when I upload an image greater than that, I
> can see that Apache cuts it off somehow, and then I get a 404 error
> page mixed in with a 500 error for some reason.
>
> Is it working as intended?  How do I get control over what is occuring?

Are you using mod_python to host Django? If so, you may be hitting
mod_python bug described in:

  https://issues.apache.org/jira/browse/MODPYTHON-240

Although not sure why you are getting 404 unless your Apache can't
find its standard 500 error document or something and is then trying
to raise a 404 error for it.

If you are using mod_python, you might look at mod_wsgi instead as it
implements support for LimitRequestBody correctly.

Graham


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Basic User-Admin Questions

2007-10-25 Thread Adam D.

I am building a site in which there are many users, who will have
there own mini-site, where they can manage contacts, todo lists, etc.

The django admin interface is used to administer the 'entire' site. So
I assume there wouldn't be many 'user-admin' implementations. How
would I create a user-admin section for each user that would need
basic features such as...

I essentially don't need the super-user admin, I need many user
account admins, at the user level.

User Logs In >User has several options (apps) > User can manage a ToDo
list (CRUD) and manage there account settings, etc.

I know these thoughts are farely fragmented. I hope this makes sense...


--~--~-~--~~~---~--~~
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 let some users manage other users

2007-10-25 Thread [EMAIL PROTECTED]

> The  problem is then that I want some users to be able to create new accounts,
> but only see or edit accounts that they themselves have created.

If you're trying to do it through the admin app, you'll probably not
be able to pull if off since the admin doesn't have row-level
permissions.

Are you looking at using the Users model from the auth app? If so, I'd
suggest looking at the Groups app with it. I'd probably create a
special page (login_required) that would allow that parent user to add/
edit/delete users in their own group. This would keep "bar"'s accounts
from modify "foo"'s. This would also let you get an even finger-
grained control and only let users edit accounts they have created.

The execution might be a little tricky; you'll probably need to use a
user profile model to attach the extra metadata to a user w/o
modifying Django's contrib auth app. (Editing core is the path to
darkness for me) This way you could assign the necessary extra data to
a user - what user created them, if it is a "parent" account, etc. It
won't be hard, but the devil is in the details of setting up the user
profile models. James Bennett has done some great work in this area
that you might want to check out. (look at b-list.org)

This may not be the best approach, but it's the first to come to mind.
I hope this helps.

Scott


--~--~-~--~~~---~--~~
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 would you cache a view that will never change?

2007-10-25 Thread [EMAIL PROTECTED]

> maybe I'm a bit confused (or tired) but
> how would you go and cache a view that will *never*
> change depending on a request on my application?

Is the output something difficult for the view to generate? If not,
you could just specify a very long cache expiration and let it
regenerate itself as needed. If you're using memcached, it's going to
be stored in RAM and is subject to being wiped out if the process
restarts, so you really can't rely on  it being there. If it is an
expensive view to process, the next request after the cache expiry
would be an unlucky visitor; this may not be a great option in that
case.

> If I read the manual right, I have to give a timeout to
> all the cache functions that are available. In my case I have
> a view that will never change... so I don't really
> know how to do this.

If you *really* need it to write once, you could write a couple of
methods that will write and load the output to/from the file system.
At the beginning of your view, you could use the getter method to look
on the filesystem for the file the same way the cache api does a
lookup. (Keep in mind that filesystem lookups are going to incur more
I/O latency than Memcached)

FWIW, If you do follow this route, I'd suggest putting the filesystem
path in your settings file to make the application more portable.

Hope this helps.


--~--~-~--~~~---~--~~
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: Admin error trying to run Django 91& 97 on same hostname w/different ports

2007-10-25 Thread [EMAIL PROTECTED]



On Oct 24, 11:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I'm running Django 91 and 97 on my development server with different
> port numbers and I'm getting admin errors when I log in to the 91
> sites. If I hit refresh enough times, eventually it works.

In case anyone is having the same problem, it appears that my 91 and
97 sites both using Psycopg in the same Apache process didn't like
each other. When I changed the 97 site to use Psycopg2, I could not
reproduce the problem.

This sure isn't a definitive answer, but it's a step in the right
direction.


--~--~-~--~~~---~--~~
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 Admin - Strange Problem with Permissions and Groups

2007-10-25 Thread [EMAIL PROTECTED]

> I've tried adding the permissions directly to the user, I've also
> tried added the user to a group and giving the group the permissions
> but in either case, when I log in with the user into the Django admin,
> I get "You don't have permission to edit anything." for that user.

Have you tried giving the user superuser status to see if that works?
This might help narrow it down.

> I've checked in the database and the permissions are in
> there. It then seems to me that this must have to do with the logging
> in process.

Have you tried going through the shell and seeing if it sees the
permissions?

i.e.

>>> from django.contrib.auth.models import User
>>> u = User.objects.get(username__exact='username')
>>> u.user_permissions.all()


--~--~-~--~~~---~--~~
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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Kristinn Örn Sigurðsson
Sorry if I wasn't clear about what I was talking about. :-)
I'm using Darwin ports. They work similar to BSD ports (completely different
but the idea is probably from there). With that you can install alot of *nix
applications. The homepage for Darwin ports is http://darwinports.com/.
Darwin ports installs everything to a new location, /opt/local, so it won't
interrupt the base MacOSX system. Fink which is an apt-get workalike is also
a good package manager. You can probably install everything from there as
well. Fink installs everything under /sw (you can change it).

I installed postgresql, psycopg, and python through Darwin ports. The only
thing I need to do to make the system use python from Darwin ports over the
MacOSX version of python is by putting /opt/local/bin and /opt/local/sbin
before /usr/bin and /usr/sbin in the PATH variable in my .profile (for my
shell environment). This is very handy, now I will never have problems
updating python, postgresql and psycopg because I can update all installed
applications (from Darwin ports) with one command. Everything worked fine
after I installed those things. The only thing I had to do was to get the
svn version of Django and it just worked. :-)

Hope this helps.

Kristinn.

On 10/26/07, Matthew Wensin <[EMAIL PROTECTED]> wrote:
>
>  Can you elaborate on "just install and update your python version through
> ports and install everything you need from there"?
>
> I'm using Python 2.5 (from here: http://pythonmac.org/packages/)--do you
> mean Python 2.5.1?
>
> Matt
>
>
> On 10/25/07 9:09 PM, "Kristinn Örn Sigur›sson" <
> [EMAIL PROTECTED]> wrote:
>
> That's too much of a hack when you can just install and update your python
> version through ports and install everything you need from there, without
> touching the MacOSX system itself. I guess you can use /usr/local without
> destroying the OSX, but still... I think the ports way is better. :-)
>
> Just my 2 cents.
>
> On 10/26/07, *Matthew Wensin* <[EMAIL PROTECTED]
>  <[EMAIL PROTECTED]> > wrote:
>
>
> I've dealt with that exact error before, just yesterday, incidentally.
>  What
> I did to fix:
>
> $ locate libpq.5
>
> If this returns nothing, try running:
>
> $ sudo /usr/libexec/locate.updatedb
>
> And then $ locate libpq.5 again.
>
> Go to the directory containing libpq.5 (for me it was
> /usr/local/pgsql/lib,
> and create a symlink called libpq.4.dylib to point to it, like so:
>
> /usr/local/pgsql/lib username$ sudo ln -s libpq.5.0.dylib libpq.4.dylib
>
> See if that helps.  Worked for me.
>
> Matt
>
>
>
> On 10/25/07 6:58 PM, "Frank" < [EMAIL PROTECTED]> wrote:
>
> >
> > All-
> >
> > Having a rough go getting database bindings in OS X.
> >
> > I've installed psycopg2 using the package here:
> >
> http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4.
> > zip
> >
> > When I run 'python manage.py shell' I get the following... any ideas
> > on how to fix this?
> >
> > Traceback (most recent call last):
> >   File "manage.py", line 11, in 
> > execute_manager(settings)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/__init__.py", line 275,
> > in execute_manager
> > utility.execute()
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/__init__.py", line 225,
> > in execute
> > self.fetch_command(subcommand).run_from_argv( self.argv)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 70, in
> > run_from_argv
> > self.execute(*args, **options.__dict__)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 84, in
> > execute
> > output = self.handle(*args, **options)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 166, in
> > handle
> > return self.handle_noargs(**options)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/commands/shell.py",
> > line 17, in handle_noargs
> > from django.db.models.loading import get_models
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/db/__init__.py", line 17, in 
> > backend = __import__('%s%s.base' % (_import_path,
> > settings.DATABASE_ENGINE), {}, {}, [''])
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/db/backends/postgresql_psycopg2/
> > base.py ", line 14, in 
> > raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> > e)
> > django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> > module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/psycopg2/_psycopg.so, 2): Libr

How would you cache a view that will never change?

2007-10-25 Thread Kai Kuehne

Hi list,
maybe I'm a bit confused (or tired) but
how would you go and cache a view that will *never*
change depending on a request on my application?

If I read the manual right, I have to give a timeout to
all the cache functions that are available. In my case I have
a view that will never change... so I don't really
know how to do this.

I think I'd need something like caches_page like
in rails where it generates an html file and stays
there *till* I explicitly say it can be removed.

Has anybody of you built something similar for django?
Thanks for 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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Matthew Wensin
Can you elaborate on “just install and update your python version through
ports and install everything you need from there”?

I’m using Python 2.5 (from here: http://pythonmac.org/packages/)--do you
mean Python 2.5.1?

Matt


On 10/25/07 9:09 PM, "Kristinn Örn Sigur›sson"
<[EMAIL PROTECTED]> wrote:

> That's too much of a hack when you can just install and update your python
> version through ports and install everything you need from there, without
> touching the MacOSX system itself. I guess you can use /usr/local without
> destroying the OSX, but still... I think the ports way is better. :-)
> 
> Just my 2 cents.
> 
> On 10/26/07, Matthew Wensin <[EMAIL PROTECTED]  
> > wrote:
>> 
>> I've dealt with that exact error before, just yesterday, incidentally.  What
>> I did to fix:
>> 
>> $ locate libpq.5
>> 
>> If this returns nothing, try running:
>> 
>> $ sudo /usr/libexec/locate.updatedb
>> 
>> And then $ locate libpq.5 again.
>> 
>> Go to the directory containing libpq.5 (for me it was /usr/local/pgsql/lib,
>> and create a symlink called libpq.4.dylib to point to it, like so:
>> 
>> /usr/local/pgsql/lib username$ sudo ln -s libpq.5.0.dylib libpq.4.dylib
>> 
>> See if that helps.  Worked for me.
>> 
>> Matt
>> 
>> 
>> 
>> On 10/25/07 6:58 PM, "Frank" < [EMAIL PROTECTED]> wrote:
>> 
>>> >
>>> > All-
>>> >
>>> > Having a rough go getting database bindings in OS X.
>>> >
>>> > I've installed psycopg2 using the package here:
>>> > 
>>> 
http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.>>>
4.
>>> > zip
>>> >
>>> > When I run 'python manage.py shell' I get the following... any ideas
>>> > on how to fix this?
>>> >
>>> > Traceback (most recent call last):
>>> >   File "manage.py", line 11, in 
>>> > execute_manager(settings)
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/core/management/__init__.py", line 275,
>>> > in execute_manager
>>> > utility.execute()
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/core/management/__init__.py", line 225,
>>> > in execute
>>> > self.fetch_command(subcommand).run_from_argv( self.argv)
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/core/management/base.py", line 70, in
>>> > run_from_argv
>>> > self.execute(*args, **options.__dict__)
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/core/management/base.py", line 84, in
>>> > execute
>>> > output = self.handle(*args, **options)
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/core/management/base.py", line 166, in
>>> > handle
>>> > return self.handle_noargs(**options)
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/core/management/commands/shell.py",
>>> > line 17, in handle_noargs
>>> > from django.db.models.loading import get_models
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/db/__init__.py", line 17, in 
>>> > backend = __import__('%s%s.base' % (_import_path,
>>> > settings.DATABASE_ENGINE), {}, {}, [''])
>>> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/django/db/backends/postgresql_psycopg2/
>>> > base.py ", line 14, in 
>>> > raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
>>> > e)
>>> > django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
>>> > module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> > python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /
>>> > usr/local/pgsql/lib/libpq.4.dylib
>>> >   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
>>> > lib/python2.5/site-packages/psycopg2/_psycopg.so
>>> >   Reason: image not found
>>> >
>>> >
 > >
>> 
>> 
>> 
>> 
> 
>  
> 
> > 
> 



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



LimitRequestBody 102400

2007-10-25 Thread Roboto

Hi All,

I'm trying to stop people from uploading like 3mb images and crashing
the server.  I think, think, that to some degree my limiters are
working.  In my apache config I've set LimitRequestBody 307200.  That
should be about 300k.  Now when I upload an image greater than that, I
can see that Apache cuts it off somehow, and then I get a 404 error
page mixed in with a 500 error for some reason.

Is it working as intended?  How do I get control over what is occuring?


--~--~-~--~~~---~--~~
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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Kristinn Örn Sigurðsson
That's too much of a hack when you can just install and update your python
version through ports and install everything you need from there, without
touching the MacOSX system itself. I guess you can use /usr/local without
destroying the OSX, but still... I think the ports way is better. :-)
Just my 2 cents.

On 10/26/07, Matthew Wensin <[EMAIL PROTECTED]> wrote:
>
>
> I've dealt with that exact error before, just yesterday,
> incidentally.  What
> I did to fix:
>
> $ locate libpq.5
>
> If this returns nothing, try running:
>
> $ sudo /usr/libexec/locate.updatedb
>
> And then $ locate libpq.5 again.
>
> Go to the directory containing libpq.5 (for me it was
> /usr/local/pgsql/lib,
> and create a symlink called libpq.4.dylib to point to it, like so:
>
> /usr/local/pgsql/lib username$ sudo ln -s libpq.5.0.dylib libpq.4.dylib
>
> See if that helps.  Worked for me.
>
> Matt
>
>
>
> On 10/25/07 6:58 PM, "Frank" <[EMAIL PROTECTED]> wrote:
>
> >
> > All-
> >
> > Having a rough go getting database bindings in OS X.
> >
> > I've installed psycopg2 using the package here:
> >
> http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4
> .
> > zip
> >
> > When I run 'python manage.py shell' I get the following... any ideas
> > on how to fix this?
> >
> > Traceback (most recent call last):
> >   File "manage.py", line 11, in 
> > execute_manager(settings)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/__init__.py", line 275,
> > in execute_manager
> > utility.execute()
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/__init__.py", line 225,
> > in execute
> > self.fetch_command(subcommand).run_from_argv(self.argv)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 70, in
> > run_from_argv
> > self.execute(*args, **options.__dict__)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 84, in
> > execute
> > output = self.handle(*args, **options)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 166, in
> > handle
> > return self.handle_noargs(**options)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/commands/shell.py",
> > line 17, in handle_noargs
> > from django.db.models.loading import get_models
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/db/__init__.py", line 17, in 
> > backend = __import__('%s%s.base' % (_import_path,
> > settings.DATABASE_ENGINE), {}, {}, [''])
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/db/backends/postgresql_psycopg2/
> > base.py", line 14, in 
> > raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> > e)
> > django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> > module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /
> > usr/local/pgsql/lib/libpq.4.dylib
> >   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
> > lib/python2.5/site-packages/psycopg2/_psycopg.so
> >   Reason: image not found
> >
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Matthew Wensin

I've dealt with that exact error before, just yesterday, incidentally.  What
I did to fix:

$ locate libpq.5

If this returns nothing, try running:

$ sudo /usr/libexec/locate.updatedb

And then $ locate libpq.5 again.

Go to the directory containing libpq.5 (for me it was /usr/local/pgsql/lib,
and create a symlink called libpq.4.dylib to point to it, like so:

/usr/local/pgsql/lib username$ sudo ln -s libpq.5.0.dylib libpq.4.dylib

See if that helps.  Worked for me.

Matt



On 10/25/07 6:58 PM, "Frank" <[EMAIL PROTECTED]> wrote:

> 
> All-
> 
> Having a rough go getting database bindings in OS X.
> 
> I've installed psycopg2 using the package here:
> http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4.
> zip
> 
> When I run 'python manage.py shell' I get the following... any ideas
> on how to fix this?
> 
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/__init__.py", line 275,
> in execute_manager
> utility.execute()
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/__init__.py", line 225,
> in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 70, in
> run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 84, in
> execute
> output = self.handle(*args, **options)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 166, in
> handle
> return self.handle_noargs(**options)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/commands/shell.py",
> line 17, in handle_noargs
> from django.db.models.loading import get_models
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/db/__init__.py", line 17, in 
> backend = __import__('%s%s.base' % (_import_path,
> settings.DATABASE_ENGINE), {}, {}, [''])
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/db/backends/postgresql_psycopg2/
> base.py", line 14, in 
> raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> e)
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /
> usr/local/pgsql/lib/libpq.4.dylib
>   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
> lib/python2.5/site-packages/psycopg2/_psycopg.so
>   Reason: image not found
> 
> 
> > 


--~--~-~--~~~---~--~~
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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Kristinn Örn Sigurðsson
I'm sorry. I'm using version 1 of psycopg. If I fire up a python shell I can
import it as "import psycopg". Hope that helps.

On 10/25/07, Francis Lavoie <[EMAIL PROTECTED]> wrote:
>
>
> have you tried to import the module into python directly?
>
>
>
> Le 07-10-25 à 18:58, Frank a écrit :
>
> >
> > All-
> >
> > Having a rough go getting database bindings in OS X.
> >
> > I've installed psycopg2 using the package here:
> > http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-
> > macosx10.4.zip
> >
> > When I run 'python manage.py shell' I get the following... any ideas
> > on how to fix this?
> >
> > Traceback (most recent call last):
> >   File "manage.py", line 11, in 
> > execute_manager(settings)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/__init__.py", line 275,
> > in execute_manager
> > utility.execute()
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/__init__.py", line 225,
> > in execute
> > self.fetch_command(subcommand).run_from_argv(self.argv)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 70, in
> > run_from_argv
> > self.execute(*args, **options.__dict__)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 84, in
> > execute
> > output = self.handle(*args, **options)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/base.py", line 166, in
> > handle
> > return self.handle_noargs(**options)
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/core/management/commands/shell.py",
> > line 17, in handle_noargs
> > from django.db.models.loading import get_models
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/db/__init__.py", line 17, in 
> > backend = __import__('%s%s.base' % (_import_path,
> > settings.DATABASE_ENGINE), {}, {}, [''])
> >   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/django/db/backends/postgresql_psycopg2/
> > base.py", line 14, in 
> > raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> > e)
> > django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> > module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not
> > loaded: /
> > usr/local/pgsql/lib/libpq.4.dylib
> >   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
> > lib/python2.5/site-packages/psycopg2/_psycopg.so
> >   Reason: image not found
> >
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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: Using edit_inline DateField is not showing up

2007-10-25 Thread Malcolm Tredinnick

On Thu, 2007-10-25 at 11:07 -0700, ZebZiggle wrote:
> Thanks Karen ... do you of a way to override this behavior?
> 
> I can think of many situations where you would want to be able to
> modify it.

auto_now and auto_now_add *always* set the automatic value, they don't
supply default values you can override (this is documented).

If you want more fine-grained control, use the default attribute (which
you can also set to datetime.datetime.now) on the field.

Regards,
Malcolm

-- 
If Barbie is so popular, why do you have to buy her friends? 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: Markdown problem

2007-10-25 Thread Malcolm Tredinnick

On Thu, 2007-10-25 at 13:27 -0700, Alexander Tsamutali wrote:
> On Oct 22, 6:06 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
> > On Mon, 2007-10-22 at 06:02 -0700, koenb wrote:
> > ...
> > > On the other hand, Malcolm closed the ticket today as wontfix, stating
> > > it is a bug inmarkdown.
> > > Though that may be true, I do not understand why themarkdownfilter
> > > in SVN is converting text to bytestrings first if themarkdownmodule
> > > understands unicode (or maybe it didn't before ?).
> >
> > That's exactly it: it is only in the recent 1.6b release thatMarkdown
> > started understanding Unicode at all and there's no way that Django's
> > going to ask everybody to do a forced upgrade just because a third-party
> > package has done something that appears to be an error.
> 
> You think that Unicode support is an error or i'm missing something?
> This problem appeared because API changed in python-markdown and
> django should support both versions for some time (checking python-
> markdown version for ex.).

The error is that it *only* supports Unicode string input and not
bytestrings, despite the internals appearing to be prepared to process
bytestrings (for example, he tries to trim Byte Order Marks, which don't
even appear when you convert  UTF-16 byestring to Unicode). Up until
recently, handled non-ASCII bytestrings, so considering this and the
code changes, it looks like an oversight that remains undiscovered
because of some subtleties in the markdown test suite.

If the markdown bug isn't fixed and the new versions will only accept
non-ASCII data as unicode strings, we'll change Django to work around
that, but for the moment I'm hoping the problem will be fixed in the
right place.

Regards,
Malcolm

> 
> 
> > 
> 
-- 
On the other hand, you have different fingers. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: Postgresql Schema Ticket #1051 - Trying to fix.

2007-10-25 Thread Zenom

Absolutely right, I have been working on it all evening too. I think I
know what the problem is but I need to ask in dev anyway just to
figure out the best way to go about it.

On Oct 25, 8:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2007-10-25 at 15:31 -0700, Zenom wrote:
> > OK so I am working on ticket # 1051 which is the PostgreSQL
> > search_path ticket. I checked out trunk today and made a diff. When I
> > go to the shell and create queries and save data it works like a
> > champ. When I try to run a test it gives me a
> > psycopg2.ProgrammingError saying that the schema doesn't exist.
>
> > What is confusing is that it errors out saying the 'andy' schema
> > doesn't exist, so it obviously knows what the schema name is. It's the
> > same one that works when I try to do normal queries.
>
> > Is there something else anyone can think of that I might need to
> > change for tests to work? This wont get submitted without a test and
> > well i can't submit if I cannot test.
>
> So you are saying that in an unknown collection of code changes that we
> haven't seen, you are getting a very specific error message and you are
> wondering if we can help debug it? Does it strike you that there might
> be some information missing there for anybody to be able to help? :-)
>
> > On a side note, what kind of tests should I perform to help make sure
> > this gets accepted into Django. This is a very important piece for our
> > company and would like to see it as part of the base install.
>
> Well, for a start, you should have any design discussion on django-dev,
> instead of django-users. That's where development work takes place and
> we try very hard to keep the two domains separate.
>
> I think there's still some design work needed. For example, there's a
> comment (#13) declaring that certain things were in and out of scope for
> the ticket. However, I'm not sure that's a done deal, since it hasn't
> been discussed anywhere. For example, work out how this might work
> API-wise and then discuss it on django-dev to see if the same syntax
> will work smoothly with, e.g., Oracle. You don't have to do the backend
> work for Oracle, but having a public API that works well for the two
> main systems that support schemas is really going to be a requirement
> here.
>
> So come up with an API, maybe even come up with a code patch --
> particularly since you already have one, it seems -- and then start a
> thread on django-dev to solicit opinions. My gut feeling is that it
> won't be too controversial, but we should get the API "right", for th
> reasons indicated above.
>
> Regards,
> Malcolm
>
> --
> On the other hand, you have different 
> fingers.http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: Postgresql Schema Ticket #1051 - Trying to fix.

2007-10-25 Thread Malcolm Tredinnick

On Thu, 2007-10-25 at 15:31 -0700, Zenom wrote:
> OK so I am working on ticket # 1051 which is the PostgreSQL
> search_path ticket. I checked out trunk today and made a diff. When I
> go to the shell and create queries and save data it works like a
> champ. When I try to run a test it gives me a
> psycopg2.ProgrammingError saying that the schema doesn't exist.
> 
> What is confusing is that it errors out saying the 'andy' schema
> doesn't exist, so it obviously knows what the schema name is. It's the
> same one that works when I try to do normal queries.
> 
> Is there something else anyone can think of that I might need to
> change for tests to work? This wont get submitted without a test and
> well i can't submit if I cannot test.

So you are saying that in an unknown collection of code changes that we
haven't seen, you are getting a very specific error message and you are
wondering if we can help debug it? Does it strike you that there might
be some information missing there for anybody to be able to help? :-)

> On a side note, what kind of tests should I perform to help make sure
> this gets accepted into Django. This is a very important piece for our
> company and would like to see it as part of the base install.

Well, for a start, you should have any design discussion on django-dev,
instead of django-users. That's where development work takes place and
we try very hard to keep the two domains separate.

I think there's still some design work needed. For example, there's a
comment (#13) declaring that certain things were in and out of scope for
the ticket. However, I'm not sure that's a done deal, since it hasn't
been discussed anywhere. For example, work out how this might work
API-wise and then discuss it on django-dev to see if the same syntax
will work smoothly with, e.g., Oracle. You don't have to do the backend
work for Oracle, but having a public API that works well for the two
main systems that support schemas is really going to be a requirement
here.

So come up with an API, maybe even come up with a code patch --
particularly since you already have one, it seems -- and then start a
thread on django-dev to solicit opinions. My gut feeling is that it
won't be too controversial, but we should get the API "right", for th
reasons indicated above.

Regards,
Malcolm

-- 
On the other hand, you have different fingers. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread Ross Poulton

In my opinion, 40-50 Euros (Which is approx $60-$80 Australian
dollars, with which I'm much more familiar!) is a very reasonable rate
for a GOOD coder who does good design work along with their
programming.

The fact that you can get a PHP coder for $20 AUD/hr probably says
more about the dilution of coders and the quest by everybody to be a
paid PHP coder than anything else.

FWIW a salaried programmer in australia might be on about $30-$40/hr,
a contractor probably in the realm of $80-$150 depending on the
client, the job, etc.

That said, if elance is anything like rentacoder, I'd expect people
promising the world for very little cash - people who quote $100 for a
50 hour project are obviously not going to give as good results as
somebody who quotes $2000 for the same job.


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread Roboto

lol
Well 40-50 euros is definitely a number I didn't expect.  I live in
Canada, and on the net freelance work goes for about 20 CAD/hr, say
for a PHP dev or something.  It's alright, it's about how much we pay
programmers here generally speaking.  But at a rate of 100 CAD/hr... I
wouldn't mind putting down the money as long as there was a way to
prove that he could produce the same amount of work as a PHP developer
in 5 hrs - or if his work was that much more superior than anyone
elses (excellent html, css skills /w django)

Which I don't doubt, there are definitely some instances where I've
found Django to be much >> PHP.  But then again, it was more of a
function of the language.

On Oct 25, 4:12 pm, nubis <[EMAIL PROTECTED]> wrote:
> wow, just wow.
> I'm a django developer in Argentina, if you earned 15 euro an hour, it
> would mean 109440 pesos a year. Which is the retail price of a 3 room
> apartment in Buenos Aires. and living on your own, you wouldn't expend
> more than 3000 a month even if you are a big spender
>
> I guess you BitBlazer live in a so called 'First world' country, I kind
> of understand why people ther get into so much trouble and 'danger' (of
> getting stuck with sucky contractors) to outsource to india. (a country
> with a similar economy than ours)
>
> Roboto wrote:
> > Is that assuming that you can do work 5x faster than a PHP developer?
>
> > On Oct 25, 6:28 am, Roboto <[EMAIL PROTECTED]> wrote:
>
> >> ! holy smokes
>
> >> On Oct 25, 3:01 am, BitBlazer <[EMAIL PROTECTED]> wrote:
>
> >>> It varies depending upon various things. For me it would be anywhere
> >>> between 40-50 euros per hour.
>
> >>> On Oct 25, 8:46 am, Roboto <[EMAIL PROTECTED]> wrote:
>
>  Hey all,
>
>  I'm just curious, but if you were elance your skills out, what would
>  you normally charge?  I was wondering what the going rate to hire a
>  django cat would be on an hr basis
>
>  Thanks,
>
>  Rob


--~--~-~--~~~---~--~~
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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Francis Lavoie

have you tried to import the module into python directly?



Le 07-10-25 à 18:58, Frank a écrit :

>
> All-
>
> Having a rough go getting database bindings in OS X.
>
> I've installed psycopg2 using the package here:
> http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5- 
> macosx10.4.zip
>
> When I run 'python manage.py shell' I get the following... any ideas
> on how to fix this?
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/__init__.py", line 275,
> in execute_manager
> utility.execute()
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/__init__.py", line 225,
> in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 70, in
> run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 84, in
> execute
> output = self.handle(*args, **options)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 166, in
> handle
> return self.handle_noargs(**options)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/commands/shell.py",
> line 17, in handle_noargs
> from django.db.models.loading import get_models
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/db/__init__.py", line 17, in 
> backend = __import__('%s%s.base' % (_import_path,
> settings.DATABASE_ENGINE), {}, {}, [''])
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/db/backends/postgresql_psycopg2/
> base.py", line 14, in 
> raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> e)
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not  
> loaded: /
> usr/local/pgsql/lib/libpq.4.dylib
>   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
> lib/python2.5/site-packages/psycopg2/_psycopg.so
>   Reason: image not found
>
>
> >


--~--~-~--~~~---~--~~
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: Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Kristinn Örn Sigurðsson
I recommend to use Darwin ports or fink to do that. I used Darwin ports on
my mac and it works perfectly.

On 10/25/07, Frank <[EMAIL PROTECTED]> wrote:
>
>
> All-
>
> Having a rough go getting database bindings in OS X.
>
> I've installed psycopg2 using the package here:
>
> http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4.zip
>
> When I run 'python manage.py shell' I get the following... any ideas
> on how to fix this?
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/__init__.py", line 275,
> in execute_manager
> utility.execute()
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/__init__.py", line 225,
> in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 70, in
> run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 84, in
> execute
> output = self.handle(*args, **options)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/base.py", line 166, in
> handle
> return self.handle_noargs(**options)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/management/commands/shell.py",
> line 17, in handle_noargs
> from django.db.models.loading import get_models
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/db/__init__.py", line 17, in 
> backend = __import__('%s%s.base' % (_import_path,
> settings.DATABASE_ENGINE), {}, {}, [''])
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/db/backends/postgresql_psycopg2/
> base.py", line 14, in 
> raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> e)
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /
> usr/local/pgsql/lib/libpq.4.dylib
>   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
> lib/python2.5/site-packages/psycopg2/_psycopg.so
>   Reason: image not found
>
>
> >
>

--~--~-~--~~~---~--~~
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: Scaling the server

2007-10-25 Thread Graham Dumpleton

On Oct 25, 11:32 pm, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
> > Do you know which process in particular though are using up all the
> > memory?
>
> The `top` command tells me that apache is taking the most slice of the
> RAM. When I reach the high loads, there is between 40-50 subprocess of
> httpd.

Running prefork I see. What I would suggest is on a separate box build
up Apache with worker MPM and test your application thoroughly on it
instead and see if it works. Although the guidance for Django is to
use prefork and Django wasn't originally designed with multithreading
in mind, there is currently no known problems with it running on
multithreaded worker MPM and many people do just this. You obviously
though need to confirm that your application layer is itself
multithread safe first though.

By using worker MPM instead of prefork MPM, you will immediately be
able to drop the number of Apache child processes in use to a much
lower number. This will drop back overall memory use significantly. If
you are running into problems with memory swapping, this would help
greatly to avoid that.

> > If it is the Apache child process in which mod_python and your Django
> > application is running are you taking measures like setting
> > MaxRequestsPerThread directive to some non zero value so that the
> > processes are recycled on a regular basis and not just growing and
> > growing in size over time. Disabling keep alive or at least reducing
> > the keep alive timeout can also be help in as much as holding down
> > active memory and allowing more concurrent requests from different
> > users without Apache having to launch new child processes.
>
> The KeepAlive is already disabled, I don´t have set
> MaxRequestPerThread, whould you suggests me to set it?
>
> 
> StartServers 5
> MinSpareServers  5
> MaxSpareServers 10
> ServerLimit1600
> MaxClients 1500
> MaxRequestsPerChild  1

Whoops, had a brain fade. Meant MaxRequestsPerChild which you do have
set. The thread variant of that is BEOS specific and doesn't apply.

> 
>
> KeepAlive Off
> MaxKeepAliveRequests 100
> KeepAliveTimeout 15
>
> > > A friend told me that I can make python library shared.
>
> > If you track that one back far enough you will find me at the other
> > end as I was the one who started that recommendation. I got sick of
> > people complaining about mod_python using up so much memory when it
> > was mostly to do with the Python installation not using a shared
> > library and what happens when statically compiled object gets used in
> > dynamically loadable modules. :-)
>
> :) ok, then I need to compile python with shared libraries and
> recompile mod_python to link it with my new python environment?

Recommended.

> > Still not sure though what you think is causing the problems. Yes, you
> > have high memory usage but what is using the memory? Is that leading
> > onto swapping?
>
> Not all the time, once I have 4GB of ram the server don´t go to swap
> almost all the time. I can´t tell preciselly if the server is onto
> swapping when the server stucks. I will pay attention to this when the
> problem occours again. I´m not a server expert, is this top output
> normal?
>
> Cpu(s):  7.5% us,  1.3% sy,  0.0% ni, 91.0% id,  0.0% wa,  0.1% hi,
> 0.1% si
>
> us is the user cpu usage, sy is system ok? What is id? Is it normal to
> have it at higher levels?

Two other things to look at. First is you can run:

  vmstat 5

The si/so columns of that will show whether it is swapping.

The other thing is to run:

  netstat -a

This will show state of active socket connections, one possibility is
you are getting a lot of connections stuck in i/o wait type states and
running out of resources and/or Apache stuck waiting for old
connections to close down.

> > If you can indicate whether it is Apache itself, the
> > Django application, the database etc, will help as far as giving
> > further suggestions.
>
> I don´t have any performance meter, I thinking on put a script making
> a log of a ps command and analyses that result until a crash, do you
> recommends me any performance test tool?

The ones above are simple ones to try, others may be able to suggest
others for Linux. I don't use Linux that much so not sure what is
available these days.

> > BTW, as far as using mod_python, you might want to also experiment
> > with mod_wsgi. For your sort of high performance web site, you would
> > most likely use it in embedded mode and so not much different to
> > mod_python in that respect, but mod_wsgi does have a smaller memory
> > footprint and lower per request overhead.
>
> I see your posts ;), I can give it a try. But I want to fight the real
> problem reather to waste time on something that can help but not solve
> my problem. If I use mod_wsgi I need to compile python with shared
> libraries too?

Shared library again recommended.

Depending on what you load is like to the Django application, on

Python 2.5, Postgres, Psycopg2 on OS X

2007-10-25 Thread Frank

All-

Having a rough go getting database bindings in OS X.

I've installed psycopg2 using the package here:
http://pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4.zip

When I run 'python manage.py shell' I get the following... any ideas
on how to fix this?

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/__init__.py", line 275,
in execute_manager
utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/__init__.py", line 225,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/base.py", line 70, in
run_from_argv
self.execute(*args, **options.__dict__)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/base.py", line 84, in
execute
output = self.handle(*args, **options)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/base.py", line 166, in
handle
return self.handle_noargs(**options)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/commands/shell.py",
line 17, in handle_noargs
from django.db.models.loading import get_models
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/db/__init__.py", line 17, in 
backend = __import__('%s%s.base' % (_import_path,
settings.DATABASE_ENGINE), {}, {}, [''])
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/db/backends/postgresql_psycopg2/
base.py", line 14, in 
raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
module: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /
usr/local/pgsql/lib/libpq.4.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/psycopg2/_psycopg.so
  Reason: image not found


--~--~-~--~~~---~--~~
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: crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread Malcolm Tredinnick

On Thu, 2007-10-25 at 15:17 +, bramble wrote:
> On Oct 25, 10:38 am, Dan Ellis <[EMAIL PROTECTED]> wrote:
[...]
> It would be trivial to just add a short sentence in the tutorial
> saying something like, "Behind the scenes, Django sets things up such
> that you automatically get instance variables for each of the class
> variables you've set up.". Small price to pay for removing some
> mystery, IMO.

Actually, it would be a fairly bad idea for the tutorial and would
actually *introduce* more mystery, on balance. Experience has shown that
a lot of people work through the tutorial before they have a completely
firm grasp on Python. Bringing up the subtle differences between class
and instance variables, which doesn't really affect how you use them at
all in any case, would be adding extra complexity where it adds no
value. If you have sufficient Python experience that you (a) notice this
right off the bat and (b) care about why, it's fairly easy to track down
by looking at the Model class or searching on Google. It just isn't
necessary to know this information to use Django and so it's not
appropriate for the initial tutorial.

You haven't made a convincing argument that this knowledge is required
to use the code or even makes it easier to use. Currently we say "define
these attribute and then assign to them and read from them". It can't
get much simpler than that in an introductory document.

There's a whole bunch of "what goes on under the covers" stuff that we
could write (in fact, the model initialisation process is documented in
the wiki -- see [1]). At the moment, we're focusing more on documenting
the public API, rather than the "how", since it's Python source code
after all -- if you care how things work, it's not too hard to just read
the source and grep around a bit.

[1] http://code.djangoproject.com/wiki/DevModelCreation

Regards,
Malcolm

-- 
Works better when plugged in. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Postgresql Schema Ticket #1051 - Trying to fix.

2007-10-25 Thread Zenom

OK so I am working on ticket # 1051 which is the PostgreSQL
search_path ticket. I checked out trunk today and made a diff. When I
go to the shell and create queries and save data it works like a
champ. When I try to run a test it gives me a
psycopg2.ProgrammingError saying that the schema doesn't exist.

What is confusing is that it errors out saying the 'andy' schema
doesn't exist, so it obviously knows what the schema name is. It's the
same one that works when I try to do normal queries.

Is there something else anyone can think of that I might need to
change for tests to work? This wont get submitted without a test and
well i can't submit if I cannot test.


On a side note, what kind of tests should I perform to help make sure
this gets accepted into Django. This is a very important piece for our
company and would like to see it as part of the base install.


--~--~-~--~~~---~--~~
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: Markdown problem

2007-10-25 Thread Alexander Tsamutali

On Oct 22, 6:06 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-10-22 at 06:02 -0700, koenb wrote:
> ...
> > On the other hand, Malcolm closed the ticket today as wontfix, stating
> > it is a bug inmarkdown.
> > Though that may be true, I do not understand why themarkdownfilter
> > in SVN is converting text to bytestrings first if themarkdownmodule
> > understands unicode (or maybe it didn't before ?).
>
> That's exactly it: it is only in the recent 1.6b release thatMarkdown
> started understanding Unicode at all and there's no way that Django's
> going to ask everybody to do a forced upgrade just because a third-party
> package has done something that appears to be an error.

You think that Unicode support is an error or i'm missing something?
This problem appeared because API changed in python-markdown and
django should support both versions for some time (checking python-
markdown version for ex.).


--~--~-~--~~~---~--~~
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: management.call_command dumpdata does not return datastring

2007-10-25 Thread Jacob Kaplan-Moss

Hi Ulf --

The mangement modules are designed for use from the command-line, so
this is expected behavior. If you're looking to convert data into a
string, you'll want to use the serialization APIs directly, see
http://www.djangoproject.com/documentation/serialization/.

Jacob

--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread nubis

wow, just wow.
I'm a django developer in Argentina, if you earned 15 euro an hour, it 
would mean 109440 pesos a year. Which is the retail price of a 3 room 
apartment in Buenos Aires. and living on your own, you wouldn't expend 
more than 3000 a month even if you are a big spender

I guess you BitBlazer live in a so called 'First world' country, I kind 
of understand why people ther get into so much trouble and 'danger' (of 
getting stuck with sucky contractors) to outsource to india. (a country 
with a similar economy than ours)

Roboto wrote:
> Is that assuming that you can do work 5x faster than a PHP developer?
>
> On Oct 25, 6:28 am, Roboto <[EMAIL PROTECTED]> wrote:
>   
>> ! holy smokes
>>
>> On Oct 25, 3:01 am, BitBlazer <[EMAIL PROTECTED]> wrote:
>>
>> 
>>> It varies depending upon various things. For me it would be anywhere
>>> between 40-50 euros per hour.
>>>   
>>> On Oct 25, 8:46 am, Roboto <[EMAIL PROTECTED]> wrote:
>>>   
 Hey all,
 
 I'm just curious, but if you were elance your skills out, what would
 you normally charge?  I was wondering what the going rate to hire a
 django cat would be on an hr basis
 
 Thanks,
 
 Rob
 
>
>
> >
>
>   


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread Roboto

Is that assuming that you can do work 5x faster than a PHP developer?

On Oct 25, 6:28 am, Roboto <[EMAIL PROTECTED]> wrote:
> ! holy smokes
>
> On Oct 25, 3:01 am, BitBlazer <[EMAIL PROTECTED]> wrote:
>
> > It varies depending upon various things. For me it would be anywhere
> > between 40-50 euros per hour.
>
> > On Oct 25, 8:46 am, Roboto <[EMAIL PROTECTED]> wrote:
>
> > > Hey all,
>
> > > I'm just curious, but if you were elance your skills out, what would
> > > you normally charge?  I was wondering what the going rate to hire a
> > > django cat would be on an hr basis
>
> > > Thanks,
>
> > > Rob


--~--~-~--~~~---~--~~
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: Using edit_inline DateField is not showing up

2007-10-25 Thread ZebZiggle

Thanks Karen ... do you of a way to override this behavior?

I can think of many situations where you would want to be able to
modify it.

-Z



--~--~-~--~~~---~--~~
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: crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread Dan Ellis

On Oct 25, 4:17 pm, bramble <[EMAIL PROTECTED]> wrote:

> It would be trivial to just add a short sentence in the tutorial
> saying something like, "Behind the scenes, Django sets things up such
> that you automatically get instance variables for each of the class
> variables you've set up.". Small price to pay for removing some
> mystery, IMO.

When I first saw it, I didn't think much other than, oh, that's neatly
done. But you're right -- a footnote or something wouldn't go amiss.


--~--~-~--~~~---~--~~
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: write my own css

2007-10-25 Thread [EMAIL PROTECTED]

Hey,
  The admin media setting is only for django's admin interface.  For
me, I needed to change some things in the admin interface, and so
copied the media folder (in windows, found in "C:\Python25\Lib\site-
packages\django\contrib\admin\") to the root of my server directory
(alternatively, non-windows systems can use symlinks.) My settings.py
has the default:  ADMIN_MEDIA_PREFIX = '/media/'

  If you are doing doing something outside the admin interface, that's
a bit different.  I have a folder at /projectfolder/media with sub-
folders for css, images, etc., some of which have more sub-folders for
different applications.

 Settings.py has:  MEDIA_ROOT = 'pathtoproject/media/'
   MEDIA_URL = 'http://yoururl/media/'

 In my templates, to attach a css file I have something like:
{% block attach %}{% endblock %}

 I needed to add some stuff to my apache configuration to serve the
static files, and http://www.djangobook.com/en/beta/chapter21/ and
http://www.djangoproject.com/documentation/static_files/ were helpful
in how to do this.  The django dev server doesn't handle the static
files, but that's not a problem for me so I've not looked into if it
can or should.

  This works for me, hope it helps.
Michael

On Oct 25, 9:38 am, Greg_IAP <[EMAIL PROTECTED]> wrote:
> Hello,
> I tried to create my own css and to link my applications to this one
> by creating a directory called media in my project.
> i indicated to settings.py of my project to see this directory by
> editing ADMIN_MEDIA_PREFIX = '/media/'
> In this directory i created css img and js directory as the tree of
> the django source code and i copied files from this tree to my own css
> directory(i mean for example dashboard.css renamed dashboard1.css to
> test if it works...)
> I also modified my index.html from my own template like this {% block
> stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/
> dashboard1.css{% endblock %}.and nothing happens , i mean, my
> dashboard1.css is not read
> could anyone has an experience of this kind of thing? and is it
> working for somebody else?
> If this is the case could anyone show me how to do it?
>
> Thank 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
-~--~~~~--~~--~--~---



Re: write my own css

2007-10-25 Thread [EMAIL PROTECTED]

Hey,
  The admin media setting is only for django's admin interface.  For
me, I needed to change some things in the admin interface, and so
copied the media folder (in windows, found in "C:\Python25\Lib\site-
packages\django\contrib\admin\") to the root of my server directory
(alternatively, non-windows systems can use symlinks.) My settings.py
has the default:  ADMIN_MEDIA_PREFIX = '/media/'

  If you are doing doing something outside the admin interface, that's
a bit different.  I have a folder at /projectfolder/media with sub-
folders for css, images, etc., some of which have more sub-folders for
different applications.

 Settings.py has:  MEDIA_ROOT = 'pathtoproject/media/'
   MEDIA_URL = 'http://yoururl.com/media/'

 In my templates, to attach a css file I have something like:
{% block attach %}{% endblock %}

 I needed to add some stuff to my apache configuration to serve the
static files, and http://www.djangobook.com/en/beta/chapter21/ and
http://www.djangoproject.com/documentation/static_files/ were helpful
in how to do this.  The django dev server doesn't handle the static
files, but that's not a problem for me so I've not looked into if it
can or should.

  This works for me, hope it helps.
Michael

On Oct 25, 9:38 am, Greg_IAP <[EMAIL PROTECTED]> wrote:
> Hello,
> I tried to create my own css and to link my applications to this one
> by creating a directory called media in my project.
> i indicated to settings.py of my project to see this directory by
> editing ADMIN_MEDIA_PREFIX = '/media/'
> In this directory i created css img and js directory as the tree of
> the django source code and i copied files from this tree to my own css
> directory(i mean for example dashboard.css renamed dashboard1.css to
> test if it works...)
> I also modified my index.html from my own template like this {% block
> stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/
> dashboard1.css{% endblock %}.and nothing happens , i mean, my
> dashboard1.css is not read
> could anyone has an experience of this kind of thing? and is it
> working for somebody else?
> If this is the case could anyone show me how to do it?
>
> Thank 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
-~--~~~~--~~--~--~---



Re: geodjango and MySQL

2007-10-25 Thread Matthew Wensin

I am flying along with plenty of polygons using GeoDjango and PostgreSQL.
Not sure about MySQL, however.


On 10/25/07 11:47 AM, "Greg_IAP" <[EMAIL PROTECTED]> wrote:

> 
> does django works with spatial queries(PolygonField and
> multipolygonField) when applications are developped to work with a
> MySQL database?
> 
> 
> > 


--~--~-~--~~~---~--~~
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: Using edit_inline DateField is not showing up

2007-10-25 Thread Karen Tracey
Specifying auto_add_now=True makes the field non-editable.  Therefore the
admin won't include it in the fields on a change page or in an edit-inline
section.

Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



geodjango and MySQL

2007-10-25 Thread Greg_IAP

does django works with spatial queries(PolygonField and
multipolygonField) when applications are developped to work with a
MySQL database?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



write my own css

2007-10-25 Thread Greg_IAP

Hello,
I tried to create my own css and to link my applications to this one
by creating a directory called media in my project.
i indicated to settings.py of my project to see this directory by
editing ADMIN_MEDIA_PREFIX = '/media/'
In this directory i created css img and js directory as the tree of
the django source code and i copied files from this tree to my own css
directory(i mean for example dashboard.css renamed dashboard1.css to
test if it works...)
I also modified my index.html from my own template like this {% block
stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/
dashboard1.css{% endblock %}.and nothing happens , i mean, my
dashboard1.css is not read
could anyone has an experience of this kind of thing? and is it
working for somebody else?
If this is the case could anyone show me how to do it?

Thank 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
-~--~~~~--~~--~--~---



Re: Scaling the server

2007-10-25 Thread Sridhar Adusumilli

On Oct 25, 9:32 am, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
> Hi Graham,
>
> First, thanks for all your help!
>
> > If a different physical machine or you have multiple IPs on the one
> > machine, then preferable to serve the media files from a different
> > hostname. That way the media web server can still run on port 80, in
> > the case of the same machine by configuring the respective web servers
> > to only listen on the one IP address and not all interfaces.
>
> > If you only have the one machine, don't have a separate IP and don't
> > want to have a non port 80 public web server, then you'll need to make
> > everything appear on the one hostname/port.
>
> Well, I have another server available now ;)
>
> > Do you know which process in particular though are using up all the
> > memory?
>
> The `top` command tells me that apache is taking the most slice of the
> RAM. When I reach the high loads, there is between 40-50 subprocess of
> httpd.
>
> > If it is the Apache child process in which mod_python and your Django
> > application is running are you taking measures like setting
> > MaxRequestsPerThread directive to some non zero value so that the
> > processes are recycled on a regular basis and not just growing and
> > growing in size over time. Disabling keep alive or at least reducing
> > the keep alive timeout can also be help in as much as holding down
> > active memory and allowing more concurrent requests from different
> > users without Apache having to launch new child processes.
>
> The KeepAlive is already disabled, I don´t have set
> MaxRequestPerThread, whould you suggests me to set it?
>
> 
> StartServers 5
> MinSpareServers  5
> MaxSpareServers 10
> ServerLimit1600
> MaxClients 1500
> MaxRequestsPerChild  1
> 
>
> KeepAlive Off
> MaxKeepAliveRequests 100
> KeepAliveTimeout 15
>
> > > A friend told me that I can make python library shared.
>
> > If you track that one back far enough you will find me at the other
> > end as I was the one who started that recommendation. I got sick of
> > people complaining about mod_python using up so much memory when it
> > was mostly to do with the Python installation not using a shared
> > library and what happens when statically compiled object gets used in
> > dynamically loadable modules. :-)
>
> :) ok, then I need to compile python with shared libraries and
> recompile mod_python to link it with my new python environment?
>
> > the GIL is not
> > necessarily as big a problem when hosting applications embedded with
> > Apache child processes as some would have you believe. See my prior
> > blog entries for more about GIL and multi core issues:
>
> >  http://blog.dscpl.com.au/2007/09/parallel-python-discussion-and-modws...
> >  http://blog.dscpl.com.au/2007/07/web-hosting-landscape-and-modwsgi.html
> > How to split things up across boxes is always a hard decision. You
> > really need to do some testing which mirrors the requirements of your
> > application as far as database and media file serving loads to get a
> > good idea. Without that it may be more of an educated guess as to
> > which may benefit more.
>
> Well, I made use of locmen cache, this may compromise the ram usage I
> think.
>
> > Still not sure though what you think is causing the problems. Yes, you
> > have high memory usage but what is using the memory? Is that leading
> > onto swapping?
>
> Not all the time, once I have 4GB of ram the server don´t go to swap
> almost all the time. I can´t tell preciselly if the server is onto
> swapping when the server stucks. I will pay attention to this when the
> problem occours again. I´m not a server expert, is this top output
> normal?
>
> Cpu(s):  7.5% us,  1.3% sy,  0.0% ni, 91.0% id,  0.0% wa,  0.1% hi,
> 0.1% si
>
> us is the user cpu usage, sy is system ok? What is id? Is it normal to
> have it at higher levels?

id is idle. That means the CPU is just sitting in idle state and not
doing any processing.


>
> > If you can indicate whether it is Apache itself, the
> > Django application, the database etc, will help as far as giving
> > further suggestions.
>
> I don´t have any performance meter, I thinking on put a script making
> a log of a ps command and analyses that result until a crash, do you
> recommends me any performance test tool?
>
> I can´t tell preciselly but I think apache is the bad guy here.
> Yesterday, my server start to have problems just after I change a
> header file used on partnets sites. The header is an static file, it
> seems that when many users start to download the new header (the older
> was cached on client), my site start to be slow until stuck.
>
> > BTW, as far as using mod_python, you might want to also experiment
> > with mod_wsgi. For your sort of high performance web site, you would
> > most likely use it in embedded mode and so not much different to
> > mod_python in that respect, but mod_wsgi does have a smaller memory
> > footprint 

Re: crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread bramble

On Oct 25, 10:38 am, Dan Ellis <[EMAIL PROTECTED]> wrote:
> Yeah, Django is doing some magic using a metaclass for Model
> (ModelBase, which is badly named IMO, as it isn't Model's base class).
> Most of the magic is in django.db.models.base.
>
> The documentation tells you how to /use/ the model API, though. I
> don't think there's any need for the docs to explain what magic is
> being done; in fact, it would just be very confusing to most users.

The user docs don't need to explain *how* the magic is done, but it
would save a lot of head-scratching if they simply mentioned that a
small bit of magic is indeed being done.

The way it stands, a new user reads through the tutorial, starts
making things work, and then says, "wit just a minute
what's going on here? I've been referring to instance variables here
all along, but I defined them as class variables in my model. Did I
miss something somewhere?".

It would be trivial to just add a short sentence in the tutorial
saying something like, "Behind the scenes, Django sets things up such
that you automatically get instance variables for each of the class
variables you've set up.". Small price to pay for removing some
mystery, IMO.


--~--~-~--~~~---~--~~
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 let some users manage other users

2007-10-25 Thread Kirk Strauser

I need a little advice on how to approach a problem.  On our new website, we 
will create "parent accounts" for customers, and then let them create new 
logins for employees and contractors that they can customize in a bunch of 
different ways.  However, company "Foo" should not be able to see any of 
company "Bar"'s subaccounts or be able to manipulate them in any way.  The 
problem is then that I want some users to be able to create new accounts, 
but only see or edit accounts that they themselves have created.

If I were designing the whole site from bare metal with mod_python or PHP 
then I could imagine how I might do this, but I'd much rather work *with* 
Django than *against* it.  So, is there a Django-ish approach that anyone 
would recommend?
-- 
Kirk Strauser

--~--~-~--~~~---~--~~
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: crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread Dan Ellis

Yeah, Django is doing some magic using a metaclass for Model
(ModelBase, which is badly named IMO, as it isn't Model's base class).
Most of the magic is in django.db.models.base.

The documentation tells you how to /use/ the model API, though. I
don't think there's any need for the docs to explain what magic is
being done; in fact, it would just be very confusing to most users.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



management.call_command dumpdata does not return datastring

2007-10-25 Thread Ulf Kronman

Hi all,
I've been using the Django management module to output data from my
database in JSON format. This summer I asked some questions about the
changes in the call management.dump_data to
management.call_command('dumpdata',) and got good help and got it
working.

Now that I try to run my database management script again, I can't get
it to work. It outputs my JSON structure on screen, and won't return
data as a datastring to process.

This is how I used to do it before the change:
str_datadump = management.dump_data(['kth'], format='json', indent=2)

Then I changed to this:
str_datadump = management.call_command('dumpdata', str_application,
format='json', indent=2)

The result of the last line is a proper JSON output to the screen and
a str_datadump that is 'None'

Am I doing something wrong here? If I want to send the resulting JSON
data to a file, or capture it in a variable for further processing
before writing it to a file, what syntax should I use?

I am using the repository version of Django and am at revision: 6603

Regards,
Ulf


--~--~-~--~~~---~--~~
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: Handling legacy single-row tables

2007-10-25 Thread younours

On Oct 25, 12:32 am, "Bill Fenner" <[EMAIL PROTECTED]> wrote:
> I've got a legacy application with a few tables that only have a
> single row, e.g., for configuration information.  I can easily get the
> info with the following hack: pick a column to be a pretend primary
> key (so that django doesn't add the id field), and use
> Model.objects.get(foo__isnull=False) - since there is only one row, I
> know that will work.

You don't need the ORM, so why not directly use some SQL?

from django.db import connection
cursor = connection.cursor()
cursor.execute...

You may lose database portability unless you are especially careful.


--~--~-~--~~~---~--~~
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: DateTimeField auto_now / auto_now_add and UTC

2007-10-25 Thread Joe Holloway

On 10/24/07, SmileyChris <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to get the
> > auto_now/auto_now_add feature of DateTimeField to use UTC?
>
> Those methods suck and hopefully will be removed. Use a callable
> default instead of auto_now_add (or overridden save instead of
> auto_now, like Jarek gave):
>
> from datetime import datetime
> class YourModel(models.Model):
> created = models.DateTimeField(default=datetime.utcnow)
>

Thanks for the heads up. I hadn't even realized this option and have
already found another situation where callable default is useful.

--~--~-~--~~~---~--~~
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: crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread Thomas Guettler

Am Donnerstag, 25. Oktober 2007 15:42 schrieb bramble:
> It looks to me that even though you set up class attributes in your
> models, when you *use* your models in your code, you access them as if
> they were instance attributes.
>
> Nowhere in the tutorials or the model or db-api docs is this
> mentioned.
>
> Unless I'm misunderstanding it, evidently, Django is doing some magic
> here for the user and it probably should be mentioned in the docs.

Hi,

most people read the tutorial before reading db-api. But
you are right, it should be mentioned.

 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: Using edit_inline DateField is not showing up

2007-10-25 Thread ZebZiggle

I'm having the same/similar problem. I have a field

created = models.DateTimeField(auto_now_add = True)

which doesn't show up in the admin interface, but everything else
does ... including other datetime fields (just not auto_add_now).

The field exists in the database, is used and getting populated
correctly.

Strange.

-Z


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



crititcal tidbit of documentation missing (instance vs. class attributes)

2007-10-25 Thread bramble

It looks to me that even though you set up class attributes in your
models, when you *use* your models in your code, you access them as if
they were instance attributes.

Nowhere in the tutorials or the model or db-api docs is this
mentioned.

Unless I'm misunderstanding it, evidently, Django is doing some magic
here for the user and it probably should be mentioned in the docs.


--~--~-~--~~~---~--~~
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 understanding the DB API

2007-10-25 Thread Ryan K

Perfect! Thanks.

On Oct 25, 2:20 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On 10/25/07, Ryan K <[EMAIL PROTECTED]> wrote:
>
> > Why can't I change the User's name like so:
>
> > results[0].user.name = 'Brian'
> > results[0].user.save()
>
> > ?
>
> > I instead have to assign it first:
>
> > found_user = results[0].user
> > found_user.name = 'Brian'
> > found_user.save()
>
> > Any help understanding this part of the API is greatly appreciated!
>
> When you set up the queryset initially, it doesn't actually hit the
> database yet. So your "result" variable doesn't contain any objects,
> it just contains instructions on how to get the objects.
>
> Instead, you're actually executing the query when you use results[0].
> This hits the database, gathers the results into a temporary list, and
> returns the first item in that list. Since you didn't assign that list
> anywhere, Python (and thus, Django) has no way of knowing that it
> should reuse it.
>
> So when you use results[0] again, Django hits the database a second
> time, getting you a fresh copy of the object, as it appears in the
> database. That means it doesn't have the modification you made to the
> first object, so when you save it, you'll notice that nothing changes
> in the database.
>
> So, in a nutshell, you're altering the name on object 1, but saving
> object 2, which was never modified. Assigning results[0].user to a
> variable makes sure that you're using the same object each time,
> without hitting the database and getting multiple copies.
>
> I don't know if I made that very clear, but if I didn't, I'm sure
> somebody else here can explain it better. Hope this helps!
>
> -Gul


--~--~-~--~~~---~--~~
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: Scaling the server

2007-10-25 Thread Michel Thadeu Sabchuk

Hi Graham,

First, thanks for all your help!

> If a different physical machine or you have multiple IPs on the one
> machine, then preferable to serve the media files from a different
> hostname. That way the media web server can still run on port 80, in
> the case of the same machine by configuring the respective web servers
> to only listen on the one IP address and not all interfaces.
>
> If you only have the one machine, don't have a separate IP and don't
> want to have a non port 80 public web server, then you'll need to make
> everything appear on the one hostname/port.

Well, I have another server available now ;)

> Do you know which process in particular though are using up all the
> memory?

The `top` command tells me that apache is taking the most slice of the
RAM. When I reach the high loads, there is between 40-50 subprocess of
httpd.

> If it is the Apache child process in which mod_python and your Django
> application is running are you taking measures like setting
> MaxRequestsPerThread directive to some non zero value so that the
> processes are recycled on a regular basis and not just growing and
> growing in size over time. Disabling keep alive or at least reducing
> the keep alive timeout can also be help in as much as holding down
> active memory and allowing more concurrent requests from different
> users without Apache having to launch new child processes.

The KeepAlive is already disabled, I don´t have set
MaxRequestPerThread, whould you suggests me to set it?


StartServers 5
MinSpareServers  5
MaxSpareServers 10
ServerLimit1600
MaxClients 1500
MaxRequestsPerChild  1


KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

> > A friend told me that I can make python library shared.
>
> If you track that one back far enough you will find me at the other
> end as I was the one who started that recommendation. I got sick of
> people complaining about mod_python using up so much memory when it
> was mostly to do with the Python installation not using a shared
> library and what happens when statically compiled object gets used in
> dynamically loadable modules. :-)

:) ok, then I need to compile python with shared libraries and
recompile mod_python to link it with my new python environment?

> the GIL is not
> necessarily as big a problem when hosting applications embedded with
> Apache child processes as some would have you believe. See my prior
> blog entries for more about GIL and multi core issues:
>
>  http://blog.dscpl.com.au/2007/09/parallel-python-discussion-and-modws...
>  http://blog.dscpl.com.au/2007/07/web-hosting-landscape-and-modwsgi.html

> How to split things up across boxes is always a hard decision. You
> really need to do some testing which mirrors the requirements of your
> application as far as database and media file serving loads to get a
> good idea. Without that it may be more of an educated guess as to
> which may benefit more.

Well, I made use of locmen cache, this may compromise the ram usage I
think.

> Still not sure though what you think is causing the problems. Yes, you
> have high memory usage but what is using the memory? Is that leading
> onto swapping?

Not all the time, once I have 4GB of ram the server don´t go to swap
almost all the time. I can´t tell preciselly if the server is onto
swapping when the server stucks. I will pay attention to this when the
problem occours again. I´m not a server expert, is this top output
normal?

Cpu(s):  7.5% us,  1.3% sy,  0.0% ni, 91.0% id,  0.0% wa,  0.1% hi,
0.1% si

us is the user cpu usage, sy is system ok? What is id? Is it normal to
have it at higher levels?

> If you can indicate whether it is Apache itself, the
> Django application, the database etc, will help as far as giving
> further suggestions.

I don´t have any performance meter, I thinking on put a script making
a log of a ps command and analyses that result until a crash, do you
recommends me any performance test tool?

I can´t tell preciselly but I think apache is the bad guy here.
Yesterday, my server start to have problems just after I change a
header file used on partnets sites. The header is an static file, it
seems that when many users start to download the new header (the older
was cached on client), my site start to be slow until stuck.

> BTW, as far as using mod_python, you might want to also experiment
> with mod_wsgi. For your sort of high performance web site, you would
> most likely use it in embedded mode and so not much different to
> mod_python in that respect, but mod_wsgi does have a smaller memory
> footprint and lower per request overhead.

I see your posts ;), I can give it a try. But I want to fight the real
problem reather to waste time on something that can help but not solve
my problem. If I use mod_wsgi I need to compile python with shared
libraries too?

I thinking on set lighttpd on the other server I got and serve the
partners header throught it to s

Re: Help understanding the DB API

2007-10-25 Thread Marty Alchin

On 10/25/07, Ryan K <[EMAIL PROTECTED]> wrote:
> Why can't I change the User's name like so:
>
> results[0].user.name = 'Brian'
> results[0].user.save()
>
> ?
>
> I instead have to assign it first:
>
> found_user = results[0].user
> found_user.name = 'Brian'
> found_user.save()
>
> Any help understanding this part of the API is greatly appreciated!

When you set up the queryset initially, it doesn't actually hit the
database yet. So your "result" variable doesn't contain any objects,
it just contains instructions on how to get the objects.

Instead, you're actually executing the query when you use results[0].
This hits the database, gathers the results into a temporary list, and
returns the first item in that list. Since you didn't assign that list
anywhere, Python (and thus, Django) has no way of knowing that it
should reuse it.

So when you use results[0] again, Django hits the database a second
time, getting you a fresh copy of the object, as it appears in the
database. That means it doesn't have the modification you made to the
first object, so when you save it, you'll notice that nothing changes
in the database.

So, in a nutshell, you're altering the name on object 1, but saving
object 2, which was never modified. Assigning results[0].user to a
variable makes sure that you're using the same object each time,
without hitting the database and getting multiple copies.

I don't know if I made that very clear, but if I didn't, I'm sure
somebody else here can explain it better. Hope this helps!

-Gul

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



translation and flatpages

2007-10-25 Thread AniNair

Hi..
  Is it possible to translate flatpages? If yes, how? Please suggest
any docs available (couldn't find any). 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: FLATPAGES

2007-10-25 Thread AniNair

Thanks Marcin,
   The problem is solved. The issue was a result of site_id not
matching. (the one in settings.py and the site_id I was trying to use.
(Thanks to the help from satheesh. :-) ))


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread Roboto

! holy smokes

On Oct 25, 3:01 am, BitBlazer <[EMAIL PROTECTED]> wrote:
> It varies depending upon various things. For me it would be anywhere
> between 40-50 euros per hour.
>
> On Oct 25, 8:46 am, Roboto <[EMAIL PROTECTED]> wrote:
>
> > Hey all,
>
> > I'm just curious, but if you were elance your skills out, what would
> > you normally charge?  I was wondering what the going rate to hire a
> > django cat would be on an hr basis
>
> > Thanks,
>
> > Rob


--~--~-~--~~~---~--~~
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: translation question ("how do I" question)

2007-10-25 Thread Kenneth Gonsalves


On 25-Oct-07, at 3:34 PM, alain D. wrote:

> My question is : how can I use the django translation mecanism
> (blocktrans tag & co) to translate that so that I will have
> This object has been created by %(username)s"
> in my po file ...

you do it in the __unicode__() method in your user model

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help understanding the DB API

2007-10-25 Thread Ryan K

For example, I have to basic models:

class User(models.Model):
  name = models.CharField(max_length=30)

class AlterEgo(models.Model):
  nickname = models.CharField(max_length=30)
  user = models.ForeignKey(User)

I do a lookup for a User named 'Ryan' and one object is found.

results = AlterEgo.objects.filter(user__name__exact='Ryan')

Why can't I change the User's name like so:

results[0].user.name = 'Brian'
results[0].user.save()

?

I instead have to assign it first:

found_user = results[0].user
found_user.name = 'Brian'
found_user.save()

Any help understanding this part of the API is greatly appreciated!

Thanks,
Ryan


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help understanding the DB API

2007-10-25 Thread Ryan K

For example, I have to basic models:

class User(models.Model):
  name = models.CharField(max_length=30)

class AlterEgo(models.Model):
  nickname = models.CharField(max_length=30)
  user = models.ForeignKey(User)

I do a lookup for a User named 'Ryan' and one object is found.

results = AlterEgo.objects.filter(user__name__exact='Ryan')

Why can't I change the User's name like so:

results[0].user.name = 'Brian'
results[0].user.save()

?

I instead have to assign it first:

found_user = results[0].user
found_user.name = 'Brian'
found_user.save()

Any help understanding this part of the API is greatly appreciated!

Thanks,
Ryan


--~--~-~--~~~---~--~~
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: translation question ("how do I" question)

2007-10-25 Thread alain D.

Absolutely ... the """ is misleading ... I added it only for
clarity ...

here is a chunk of the content of a xxx.html file (template)

This object has been created by {{ myobject.owner.username }}


My question is : how can I use the django translation mecanism
(blocktrans tag & co) to translate that so that I will have
This object has been created by %(username)s"
in my po file ...

(I don't want to put hmlt tags (links) in my translation file)

I hope I made my question more understandable than before ...

On 25 oct, 06:44, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 24-Oct-07, at 9:24 PM, alain D. wrote:
>
> > """By  > %}>{{ myobject.owner.username }}"""
>
> > of course, I'd like to have : """by %(username)s""" as a key in my
> > translation files ...
>
> frankly I dont understand the question - are you generating html code
> in your view?
>
> --
>
> regards
> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Dynamic initial value for verify email

2007-10-25 Thread cschand

Hi
  I am using form_for_instance to edit user

my view is

def edit(self):
  user = request.user
  UserForm = forms.form_for_instance(user, form=EditProfile,
fields=('email'))

my basefom class

class EditProfile(forms.BaseForm):
  def __init__(self, *args, **kwargs):
super(EditProfileForm, self).__init__(*args, **kwargs)

  verify_email = forms.EmailField(label='Repeat your email')

Now my problem is the verify_email fields initial data is empty. I
need to display the value of email to initial value of verify_email.

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
-~--~~~~--~~--~--~---



Combine multiple models together

2007-10-25 Thread cschand

Hi all
Can we combine multiple models together to create a Form by
form_for_instance method?

Now my view is

def edit_user(request):
  user = request.user
  profile = user.get_profile()
  email_notification = EmailNotification.objects.get(user=user)

  UserForm = forms.form_for_instance(user)
  ProfileForm = forms.form_for_instance(profile)
  EmailForm = forms.form_for_instance(email_notification)


Is there any alternate way to solve this?


--~--~-~--~~~---~--~~
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: FLATPAGES

2007-10-25 Thread Marcin Mierzejewski

Hi,

>  I get the add flat page in admin, but after adding a flat page,when i
> try to 'view on site',  it gives me a 404 error.Can you tell me why
> isn't FlatpageFallbackMiddleware working?And yes, I did add the
> trailing slashes as url. (eg: /about/). Please advice. Thank you.

Did you add django.contrib.FlatPages to INSTALLED_APPS?
Could you send your urls.py files?

Regards,
Marcin



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem with django captcha module

2007-10-25 Thread BitBlazer

Hi,

I just tried the django captcha module in my application. Everything
is fine except for one small problem. The code that extracts the font
files from `fonts` directory doesn't pay attention to the hidden
files. For example all my code is in SVN. As a result each project
folder has a hidden .svn folder. The code for extracting the files
from fonts directory directly uses the listdir() function without
bothering about hidden files (.svn in my case). As a result the
listing of font files also includes an erroneous font entry with the
name `path/to/fonts/dir/.svn` which raises IOError when used (which
happens randomly). Even though I have fixed this problem in my case
but I guess there should be a proper solution for same.

Cheers!
BitBlazer


--~--~-~--~~~---~--~~
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: elance'in django programmers

2007-10-25 Thread BitBlazer

It varies depending upon various things. For me it would be anywhere
between 40-50 euros per hour.

On Oct 25, 8:46 am, Roboto <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I'm just curious, but if you were elance your skills out, what would
> you normally charge?  I was wondering what the going rate to hire a
> django cat would be on an hr basis
>
> Thanks,
>
> Rob


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---