Re: get_FOO_display and grouped data

2006-12-04 Thread Ross Burton
Jacob Kaplan-Moss wrote: > Try:: > > {% regroup feature.task_set.all|dictsortreversed:"priority" by > get_priority_display as grouped %} > > That is, the "by" argument to {% regroup %} doesn't just have to be a field > name; it can be anything that a variable could resolve. Excellent, thanks. Ro

Saving info about viewed tags

2006-12-04 Thread zenx
Hi, I have an Objects Model and a Tags Model with a M2M relationship between them. I want to update info about the tags of the object visited by the user updating it everytime the user requests an Object. Is it a crazy idea? I want to know wich tags are the most viewed by the user and wich are th

Re: Admin 404s on users

2006-12-04 Thread Adrian Holovaty
On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > It doesn't give me anything to go on: > > Page not found (404) > Request Method: GET > Request URL:http://gretschpages.com/admin/auth/user/1/ > > You're seeing this error because you have DEBUG = True in your Django > settings

Re: DB Query

2006-12-04 Thread [EMAIL PROTECTED]
Found it - a custom manager: http://www.djangoproject.com/documentation/model_api/#custom-managers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

Re: Pagination variable problem with generic list and limited queryset

2006-12-04 Thread Silas
Thanks for the explanation Rajesh. On Dec 4, 2:31 pm, "RajeshD" <[EMAIL PROTECTED]> wrote: > On Dec 3, 8:36 pm, "Silas" <[EMAIL PROTECTED]> wrote: > > > I have a problem with generic.list_detail.object_list, a limiting > > queryset, and pagination variables. > > > For some reason when I use the c

DB Query

2006-12-04 Thread Bret Walker
How can one perform a database query from an overloaded admin save function? I want to retrieve an old value, compare it to the one currently being saved, then perform an action based on the result of the comparison. Thanks, Bret --~--~-~--~~~---~--~~ You receiv

Re: Dynamic includes in template?

2006-12-04 Thread limodou
On 12/5/06, matthew <[EMAIL PROTECTED]> wrote: > > Hi, > > Looking at the documentation, I see that you can do "include > template_name" or "include 'template.html'". I'd like to combine these > - concatenating a couple of strings and a variable to make the template > name - but it's not working (

Re: get_FOO_display and grouped data

2006-12-04 Thread Jacob Kaplan-Moss
On 12/4/06 4:34 PM, Ross Burton wrote: > In my view, I'm grouping the data on the priority: > > {% regroup feature.task_set.all|dictsortreversed:"priority" by priority > as grouped %} > {% for group in grouped %} > {{ group.grouper }} > > However, when I do this, group.grouper expands to "0" o

Re: Searching a ForeignKey

2006-12-04 Thread Bret Walker
On 12/4/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > On 12/5/06, Bret Walker <[EMAIL PROTECTED]> wrote: > > > > Is there a way to search a CharField contained in a ForeignKey? > > Yes. You can traverse any foreign key or m2m relation in Django's query > language. For example: > > Arti

Re: Searching a ForeignKey

2006-12-04 Thread Russell Keith-Magee
On 12/5/06, Bret Walker <[EMAIL PROTECTED]> wrote: > > > Is there a way to search a CharField contained in a ForeignKey? Yes. You can traverse any foreign key or m2m relation in Django's query language. For example: Article.objects.filter(author__firstname='Bret') would retrieve all article ob

Re: Admin 404s on users

2006-12-04 Thread [EMAIL PROTECTED]
Are you saying you broke your model? Mine validate. Or am I misunderstanding? --~--~-~--~~~---~--~~ 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: Admin 404s on users

2006-12-04 Thread MerMer
I had a similar problem the other day. I had made a mistake on one of my fields of another model, which was edited inline via the User Model. MerMer [EMAIL PROTECTED] wrote: > I just know there's a simple explanation for this, but my brain is > fried. > > My admin area decided today it was g

Re: Dynamic includes in template?

2006-12-04 Thread matthew
Will do. Thanks, Matthew On Dec 4, 9:57 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 12/4/06, matthew <[EMAIL PROTECTED]> wrote: > > > This is the bit that's not working (viewsurvey.html): > > {% for question in questions %} > > {% include 'questions/' + question.get_type_display() +

get_FOO_display and grouped data

2006-12-04 Thread Ross Burton
Hi, I have a model with an integer field that uses choices for display names: class Task(models.Model): PRIORITY_CHOICES = ( ('0', 'Low'), ('1', 'Normal'), ('2', 'High') ) priority = models.IntegerField(choices=PRIORITY_CHOICES) In my view, I'm grouping the d

Searching a ForeignKey

2006-12-04 Thread Bret Walker
Is there a way to search a CharField contained in a ForeignKey? If one wants to use a foreign key to prevent repetition and duplication of data, wouldn't it only make sense that the foreign key's fields be searchable, as well? Otherwise, the only way to find records based on the foreign key woul

Re: Admin 404s on users

2006-12-04 Thread [EMAIL PROTECTED]
It doesn't give me anything to go on: Page not found (404) Request Method: GET Request URL:http://gretschpages.com/admin/auth/user/1/ You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page

Re: Admin 404s on users

2006-12-04 Thread Adrian Holovaty
On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > When I go to the admin, under "Auth" and click "users" all is well. I'm > presented with a list of users. > > When I try to click one of the users - any of the users - it 404s. Even > if I click on my own user name. Try setting DEBUG=True

Re: Dynamic includes in template?

2006-12-04 Thread James Bennett
On 12/4/06, matthew <[EMAIL PROTECTED]> wrote: > This is the bit that's not working (viewsurvey.html): > {% for question in questions %} > {% include 'questions/' + question.get_type_display() + '.html' %} > {% endfor %} > > Why can't I concatenate the strings and variable to include the > rel

Dynamic includes in template?

2006-12-04 Thread matthew
Hi, Looking at the documentation, I see that you can do "include template_name" or "include 'template.html'". I'd like to combine these - concatenating a couple of strings and a variable to make the template name - but it's not working (no error, but no template included). This template displays

graceful shopping cart questions

2006-12-04 Thread Noah
I downloaded and looked at the django-cart code and noted the views go cart = request.session.get('cart', None) or Cart() how can thre session pickle the cart and be accurate if it's stored in the database or am I confuised? is Django smart enough to know how that should work and retrive the new

Re: Pagination variable problem with generic list and limited queryset

2006-12-04 Thread RajeshD
On Dec 3, 8:36 pm, "Silas" <[EMAIL PROTECTED]> wrote: > I have a problem with generic.list_detail.object_list, a limiting > queryset, and pagination variables. > > For some reason when I use the code below, results are restricted to > the sliced 100, but all the pagination variables show results a

Re: no-database models?

2006-12-04 Thread Bill de hOra
[EMAIL PROTECTED] wrote: > Russ, > > Because it seems like the cleanest way of pulling together a wide > variety of content that all pertains to a particular day, or list of > days. I would have used an "event" rather than a "day" to model this. You can still (sensibly imo) argue that

Admin 404s on users

2006-12-04 Thread [EMAIL PROTECTED]
I just know there's a simple explanation for this, but my brain is fried. My admin area decided today it was going to start throwing a 404 error for every user. When I go to the admin, under "Auth" and click "users" all is well. I'm presented with a list of users. When I try to click one of th

Re: Highload website database architecture

2006-12-04 Thread Joseph Heck
The postgres mailing list or IRC channel would generally be better, but here's some numbers that I got from last year's OSCON in Portland, OR from the Postgres geeks there. For a 2Gb RAM machine, a good starting rule of thumb: shared_buffers = 25000 work_mem = 16384 maintenance_work_mem = 16384 ef

Global Error Handeling and Strange Authentication issues

2006-12-04 Thread Adam Patt
We have two problems that are similar, but would like handled in two different ways. I have been using django for a few months modifying and adding to an existing app and have a pretty good feel for how most of the framework fits together, but some parts still baffle me, like error handling (even

using a global login form

2006-12-04 Thread Milan Andric
Hello, I'm having the same problem as this thread: http://groups-beta.google.com/group/django-users/browse_thread/thread/b711b5c4579535c8/ Where to call set_test_cookie? Since a POST to authenticate can come from any page, I need to call set_test_cookie on any page. I'm using the django.contri

Re: Simple CAS 1.0 authentication

2006-12-04 Thread Brian Beck
tonemcd wrote: > Again, thanks heaps for making this available - it's done the business > for me! Tone, Awesome! Glad it worked. :) Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Validation 3 steep complicate form

2006-12-04 Thread MerMer
You may want to check out django.newforms which is going to be the replacement for forms and manipulators. According to a recent threads in the development forum it is already being used by in some production environments. The formal documentation is sparse but there is alot of detail in the cod

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-04 Thread Rock
> > > Talking through my hat?No, I think not -- I think that syntax > > (``queryset.groupby(field).max()``) > actually looks like the best proposal for aggregates I've seen thus far... > Sounds pretty good to me. Besides the usual min, max and such, I also like: queryset.groupby(field).stats()

Re: Validation 3 steep complicate form

2006-12-04 Thread Jorge Gajon
Hi, On 12/3/06, GvaderTh <[EMAIL PROTECTED]> wrote: > > Hello All. I read django documentation about forms, had seek internet > and didn't found solution for situation like this: I have order form > divided to 3 steeps, after every step should be validation and if > validation is succesfull, user

Re: Setting checkbox to check as default value

2006-12-04 Thread Jorge Gajon
Hi Jeff, On 12/2/06, jeffhg58 <[EMAIL PROTECTED]> wrote: > I have a custom manipulator and I am trying to set the checkbox default > to checked. > > For example, my field name is: > > forms.CheckboxField(field_name="current"), Pass a 'checked_by_default' argument to the CheckboxField constructor

Re: Re: Video stream uploading/playing

2006-12-04 Thread Jay Parlar
On 12/4/06, Pythoni <[EMAIL PROTECTED]> wrote: > > Eric, > Thanks a lot.Very good tutorial for me! > L. > Keep in mind that for larger files (I think over 10 megs), FileField causes very high CPU usage during upload. There is a patch somewhere in Trac that changes Django to store the file on disk

Re: Question concerning generic views or date based views in general

2006-12-04 Thread Jay Parlar
On 12/3/06, Oliver Andrich <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently developing a small Django application for my personal use. > Now I like to have a date based archive page, and I thought that this > finally is a good thing to look into generic views. My requirements are, > that I can

Re: using manipulators without defining fields again

2006-12-04 Thread Ivan Sagalaev
Milan Andric wrote: > I have a long application form for a workshop (name, employment, > resume, ... 65 fields). The user logs in to the site via > django.contrib.auth.view.login, standard django fare. Then the user is > allowed to apply for workshop xyz. If the user clicks save but does > not

Re: Video stream uploading/playing

2006-12-04 Thread Pythoni
Eric, Thanks a lot.Very good tutorial for me! L. --~--~-~--~~~---~--~~ 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 gro

Re: no-database models?

2006-12-04 Thread [EMAIL PROTECTED]
Dave, You're right, of course -- I want a ManyToMany field. The code you suggest doesn't quite work, either, though. Django wants both models in a many-to-many relationship to inherit from models.Model. Here's an interesting hack, though. Just change your first line to...

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-04 Thread Jacob Kaplan-Moss
On 12/4/06 5:57 AM, John Lenton wrote: > The "max", "min" and other such functions might be a little more > problematic, unless groupby returned, rather than a generic iterator, > a special "queryset group" and give _it_ the max/min/etc methods. This > way it would be clear that max() returns a tu

Re: Fast fcgi on dreamhost --> shauwn of the dead, help me shoot zombies

2006-12-04 Thread Phil
I stumbled across your post via jeffcrot.com and this came just right at the perfect timing. I just launched my first django app this week end (a site about online gaming, http://www.netday.be, but beware it's in french) and I run into some much 500 error trouble that I wasn't really confident.

Re: Session problems

2006-12-04 Thread Jakub Labath
No I'm using prefork MPM. On 12/3/06, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > > Jakub Labath wrote: > > Hi All, > > > > Sorry for being quiet for a while just got back from a vacation. > > > > > > > > Hi Jakub, > > > > > > Do you have any updates on this problem? Was it a mod_python bug?

Re: Run your Django app with the CherryPy server

2006-12-04 Thread Marcus Mendes
Congrats! Very good idea! Regards. Marcus On 12/3/06, Loïc (titoo) <[EMAIL PROTECTED]> wrote: > > Hello, > > For interested people, I have wrapped the WSGI CherryPy server to be > used with Django. With the same wrapper you can start several django > projects (one cherrypy instance per project)

Re: DB Syncing Models

2006-12-04 Thread Darin Lee
Hello, This may be what you're looking for: python manage.py reset [appname] Which will regenerate all your application's tables with your new changes. Be warned, though, that command will delete all the existing rows in each table. Good luck, Darin On Dec 3, 2006, at 2:09 PM, marksibly

Re: Video stream uploading/playing

2006-12-04 Thread Eric Lake
I found this. See if it is what you are looking for. http://blog.go4teams.com/archives/video-blogging-using-django-and-flashtm-video-flv/56 On Dec 2, 4:36 am, "Pythoni" <[EMAIL PROTECTED]> wrote: > Hi, > Has anyone thought /successfully implemented video stream (or movie) > uploading/playing fea

Re: Video stream or movie

2006-12-04 Thread Eric Lake
I found this. See if it is what you are looking for. On Dec 2, 4:35 am, "Pythoni" <[EMAIL PROTECTED]> wrote: > Hi, > Has anyone thought /successfully implemented video stream (or movie) > uploading/playing feature on a website powered by Django? > > L. --~--~-~--~~~

Re: no-database models?

2006-12-04 Thread DavidA
[EMAIL PROTECTED] wrote: > We're driving right past each other on the information > superhighway. > Thanks for your advice, Russ. It still seems to me that a > many-to-many relationship between days and events would be desirable, > for the same reasons that all many-to-many relationships are

Re: Apache ErrorDocument Question.

2006-12-04 Thread Paul Childs
Thanks Waylan but... It appears that when I configure Apache to limit the request body, if a file is uploaded that exceeds the setting, Apache doesn't seem to pass on anything to mod_python and records an error in error.log. Thus the view never gets called so there is no opportunity to raise the

Re: Apache ErrorDocument Question.

2006-12-04 Thread Paul Childs
Thanks Waylan but... It appears that when I configure Apache to limit the request body, if a file is uploaded that exceeds the setting, Apache doesn't seem to pass on anything to mod_python and records an error in error.log. Thus the view never gets called so there is no opportunity to raise the

Re: i18n & server_name

2006-12-04 Thread Alexander Solovyov
Ivan Sagalaev wrote: > Another way is to use 'sites' app and keep domain in a table separately > for each site. I thought about that, but this solution is not flexible as 'HTTP_HOST' variable - I need to add all hosts I want to use. --~--~-~--~~~---~--~~ You rec

Computer Based Online Jobs

2006-12-04 Thread Nimesh Patel
Here is an Easy way to Earn Money. Earn by doing Freelancing Assignments like Home Typing, Data Entry, Form Entry, Transcription etc. Most of these jobs can be done from Home with your Personal Computer. At first you can also work from Browsing Centre. Details at *http://www.imperialbiz.com/info.as

Re: Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-04 Thread John Lenton
On 12/1/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > One way to think about the problem is to consider how you would write > the documentation for it. "Django implements an object based SQL > wrapper... except for the aggregations stuff, which you will need to > know SQL to use properly"

Re: High Load

2006-12-04 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > We are running lighttpd with fastcgi in prefork mode. We tried using > threaded but django spits out an error about a weakly-referenced > object, related to sessions I believe, no longer existing. it's not related to this, by any chance: http://wolfram.kriesing.de/blo

Re: Singleton model instance

2006-12-04 Thread Fredrik Lundh
Phil Powell wrote: > Perhaps I've not explained myself properly. Here's an example: > > I have a "Homepage" which has fields such as "Page Title", > "Introduction Text", "Footer Text" etc. I want to be able to edit > these fields just like I'd edit a standard model instance, but because > ther

Re: High Load

2006-12-04 Thread graham_king
What web server are you using in development ? I suspect this might be a lighttpd / fastcgi problem. Have you tried Apache / mod_python ? Just as a reference I'm managing 90,000+ hits a day on one Apache on a UML virtual server, with the load rarely going above 2. With you setup and Django you

Re: Re: Re: Singleton model instance

2006-12-04 Thread James Bennett
On 12/4/06, Phil Powell <[EMAIL PROTECTED]> wrote: > I have a "Homepage" which has fields such as "Page Title", > "Introduction Text", "Footer Text" etc. I want to be able to edit > these fields just like I'd edit a standard model instance, but because > there is only one instance of my "Homepage

Re: Simple CAS 1.0 authentication

2006-12-04 Thread tonemcd
Brian, Just a quick note to say *thankyou very much* for making this available. I installed it into one of my development sites over the weekend and it works like a charm. I only tried the middleware version (which is probably more appropriate for an authentication backend) and found it to work ju

Re: Re: Singleton model instance

2006-12-04 Thread Phil Powell
On 04/12/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > I'm not sure I get how a singleton would solve the "pages generated from > multiple chunks" problem. > > why not just use a model that holds (pagename, chunkname, chunk data) > triplets, and use a view that brings up all the chunks for a give

Re: Hiding Referrer URL

2006-12-04 Thread MerMer
As this is handled by the browser - you might want to revert to Javascript. I think there is a plugin for JQuery which handles this. MerMer Siah wrote: > Hi, > > I need to hide referrer url on HttpResponseRedirect. I was expecting to > find something like ReferrerURL in HttpResponseRedirect.he

Re: How to default checkboxfield in customer manipulator

2006-12-04 Thread Ivan Sagalaev
jeffhg58 wrote: > I am trying to set the checkboxfield default value to checked but not > sure how you do it. > > Here is my formfield for the checkbox > > forms.CheckboxField(field_name="current"), > > I tried ading checked="checked" but that did not work. It's a bit non-obvious... The actual

Re: Singleton model instance

2006-12-04 Thread Fredrik Lundh
Phil Powell wrote: > I want to have a series of pages, with certain areas of content which > are editable. I don't want to use flatpages, as I'd like the editable > content to be broken down into chunks, rather than one big lump of > content. > > Is there a way to easily set a model to have one

Re: i18n & server_name

2006-12-04 Thread Ivan Sagalaev
Alexander Solovyov wrote: > Sorry, I found answer - META['HTTP_HOST']. :) Documentation keeps > silence about this. :( Another way is to use 'sites' app and keep domain in a table separately for each site. --~--~-~--~~~---~--~~ You received this message because

Singleton model instance

2006-12-04 Thread Phil Powell
Hi all, Apologies if this has been asked on the list before, but a search didn't throw up anything relevant. I want to have a series of pages, with certain areas of content which are editable. I don't want to use flatpages, as I'd like the editable content to be broken down into chunks, rather

Re: i18n & server_name

2006-12-04 Thread Alexander Solovyov
On 4 Дек., 10:47, "Alexander Solovyov" <[EMAIL PROTECTED]> wrote: > But I got problem - request.META['SERVER_NAME'] always set in Sorry, I found answer - META['HTTP_HOST']. :) Documentation keeps silence about this. :( --~--~-~--~~~---~--~~ You received this m

i18n & server_name

2006-12-04 Thread Alexander Solovyov
I'm writing multilanguage app, in which i18n happens when client enters certain domain, like in wikipedia. But I got problem - request.META['SERVER_NAME'] always set in ServerName Apache setting, not in queried domain name (which handled in Apache with ServerAlias *.domain.my). What can I do to