Re: Solution to multiple models on one form?

2007-05-18 Thread Doug B
My suggestion would be to NOT implement it! I took a similar approach when I was trying to learn python/django, wasted a bit of time, and almost never use the monstrosity I created. I'd have been better off just doing it the django way and/or waiting for newforms to be completed (which may break

Re: How to Display 2 items of an Object

2007-05-18 Thread Kelvin Nicholson
Hey Robo: You could limit the list from the query ... Model.objects.all()[:2] But I think the easiest way would be using the slice tag inside the template. {{ some_list|slice:":2" }} Tried these methods yet? Kelvin robo wrote: > Hi everyone, I've set up my code to display a page that shows

Re: how to limit foreign key choices by current user?

2007-05-18 Thread jonathan_ou
Thanks that worked. Although I had to say EForm.base_fields['apple'] to make it work. On May 18, 2:48 am, Doug B <[EMAIL PROTECTED]> wrote: > You can't limit choice like that. The choices specified there are > evaluated only when the model is first evaluated (module load time). > > What yo

Re: How to Display 2 items of an Object

2007-05-18 Thread robo
Hi Kelvin, > You could limit the list from the query ... Model.objects.all()[:2] I have tried Project.objects.all()[:3] in hopes that the 3rd time through the loop, it would show the "see more ..." link. But what this actually gives me is the first 3 projects, not 3 projects for each category. H

Re: rendering files in markdown

2007-05-18 Thread Milan Andric
On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > http://code.google.com/p/django-template-utils/wiki/GenericMarkup > Thanks alot for writing this, it was a sinch to get going. Now I have a def my_markdown in template_utils/markup.py where I can do everything I need to do som

Forcing unit test runner to abort after failed test

2007-05-18 Thread simonbun
Hi all, I have unit tests for a particular app that take about 2 minutes to complete. Needless to say, adding new unit tests to this app and running them is a time consuming process. I know that the old unit tests will succeed and am basically only interested in the results for the new unit test.

Re: Scalability / Traffic-Volume Numbers

2007-05-18 Thread Caz
I suspect I've found a clue. My vps is a user mode linux vps. I'm beginning to suspect that under uml or at least the one i'm operating under the threads are handled 'special' since i can see the apache threads on my real box using ps. In fact i ran my load tester locally on the vps and each thre

Re: Scalability / Traffic-Volume Numbers

2007-05-18 Thread Caz
Good point, tho i do ps -e which only lists the process name, not its params. So greps not included. Here's the count specifically excluding greps... $ ps -ef | grep apache2 | grep -v grep | wc 29 3192349 Here's the straight grepped output with f added [EMAIL PROTECTED]:~$ ps -ef |

Re: __str__() returning unicode strings

2007-05-18 Thread Andreas Ahlenstorf
> For a start, you can *never* return anything other than a bytestring > from the __str__ method. You may think you're trying to return > unicode, > but Python will always force it to have type "str". So even attempting > to return unicode form __str__ is a bug in your code. Yeah, it's clear, a

Securing static files

2007-05-18 Thread Guyon Morée
Hi all, The django docs tell me i'm better of serving my static files through a webserver instead of django itself. This is fine, but it gives me a design problem. I'm letting my users upload files to my server through django. The filepaths are stored in a table. The files are accessible to my w

Re: Forcing unit test runner to abort after failed test

2007-05-18 Thread Russell Keith-Magee
On 5/18/07, simonbun <[EMAIL PROTECTED]> wrote: > > Hi all, > > I have unit tests for a particular app that take about 2 minutes to > complete. Needless to say, adding new unit tests to this app and > running them is a time consuming process. I know that the old unit > tests will succeed and am ba

Re: Forcing unit test runner to abort after failed test

2007-05-18 Thread simonbun
Ah, should have refreshed before replying...I had placed a test_a, test_z, test_zz in a particular test class and they ran alphabetically, but that was probably a coincidence apparently. Too bad this can't be done (yet). Thanks for the info anyway. regards, Simon On May 18, 12:49 pm, "Russell K

Re: Securing static files

2007-05-18 Thread Aidas Bendoraitis
The most secure way, in my opinion, is to keep the files in a directory which is not accessible via the webserver and write a wrapper view, which would return the static files if the user within the current session has appropriate permissions. Regards, Aidas Bendoraitis aka Archatas On 5/18/07

Re: Securing static files

2007-05-18 Thread Sean Mc Allister
Hi, I made something similar by creating an Apache AccessHandler. You can have a look at the code here: http://www.djangosnippets.org/snippets/62/ You would have to change the permission checking to your needs, but basically you can do anything you want inside those functions, like check if the u

Announcing: PyLucid CMS v0.8.0alpha1

2007-05-18 Thread Jens Diemer
What is PyLucid? PyLucid is a lightweight, OpenSource (GPL) content management system. It's ideal for Shared-Webhosting: No shell account needed. Run at least with CGI. -- Release notes: The PyLucid django branch is now a litt

Re: Forcing unit test runner to abort after failed test

2007-05-18 Thread simonbun
Apparently I can't see very far... Unit tests do not run in reversed order. It appears to be alphabetically ordered. I'm still wondering how to abort the test runner without losing my stack traces though. Regards, Simon On May 18, 11:26 am, simonbun <[EMAIL PROTECTED]> wrote: > Hi all, > > I ha

Re: Securing static files

2007-05-18 Thread Vinay Sajip
On May 18, 12:30 pm, Guyon Morée <[EMAIL PROTECTED]> wrote: > > I agree that would be nice, but wouldnt that mean that django is > serving the files? > Not necessarily. The wrapper view could check permissions and issue a redirect to the static site if the user has a right to see the image, or r

Re: Django/Python developer at The Atlanta Journal-Constitution

2007-05-18 Thread Frédéric Sidler
do you use ellingtoncms.com 2007/5/17, Chris H. <[EMAIL PROTECTED]>: > > > Our online development team is looking for experienced Python/Django > Web developers. > > We're a small group practicing agile and rapid development. We "Get > Real", got Django and Rails, and we're perfectionists with dea

Re: Securing static files

2007-05-18 Thread Guyon Morée
I agree that would be nice, but wouldnt that mean that django is serving the files? That's supposedly not recommended. cheers, On May 18, 12:49 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]> wrote: > The most secure way, in my opinion, is to keep the files in a > directory which is not accessible v

splitting up models.py woes

2007-05-18 Thread Bram - Smartelectronix
hello everyone, I'm trying to split up my models.py into different files, more specifically I've made a directory "models": /models + __init__.py + models1.py + models2.py + models3.py First of all I had the trouble that django was now misinterpreting the app_name but that's

Re: Exending generic view

2007-05-18 Thread Malcolm Tredinnick
On Thu, 2007-05-17 at 19:53 -0700, [EMAIL PROTECTED] wrote: > I want to pass extra info to a generic view. Problem is, I don't want > a single chunk of data, I want to append info to the queryset I'm > returning (to know which topics are new). I have: > > def topic_list(request, forum_slug, pagin

Re: How to Display 2 items of an Object

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 00:29 -0700, robo wrote: > Hi Kelvin, > > > You could limit the list from the query ... Model.objects.all()[:2] > > I have tried Project.objects.all()[:3] in hopes that the 3rd time > through the loop, it would show the "see more ..." link. But what this > actually gives me

Creating a list of related attributes

2007-05-18 Thread Rytis Sileika
Hi, Assume the following model: class A(models.Model): attr1 = models.CharField(...) class B(models.Model): attr1 = models.CharField(...) fk = models.ForeignKey(A) class C(models.Model): attr1 = models.CharField(...) fk = models.ForeignKey(A) class D(models.Model): att

fixtures for generic relations?

2007-05-18 Thread Bram - Smartelectronix
hi everyone, how do I -in fixtures- explain a variable needs to come from another table? I don't want to write "content_type: 15" as elsewhere! - bram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Solution to multiple models on one form?

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 00:09 -0700, Doug B wrote: > My suggestion would be to NOT implement it! I took a similar approach > when I was trying to learn python/django, wasted a bit of time, and > almost never use the monstrosity I created. I'd have been better off > just doing it the django way T

Re: Solution to multiple models on one form?

2007-05-18 Thread Malcolm Tredinnick
On Thu, 2007-05-17 at 20:08 -0700, David Priest wrote: > It occurs to me that were I able to write the following: > models_list = ( > 'project.app1.models.Claim', > 'project.app2.models.Vendor') Why is this needed? Couldn't you require that the fields_list string

Re: Securing static files

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 10:05 +, Guyon Morée wrote: > Hi all, > > The django docs tell me i'm better of serving my static files through > a webserver instead of django itself. This is fine, but it gives me a > design problem. > > I'm letting my users upload files to my server through django. T

Re: rendering files in markdown

2007-05-18 Thread waylan
On May 17, 1:12 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > Hello, > > So how would i extend the markdown filter? > > Would this be better handled in another place, better way or different > module? > It looks like I'm a little late to this discussion, but there is a patch (#2910) [1] to make

Re: Exending generic view

2007-05-18 Thread [EMAIL PROTECTED]
Thanks Malcolm. I was looking at the question as a way to learn just what generic views can and can't do (and didn't ask it till after I'd re-read James Bennett's "get the most out of generic views"). Good to know. The custom view to do the same thing isn't really all that complex, either. Just g

Re: django error behind apache with mod_python

2007-05-18 Thread Eugene K.
What db backend do you use? On Mar 22, 11:15 pm, "GvaderTh" <[EMAIL PROTECTED]> wrote: > > ProgrammingError:ERROR: currenttransactionisaborted, commands > ignored until end oftransaction > > block > > SELECT 1 FROM "django_session" WHERE > "session_key"='eeeb9f812d055dc8838271bc628556fe' LIMIT 1

newForms and self.clean_data

2007-05-18 Thread tyman26
Hi, I built an application with the development version of Django and moved it to Apache. After I moved it, the self.clean_data variable stopped loading for some reason. I know you have to validate the data before this is availbable, but I am validating it. It works fine in the development ve

Re: newForms and self.clean_data

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 09:49 -0700, tyman26 wrote: > Hi, > I built an application with the development version of Django and > moved it to Apache. After I moved it, the self.clean_data variable > stopped loading for some reason. I know you have to validate the data > before this is availbable,

Re: newForms and self.clean_data

2007-05-18 Thread tyman26
Sorry about that, I probably should of noticed. Thanks for the info! On May 18, 12:01 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-18 at 09:49 -0700, tyman26 wrote: > > Hi, > > I built an application with the development version of Django and > > moved it to Apache. Aft

mod_python without httpd.conf?

2007-05-18 Thread [EMAIL PROTECTED]
Hi, I've tried googling for this for days without success. I'm looking for a way to deploy a django app on a mod_python enabled server to which I do not have httpd.conf access. fcgi + htaccess is well documented as is mod_python and httpd.conf, but I cannot find a meaningful mod_python + htacces

manipulator.do_html2python(new_data) not working?

2007-05-18 Thread Mason
I'm a Newbie at Django (release ver. 0.96) and I've got a problem with saving data from a Django checkbox to MySQL. The code that I'm running looks like this: manipulator.do_html2python(new_data) print "\nnew data: ", new_data new_baseline_fsr = manipulator.sa

URLPattern - can't fetch a detail page

2007-05-18 Thread Panos Laganakos
I've set up the url pattern as: (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, slug_field='news_entry')), The news_list_info: news_list_info = { 'queryset': Entry.objects.all(), 'allow_empty': True, } and both list and detail templates are in: /templates/news/

CentOS python rpm

2007-05-18 Thread Christian M Hoeppner
Hi there! I know this is fairly off-topic, but I thought you guys have to deal with this, and may know a bit more than I do. I need to update python to at least 2.4 on my VPS, which is running CentOS 4.4. The CentOS repos do not offer anything above 2.3.4. And I don't want to go the compile-

Re: mod_python without httpd.conf?

2007-05-18 Thread Daniel Ellison
On Friday 18 May 2007 14:06:48 [EMAIL PROTECTED] wrote: > I've tried googling for this for days without success. I'm looking for > a way to deploy a django app on a mod_python enabled server to which I > do not have httpd.conf access. This is entirely possible. Take whatever you were going to put

djangoproject.com's bug tracking and wiki code available?

2007-05-18 Thread Fred Jones
Is the source code available to djangoprojects.com's ticketing system and wiki [ http://code.djangoproject.com/simpleticket ]? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: djangoproject.com's bug tracking and wiki code available?

2007-05-18 Thread Tyson Tate
Yup: http://trac.edgewall.org/ -Tyson On May 18, 2007, at 11:46 AM, Fred Jones wrote: > > Is the source code available to djangoprojects.com's ticketing > system and wiki [ http://code.djangoproject.com/simpleticket ]? > > Thanks. --~--~-~--~~~---~--~~ You rece

Re: CentOS python rpm

2007-05-18 Thread Tyson Tate
A quick Google search should start you off on the right track. Try: or depending on your server architecture. I hope this helps! Regards, Tyson On May 18, 2007, at 11:15 AM, Christian M Hoeppner wrote: > > Hi there! > > I know this is fairly off-topic, but I thought you guys have to > d

Can we make one of these for Django?

2007-05-18 Thread chasfs
A friend who uses Rails sent me a link to the rails envy video http://www.youtube.com/watch?v=PQbuyKUaKFo Does anyone here have the ability to make a better one for Django? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: URLPattern - can't fetch a detail page

2007-05-18 Thread Tyson Tate
Your slug_field should be set to 'slug' because that's what you've named it in your RegEx: '^/(?P[-\w]+)/?$' So you want: (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, slug_field='slug')), or, conversely: (r'^/(?P[-\w]+)/?$', 'object_detail', dict (news_list_info, slug_field

Re: CentOS python rpm

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 12:15 -0700, Tyson Tate wrote: > A quick Google search should start you off on the right track. Try: > > > or > > > depending on your server architecture. Not quite, because the original poster said he was using CentOS 4.4. That means he needs a specially built version o

TypeError: Cannot resolve keyword 'user' into field.

2007-05-18 Thread Milan Andric
I'm up against a problem and I don't really have a clue on how to approach it. When I try to edit a User in the Django admin I get this error: TypeError at /admin/auth/user/12/ Cannot resolve keyword 'user' into field. Choices are: permissions, id, name I've tried tracing the problem and I

Re: trouble using fastcgi

2007-05-18 Thread rogerdpack
check out http://www.bluehostforum.com/showthread.php?t=715 it may have useful information. Note that they don't put it in cgi-bin at all :) On May 12, 11:02 am, Mark Phillips <[EMAIL PROTECTED]> wrote: > I hope I can provide enough information to allow someone to point me > in the right directi

save() extension works in shell, not in admin interface?

2007-05-18 Thread Ben Jones
I have 2 models, Item and Container, that are related to each other in 2 ways. Their definitions are at the end of this message, although I've taken out the Admin class and other non-essentials for brevity here. The first relationship between the 2 is a ForeignKey in Item. This indicates a 'defau

Re: URLPattern - can't fetch a detail page

2007-05-18 Thread Panos Laganakos
Thanks for the reply mate, but that doesn't seem to be the issue. I still can't figure out what's going wrong here :/ On May 18, 10:18 pm, Tyson Tate <[EMAIL PROTECTED]> wrote: > Your slug_field should be set to 'slug' because that's what you've > named it in your RegEx: > > '^/(?P[-\w]+)/?$' >

Paypal to RM - Withdraw your money from Paypal to your Bank Account!

2007-05-18 Thread Moona Naeem
Paypal to RM - Withdraw your money from Paypal to your Bank Account! Since you're reading this, I'm guessing that you guys "desperately" (forgive me if not)need to withdraw the money you all worked (or will work) so hard to earn from paypal? You want to convert your money from Paypal to RM but c

Re: Broken pipes with HttpResponseRedirect and Firefox / Trouble in paradise

2007-05-18 Thread Jon Lesser
I tool Malcolm's advice and looked closely at the packets going back and forth. Upon pressing an input button nested within an anchor, Firefox was sending two identical requests to the server, thus causing my code to be executed twice. It seems that after the server responded to one of the request

Limiting SQL queries in a custom manager method

2007-05-18 Thread Olivier Guilyardi
Hi, How can I know about the limiting parameters inside a custom manager method? Example: class MyManager(models.Manager): def my_query(self): # How can I find out about offset and length ? cursor.execute("SELECT foo FROM bar LIMIT %d, %d", [offset, length]) class MyModel(m

Re: Limiting SQL queries in a custom manager method

2007-05-18 Thread Malcolm Tredinnick
On Fri, 2007-05-18 at 23:50 +0200, Olivier Guilyardi wrote: > Hi, > > How can I know about the limiting parameters inside a custom manager method? > > Example: > > class MyManager(models.Manager): > def my_query(self): > # How can I find out about offset and length ? > curso

Re: save() extension works in shell, not in admin interface?

2007-05-18 Thread Jeremy Dunck
On 5/18/07, Ben Jones <[EMAIL PROTECTED]> wrote: ... > As you can see below, I have extended the save() method for Item so > that Item.default_container is always added to Item.containers. > > Both of the ways I've tried to do this (below) seem to work as > expected in the shell (python manage.py

Re: Can we make one of these for Django?

2007-05-18 Thread Norjee
I certainly hope not. So sad not to compete on the "merits" but by simple populism. But then again it isn't entirely fair to judge rails by its fanboys ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Limiting SQL queries in a custom manager method

2007-05-18 Thread Olivier Guilyardi
Malcolm Tredinnick wrote: > On Fri, 2007-05-18 at 23:50 +0200, Olivier Guilyardi wrote: >> >> How can I know about the limiting parameters inside a custom manager method? >> >> Example: >> >> class MyManager(models.Manager): >> def my_query(self): >> # How can I find out about offset a

Re: Limiting SQL queries in a custom manager method

2007-05-18 Thread Jeremy Dunck
On 5/18/07, Olivier Guilyardi <[EMAIL PROTECTED]> wrote: ... > Okay, so I suppose a workaround is to pass offset and length as arguments to > my_query() > ... > I suppose I may also try to extend the QuerySet class to add my own method. > But > this might get rather complex AFAICS in db.models.qu

Re: mod_python without httpd.conf?

2007-05-18 Thread Graham Dumpleton
On May 19, 4:48 am, Daniel Ellison <[EMAIL PROTECTED]> wrote: > On Friday 18 May 2007 14:06:48 [EMAIL PROTECTED] wrote: > > > I've tried googling for this for days without success. I'm looking for > > a way to deploy a django app on amod_pythonenabled server to which I > > do not have httpd.conf a

Re: save() extension works in shell, not in admin interface?

2007-05-18 Thread Ben Jones
Jeremy -- thanks a ton for the help on this. I was really quite frustrated by the end of the day. > The short version is that Admin uses > db.models.manipulators.AutomaticManipulator, which calls your model's > save prior to traversing all the m2m fields for the object. It stomps > on the value

Re: fixtures for generic relations?

2007-05-18 Thread Russell Keith-Magee
On 5/18/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > hi everyone, > > > how do I -in fixtures- explain a variable needs to come from another table? > > I don't want to write "content_type: 15" as elsewhere! That's the way its done. GenericRelation is a convenience wrapper around the

Django Developers for Online News Start Up

2007-05-18 Thread Hive9
Engineer for Online News Start Up Company Overview Hive9 is an early stage funded start up located in Kendall Square in Cambridge, MA. Hive9 is in the online news space specializing in technology involving machine learning, natural language processing, information retrieval and human computer in