Re: Generic views and filtering

2007-01-15 Thread natebeaty
You can do this without a wrapper -- your url entry was close: (r'^tag/(?P[-\w]+)/$','django.views.generic.list_detail.object_detail', dict(queryset=Tag.objects.all(), template_object_name='tag', slug_field='url')), and you'll get a list in /templates/tags/tag_detail.html called post_set:

Re: Trouble with stockphoto

2007-01-15 Thread Jay Parlar
On 1/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I'm having a bit of trouble with stockphoto http://www.carcosa.net/jason/software/django/stockphoto/ Basically, I've followed the install /exactly/ as it says in the readme file, and everything seems to go fine until I go to the admin an

Re: Permissions at object instance level

2007-01-15 Thread Jay Parlar
On 1/15/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: The Row-Level-Permissions branch was (is) an attempt to implement this sort of functionality. I don't know the current state of this branch (i.e., is it merge ready, fundamentally broken, or somewhere in between?), but at the very least,

Multiple applications and conflicting admin privileges ...

2007-01-15 Thread ZebZiggle
Hey all, Belated Happy New Year! I'm embarking on a new Django project (a business application vs. the http://www.MyDarkSecret.com game of my previous effort). I'm hoping to use the admin capabilities of Django for this project. However, I have App A and App B both installed in the same Projec

Re: How to create a simple PDF

2007-01-15 Thread Kenneth Gonsalves
On 16-Jan-07, at 3:28 AM, Jacob Kaplan-Moss wrote: Please could anyone give me a quick how to on PDF outputting. I've looked at the official documentation around Report Lab, but remain clueless. http://www.djangoproject.com/documentation/outputting_pdfs/ i found the solution very simple -

Re: Why is my Django install so slow?

2007-01-15 Thread Kenneth Gonsalves
On 15-Jan-07, at 10:23 PM, Joe wrote: StartServers 8 MinSpareServers 5 MaxSpareServers 20 MaxClients 75 MaxRequestsPerChild 1024 StartServers 2 MaxClients 800 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 make MaxRequestsPerC

Re: Customizing the class returned by newforms.form_for_model()

2007-01-15 Thread jfagnani
So subclassing the generated form class does work, just type something like: class MyForm(forms.form_for_model(MyModel)): my_field = forms.CharField() ... (Python is very interesting :) But there's a not-so-small catch: new fields defined in the subclass don't get added to the fields diction

Re: Customizing the class returned by newforms.form_for_model()

2007-01-15 Thread Honza Král
plus you can supply a super class that the resulting class will subclass via the form keyword argument... On 1/16/07, Honza Kr l <[EMAIL PROTECTED]> wrote: On 1/16/07, jfagnani <[EMAIL PROTECTED]> wrote: > > I'm just starting to learn newforms myself, but it looks like > form_for_model returns a

Re: Customizing the class returned by newforms.form_for_model()

2007-01-15 Thread Honza Král
On 1/16/07, jfagnani <[EMAIL PROTECTED]> wrote: I'm just starting to learn newforms myself, but it looks like form_for_model returns a class, so shouldn't you be able to subclass it? I'm not sure how that would work though, since the class doesn't exist when defining your subclass, but that's b

verdjnlib templatepages vs django static content server

2007-01-15 Thread cwurld
Hi, I was reviewing the code for two different ways of serving static webpages: 1) verdjnlib templatepages ( http://www.verdjn.com/wiki/TemplatePages ) 2) django static pages ( http://www.djangoproject.com/documentation/static_files/ ) and i can't see much difference between these two methods

Re: Why so slow?

2007-01-15 Thread David Abrahams
"Jeremy Dunck" <[EMAIL PROTECTED]> writes: > Most likely, KeepAlive is holding processes unavailable while > sitting idle. How would I tell if that was happening? Turn it off and see if performance suddenly becomes rediculously good. :) Unfortunately even with KeepAlive off, I'm seeing it

OS X production setup issues

2007-01-15 Thread Tim Medley
Hello, I have been playing around with django in the dev environment for a week or so and i want to move what I have over to my production OS X server running Apache 1.3. I have gone through several documents discussing the setup of Apache 1.3 and Fast CGI and I just cannot seem to get this wor

Re: Customizing the class returned by newforms.form_for_model()

2007-01-15 Thread jfagnani
I'm just starting to learn newforms myself, but it looks like form_for_model returns a class, so shouldn't you be able to subclass it? I'm not sure how that would work though, since the class doesn't exist when defining your subclass, but that's because I'm new to Python too :) --~--~-

Re: How to create a simple PDF

2007-01-15 Thread Chris Moffitt
I convert text to PDF using the trml2pdf tool here - http://www.openreport.org/index.py/static/page/trml2pdf Here's a view I call to create 1 of 3 PDF documents http://satchmo.python-hosting.com/file/trunk/satchmo/shipping/views.py The PDF templates (in rml format) are stored here - http://satc

Re: Why is my Django install so slow?

2007-01-15 Thread Joe
Thanks. I will try to disable it. Also, I get an error message when I try to increase the shared_buffers setting: FATAL: could not create shared memory segment: Invalid argument DETAIL: Failed system call was shmget(key=5432001, size=182059008, 03600). HINT: This error usually means that Po

Re: Newforms clean_fieldname method

2007-01-15 Thread [EMAIL PROTECTED]
On Jan 15, 4:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Hi all, i'm using newforms and need to express that *if person_type STUDENT is selected a Major must be selected* The form posts and i get ValidationError raised but the form does not re-display with the errors rendered, it jus

Re: How to create a simple PDF

2007-01-15 Thread Jacob Kaplan-Moss
On 1/15/07 12:29 PM, conrad22 wrote: Please could anyone give me a quick how to on PDF outputting. I've looked at the official documentation around Report Lab, but remain clueless. http://www.djangoproject.com/documentation/outputting_pdfs/ Jacob --~--~-~--~~~---~

Re: Generic views and filtering

2007-01-15 Thread Nicolas Steinmetz
David Zhou wrote: On Jan 12, 2007, at 6:25 PM, Nicolas Steinmetz wrote: Do I have to do as James [1] suggests, ie to filter it in views.py with some generic views methodes ? That's the way I do it. It's a very simple wrapper, and also allows me to add a host of other things into the conte

Re: apply a patch

2007-01-15 Thread Vadim Macagon
Install TortoiseSVN, it makes it dead easy to create & apply patches via a nice the right-click context menu in explorer. -+ enlight +- Picio wrote: Thanks Russell, but I'm on windows (sorry if I've not told you before..) I knew about the unix way > patch -p0 < ticket1435.patch but thi

Re: order_by with Foreign Keys

2007-01-15 Thread [EMAIL PROTECTED]
Hmm... the site hangs forever in Apache 2.x when I try this...I've emailed the branch developer to ask if there is a known issue w/ select_related... hopefully I can get it worked out ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Why is my Django install so slow?

2007-01-15 Thread Jeremy Dunck
On 1/15/07, Joe <[EMAIL PROTECTED]> wrote: ... And postgres settings: max_connections = 1000 shared_buffers = 2000 You'll want to read these: http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/ http://www.revsys.com/writings/postgresql-performance.html http://www.powerpostgre

Re: How to create a simple PDF

2007-01-15 Thread prashanth
On 1/15/07, conrad22 <[EMAIL PROTECTED]> wrote: Please could anyone give me a quick how to on PDF outputting. I've looked at the official documentation around Report Lab, but remain clueless. If you have a simple model: eg a list of contacts, how do you 'draw' the PDF? With thanks in advance

Re: Why is my Django install so slow?

2007-01-15 Thread Istvan Albert
Joe wrote: However, as little as 5000 hits a day brings my site down to a crawl during peak hours! The funny thing is, I have plenty of free ram space and processor during these peak hours. Something must be wrong with the setup. Unless all of these users come in the during the same minute.

Re: order_by with Foreign Keys

2007-01-15 Thread [EMAIL PROTECTED]
I'll give this a shot...I'm actually using the multi-db branch..but hopefully this will work here ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

How to create a simple PDF

2007-01-15 Thread conrad22
Please could anyone give me a quick how to on PDF outputting. I've looked at the official documentation around Report Lab, but remain clueless. If you have a simple model: eg a list of contacts, how do you 'draw' the PDF? With thanks in advance --~--~-~--~~~---~--~--

urls within admin not working. [python 2.4 - django 0.96]

2007-01-15 Thread Snirp
Hey guys (and the odd girl), I fail to get the admin panel working. I get to the main page, but from there every action results in a 404 page. For example after clicking the Users table in the page. == Page not found (404) Request Me

Newforms and MySQL

2007-01-15 Thread mrstone
Im having trouble to get 'funky' characters to work with newform posts. I have read the posts on the subject, and Im not sure if I run into a bug... class Guide(models.Model): about = models.CharField(maxlength=1500) class EditForm(forms.Form): about = forms.CharField(widget=forms.

Success!!! Troubleshooting for windows users....

2007-01-15 Thread [EMAIL PROTECTED]
For all Windows 2k users, I finally got everything working! Using apache instead of default django server... OS: Windows 2000 Server: Apache 2.0.59 Database: MySQL 3.23.49 + MySQL for Python 1.2.1 Python: 2.4.4 + mod_python 3.2.5b Django Version: .95 /*/ FROM httpd.conf

Geocoding in contrib admin

2007-01-15 Thread Matt
I am using [1]geopy to geocode an address, city, state, and zip from my Events model and save the latitude and longitude to the database during pre_save. My problem is sometimes Google's geocoder returns the wrong lat/lng or a list of possibilities. In the admin after saving the initial data for

Re: AttributeError: 'WSGIRequest' object has no attribute 'user'

2007-01-15 Thread Sam
I had this error because i'm not using the auth module. If that's you case, comment it out in your settings.py file: TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.debug", "django.core.context_processors.i18n", # "django.core.context_processors.auth", ) On Jan 5, 5

Re: Why is my Django install so slow?

2007-01-15 Thread James Bennett
On 1/15/07, Joe <[EMAIL PROTECTED]> wrote: KeepAlive On MaxKeepAliveRequests 500 KeepAliveTimeout 2 First step: kill keep-alive. With separate app and media servers it doesn't really serve any purpose, and it ties up the process until timeout. -- "May the forces of evil become confused on the

Re: Why is my Django install so slow?

2007-01-15 Thread Joe
I would have to guess that they are slow (dialup or slow DSL). Here are some of my apache config settings: TimeOut 300 KeepAlive On MaxKeepAliveRequests 500 KeepAliveTimeout 2 StartServers 8 MinSpareServers 5 MaxSpareServers 20 MaxClients 75 MaxRequestsPerChild 1024 StartServers 2

Re: newforms : how to display as_ul from views.py

2007-01-15 Thread Waylan Limberg
On 1/15/07, Ramdas S <[EMAIL PROTECTED]> wrote: How do I get the templates to render the following form from the views.py given below as as unordered list, instead of the standard table formt. This is a simple four fields ContactForms, created out of the table Contacts. form.as_ul() Theres

Re: Why is my Django install so slow?

2007-01-15 Thread James Bennett
On 1/15/07, Joe <[EMAIL PROTECTED]> wrote: I would be glad to offer as much information as possible, I just really need a direction to start looking. I have read performance tuning guides (including the one by Jacob) and implemented the suggestions. None seem to work. Really silly question, bu

Re: newforms : how to display as_ul from views.py

2007-01-15 Thread Rubic
Ramdas, in your template: {{ form.as_ul }} -- Jeff Bauer Rubicon, Inc. --~--~-~--~~~---~--~~ 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.c

Re: Why is my Django install so slow?

2007-01-15 Thread Joe
A separate Apache install on a separate server. We have three separate physical machines: a web server, file server and DB server --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: newforms : how to display as_ul from views.py

2007-01-15 Thread Honza Král
maybe I am missing something but why don't you use {{ form.as_ul }} in your template?? On 1/15/07, Ramdas S <[EMAIL PROTECTED]> wrote: How do I get the templates to render the following form from the views.py given below as as unordered list, instead of the standard table formt. This is a simple

Customizing the class returned by newforms.form_for_model()

2007-01-15 Thread [EMAIL PROTECTED]
Hello everyone, I am looking for a way to modify certain aspects of a Form class returned by newforms.form_for_model(). I have a ManyToManyField(Tag) attribute in my model and form_for_model() makes that a multiple select. I was wondering if it was possible to change just that field to a CharF

Re: Couple of dumb questions

2007-01-15 Thread Noah
change where the symlink points. --~--~-~--~~~---~--~~ 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 t

Re: Why is my Django install so slow?

2007-01-15 Thread Joe
I would be glad to offer as much information as possible, I just really need a direction to start looking. I have read performance tuning guides (including the one by Jacob) and implemented the suggestions. None seem to work. --~--~-~--~~~---~--~~ You received th

Re: Why is my Django install so slow?

2007-01-15 Thread James Bennett
On 1/15/07, Joe <[EMAIL PROTECTED]> wrote: Whenever someone goes to the site (the home page), a new database connection is created with the Django database. I have caching enabled: A couple possibilities: * If you have the session middleware enabled, sessions (even for anonymous users) are s

Re: Why is my Django install so slow?

2007-01-15 Thread Noah
Is your media being served by the Apache instance serving Django or a separate Apache 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

Re: apply a patch

2007-01-15 Thread Nathan R. Yergler
If you're on Windows you might look into using Cygwin (http://cygwin.com) which provides a Unix-like environment for windows (where patch -p0... does work). NRY Picio wrote: Thanks Russell, but I'm on windows (sorry if I've not told you before..) I knew about the unix way > patch -p0 < ti

Newforms clean_fieldname method

2007-01-15 Thread [EMAIL PROTECTED]
Hi all, i'm using newforms and need to express that *if person_type STUDENT is selected a Major must be selected* The form posts and i get ValidationError raised but the form does not re-display with the errors rendered, it just crashes with the standard Django error Code is up here: http://dp

Re: apply a patch

2007-01-15 Thread Picio
Thanks Russell, but I'm on windows (sorry if I've not told you before..) I knew about the unix way > patch -p0 < ticket1435.patch but this don't work on my platform. Anyway I will search like you said about aggregate functions in the devel group. I need only SUM for now so maybe I can solve

Couple of dumb questions

2007-01-15 Thread Keith Mallory
Hi, 1-- What is the status of the row level permissions trunk? 2- If it is still useful and is likely to be included, I would like to play around with it. How do I do tha? I have the svn code downloaded on to my PC. How do I switch between my 'nomal' svn edition which is symliked to the /site-pa

newforms : how to display as_ul from views.py

2007-01-15 Thread Ramdas S
How do I get the templates to render the following form from the views.pygiven below as as unordered list, instead of the standard table formt. This is a simple four fields ContactForms, created out of the table Contacts. Currently it is emmiting the HTML as as a a table class. def index(request

Re: Permissions at object instance level

2007-01-15 Thread Russell Keith-Magee
On 1/15/07, Ramdas S <[EMAIL PROTECTED]> wrote: Hi, I read in the docs that if I cannot provide permissions at object instance level using the Meta Permissions. What is the best way to set permissions rights for indvidual objects, says articles, where on indvidual article I can set based on c

Re: Why is my Django install so slow?

2007-01-15 Thread Joe
I would appreciate ANY idea, no matter how far-fetched it may seem. I will also gladly provide further information if you need it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Why is my Django install so slow?

2007-01-15 Thread Joe
I am running Django on a webserver in conjunction with a fileserver and a database server. All of these machines have over 6 gigs of ram and dual core Xeon processors. They also are running on raid-5 HDD. However, as little as 5000 hits a day brings my site down to a crawl during peak hours!

fuzzy selection based on title & tags

2007-01-15 Thread omat * gezgin.com
Hi all, There had been a discussion on selecting objects based on their tags in a blogging application: http://groups-beta.google.com/group/django-users/browse_thread/thread/f2bfff678b1f5ee8/ I want to do something similar, but a little bit more complicated. I am trying to decide which entry to

Re: apply a patch

2007-01-15 Thread Russell Keith-Magee
On 1/15/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: The last time this came up, I posted a fairly long counter-proposal, but that managed to kill the conversation. For those interested, here's a link to the thread with that counter-proposal: http://groups.google.com/group/django-devel

Re: apply a patch

2007-01-15 Thread Russell Keith-Magee
On 1/15/07, Picio <[EMAIL PROTECTED]> wrote: Hello, dumb question: which is the chance that patch #1435 will be integrated in trunk before 1.0? If I have anything to do with it, Low to none. Search the django-dev and django-users archives for aggregate functions; I don't like the approach pro

Re: new or old forms

2007-01-15 Thread Aidas Bendoraitis
In my opinion, it depends on your deadlines. If you have short-term deadlines, then you should use the old forms and to rewrite them some day. Otherwise, you should use new forms, but only in development server, until the new forms are officially introduced as finished and you can finish all the

Re: Question about models

2007-01-15 Thread Jeremy Dunck
On 1/13/07, Nathan Harmston <[EMAIL PROTECTED]> wrote: ... class Relationship(models.Model): src_type = models.ForeignKey(Node_Type) src = models.ForeignKey() dest_type = models.ForeignKey(Node_Type) dest = models.FoeignKey() edge_type = models.Forei

new or old forms

2007-01-15 Thread [EMAIL PROTECTED]
Hi, I'm relatively new to django. I've installed django from the source repository. At the moment I'm considering use of newforms for my application. They seem to be much easier to use then the oldforms, but at the same time, as they are in the development phase, there are many parts that are st

tiny mce - Error: uncaught exception: Permission denied to get property Window.tinyMCE

2007-01-15 Thread temnoregg
hi there, i have found this error - Error: uncaught exception: Permission denied to get property Window.tinyMCE. it occurs on every popup window, which is blank than... a few sources tell that it's security problem of cross-domain javascript, but how to solve it when you use 2 different domain

Re: open source disk monitoring application written with Django

2007-01-15 Thread coulix
can we have screenshots :) ? --~--~-~--~~~---~--~~ 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 [E

Re: apply a patch

2007-01-15 Thread Michael Radziej
Picio schrieb: Hello, dumb question: which is the chance that patch #1435 will be integrated in trunk before 1.0? I can't tell you, but perhaps this type of question gets more attention at django-developers. You should mention 'aggregate functions' in the subject. How can I aplly this patch

apply a patch

2007-01-15 Thread Picio
Hello, dumb question: which is the chance that patch #1435 will be integrated in trunk before 1.0? How can I aplly this patch to my 0.95 trunk version of django? thanks Picio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

alternative JSON encoder

2007-01-15 Thread Wolfram Kriesing
anyone experiencing that too? I had the following problems with the default json encoder that is suggested to use: * cant handle Decimal * ignores properties that are not fields, it only encodes the fields (but i often add more properties to the object for passing to the template) * has problems