Re: Application Concepts

2008-04-07 Thread James Bennett
On Tue, Apr 8, 2008 at 1:38 AM, jurian <[EMAIL PROTECTED]> wrote: > Are django applications meant to be implemented in such a manner as to > allow the entire application directory to be copied into another > project and used without having to alter any of the code? Though I often get flamed fo

Re: Anybody used Google app engine, and wanna share their experience?

2008-04-07 Thread Graham Dumpleton
Can someone who has access do me a favour and write a hello world application which echos back the WSGI environment. def application(environ, start_response): status = '200 OK' output = str(environ) response_headers = [('Content-type', 'text/plain'),

Support European date format for JavaScript

2008-04-07 Thread Christian
Hi, In the admin site I'd like to change the date format for date fields. By default it's displayed in ISO format -MM-DD. I found a discussion about this topic from 2006 which came to the conflusion that it can't be changed. Yesterday I came across the ticket "Support European date format fo

Re: newforms with the polls/choice example

2008-04-07 Thread Rishabh Manocha
Does anyone have any ideas here?? If the question is unclear, I'd be happy to clarify myself. Thanks, Rishabh On Fri, Apr 4, 2008 at 4:50 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote: > Hey Guys, > > I was trying to rewrite parts of the Poll app example described in the > Django docs. Releva

Application Concepts

2008-04-07 Thread jurian
Are django applications meant to be implemented in such a manner as to allow the entire application directory to be copied into another project and used without having to alter any of the code? --~--~-~--~~~---~--~~ You received this message because you are subscrib

Google App Engine & Django

2008-04-07 Thread Ramin Firoozye
Has anyone had a chance to look at the Google App Engine yet? http://code.google.com/appengine/ Apparently, you can run the entire Django stack with a few modifications on top of Google's infrastructure (http://code.google.com/appengine/articles/django.html) and for most basic apps, it's fre

Re: question on ModelMultipleChoiceField

2008-04-07 Thread Mackenzie Kearl
you should use PostForm(instance=post) --~--~-~--~~~---~--~~ 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 ema

Re: Anybody used Google app engine, and wanna share their experience?

2008-04-07 Thread Adrian Holovaty
On Mon, Apr 7, 2008 at 11:14 PM, shabda <[EMAIL PROTECTED]> wrote: > I got the news too late, and no more invites were avialable. Anyone > who is using this, and their views ... It's pretty slick -- and much of it is influenced by Django, which is incredibly flattering. I have a sample app set

Re: Anybody used Google app engine, and wanna share their experience?

2008-04-07 Thread shabda
Ya same here. Will try to play around with it later tonight, but first looks say running django apps with only modifying the db part should be possible. On Apr 8, 10:41 am, davenaff <[EMAIL PROTECTED]> wrote: > I think everyone was given a denied message initially. I got an > acceptance note aro

Re: Transactions with custom sql

2008-04-07 Thread Amit Ramon
* shabda <[EMAIL PROTECTED]> [2008-04-04 14:10 -0700]: > > I am using mysql ith InooDB. > I have some cutsom sql doing inserts. These inserts are not visible > after the function returns, if I so something like > sql = 'INSERT INTO tbl1 ...' > from django.db import connection > cursor

Re: lighttpd & django, fcgi issues

2008-04-07 Thread Douglas E
On Apr 8, 4:12 am, skunkwerk <[EMAIL PROTECTED]> wrote: > thank you so much Ramiro, >I've removed the .fcgi file. the problem turned out to be that the > url.rewrite part of the configuration was in my original setup, but > was producing a warning and was being ignored because I hadn't > unco

Re: Anybody used Google app engine, and wanna share their experience?

2008-04-07 Thread davenaff
I think everyone was given a denied message initially. I got an acceptance note around 10:15, but haven't had time to play around with it yet. On Apr 7, 9:14 pm, shabda <[EMAIL PROTECTED]> wrote: > I got the news too late, and no more invites were avialable. Anyone > who is using this, and their

Unit Tests & PREPEND_WWW

2008-04-07 Thread davenaff
I've been having problems with unit tests that check the response status codes of various pages. When PREPEND_WWW is set to True (as in test and prod), the Django test client returns a status code of 301 instead of 200 for any requested url (as dev is set up). Has anyone figured out a solution t

cursor.execute throws exception on MySql warning

2008-04-07 Thread shabda
I have a call like, crsr = connection.cursor() crsr.execute('DROP TABLE IF EXISTS news_linksearch') when table news_linksearch does not exists this would lead to a mysql warning, (Not an error, as it has a IF EXISTS clause), but this leads to a django exception. Should not the behaviour in this

Play This Game if bored

2008-04-07 Thread garala
http://www.neopets.com/refer.phtml?username=gruddzr --~--~-~--~~~---~--~~ 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

Anybody used Google app engine, and wanna share their experience?

2008-04-07 Thread shabda
I got the news too late, and no more invites were avialable. Anyone who is using this, and their views ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

The True Religion

2008-04-07 Thread acalltoislam islam
The True Religion *By Abu Ameenah Bilal Philips* -- THE RELIGION OF ISLAM The first thing that one should know and clearly understand about Islam is what the word "Islam" itself means. The religion of Islam is not named after a person as in the case of Christianity whi

Congrats to Django team on the Google App Engine

2008-04-07 Thread Lee Hinde
Talk about validating your efforts... --~--~-~--~~~---~--~~ 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 ema

Re: Way to show recently updated items from multiple apps?

2008-04-07 Thread Peter Rowell
> I am wondering if there is an easy way to implement this so I can have > a list that is contains the most recently updated items from multiple > apps. Here are two ways to do this: 1. Add a field to models that you care about. E.g. date_modified = models.DateTimeField('date modified', edit

Re: formatting patterns in FileField's upload_to?

2008-04-07 Thread [EMAIL PROTECTED]
Once ticket 5361(http://code.djangoproject.com/ticket/5361) gets committed upload_to will be able to take a callable and call it to format the folder each time. If you need these feature now perhaps you could test out the ticket. On Apr 7, 9:17 pm, akonsu <[EMAIL PROTECTED]> wrote: > hello, > >

Cleaning up Word's mess in text areas using tiny_mce

2008-04-07 Thread Rodrigo Culagovski
I am using tiny_mce to help the editors on a site edit text areas[1]. However, I worry that they will paste in text from Word and make a mess. Is there a way to strip out all the Word-generated crap (font tags, colors, etc.) while maintaining basic html tags like p, br, ul, etc? 1: http://code.dj

formatting patterns in FileField's upload_to?

2008-04-07 Thread akonsu
hello, currently the upload_to parameter of FileField can contain only strftime formatting patterns. i am looking for a way to extend this and let it contain, say, %s patterns that would be replaced by given strings during object creation. has anyone done this? thanks konstantin --~--~-~

Re: lighttpd & django, fcgi issues

2008-04-07 Thread skunkwerk
thank you so much Ramiro, I've removed the .fcgi file. the problem turned out to be that the url.rewrite part of the configuration was in my original setup, but was producing a warning and was being ignored because I hadn't uncommented the mod_rewrite module in lighttpd.conf it's working now!

Way to show recently updated items from multiple apps?

2008-04-07 Thread Ryan Vanasse
I'm working on a website for a small HD radio station that is utilizing several different apps (blog, event calendar, media, etc) and I would like to show a list of recently updated items on the main page (rdvanasse.nwc.edu/radio_e for example, it's in the upper left corner) I am wondering if the

Re: error while trying to work through chapter 3 of the django book name 'hours_ahead' is not defined

2008-04-07 Thread Ramiro Morales
On Mon, Apr 7, 2008 at 10:10 PM, Purcell <[EMAIL PROTECTED]> wrote: > > views.py-- > from django.http import HttpResponse > import datetime > > def current_datetime(request): > now = datetime.datetime.now() > html = "It is now %s." % > now > return HttpResponse(html) > > def hour

error while trying to work through chapter 3 of the django book name 'hours_ahead' is not defined

2008-04-07 Thread Purcell
I am sure this is an incredibly stupid error that is staring me in the face, but I do not know what it is. On the example where you make an hours_ahead view. I created the view in views.py and I added the pattern to urls.py, but when I try to go to a pages to test such as http://127.0.0.1:8000/tim

ANN: dbuilder.py v0.7.0 (build stand-alone Django projects)

2008-04-07 Thread srackham
New version and rename of builder.py utility (see previous post http://groups.google.com/group/django-users/browse_thread/thread/b67660d60f178ec4). Documentation here: http://www.methods.co.nz/django/dbuilder.html Project repo and download here: http://hg.sharesource.org/dbuilder/ Cheers, St

Re: lighttpd & django, fcgi issues

2008-04-07 Thread Ramiro Morales
On Sun, Apr 6, 2008 at 6:53 PM, skunkwerk <[EMAIL PROTECTED]> wrote: > > I'm having trouble running django with lighttpd (I'm not on a shared > host). Here is what I've installed: > > ubuntu 7.10 > lighttpd > flup > cmemcache > python > > When I go to my web address which maps to the djan

Re: Whitespaces in URLs

2008-04-07 Thread [EMAIL PROTECTED]
Slugs, http://www.djangoproject.com/documentation/model-api/#slugfield On Apr 7, 5:29 pm, garrido <[EMAIL PROTECTED]> wrote: > Hi everyone, > > Forgive me if this is a stupid question, but here goes: I have started > my first Django project, and in it I have an object called > "Categories" define

Re: assertion error - offset issue last objects

2008-04-07 Thread chups22
I forgot that I can order it by ID (i dont have any other order criteria like date or smth) .order_by('-id')[:5] works great. Thank you for your time. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: assertion error - offset issue last objects

2008-04-07 Thread Malcolm Tredinnick
Hmm ... I may or may not have answered your question. On Tue, 2008-04-08 at 08:32 +1000, Malcolm Tredinnick wrote: > > On Mon, 2008-04-07 at 15:29 -0700, [EMAIL PROTECTED] wrote: > > # Note that you can't use 'offset' without 'limit' (on some dbs), so > > this doesn't work: > > >>> Article.objec

Re: assertion error - offset issue last objects

2008-04-07 Thread Malcolm Tredinnick
On Mon, 2008-04-07 at 15:29 -0700, [EMAIL PROTECTED] wrote: > # Note that you can't use 'offset' without 'limit' (on some dbs), so > this doesn't work: > >>> Article.objects.all()[2:] > Traceback (most recent call last): > ... > AssertionError: 'offset' is not allowed without 'limit' > > >

assertion error - offset issue last objects

2008-04-07 Thread chups22
# Note that you can't use 'offset' without 'limit' (on some dbs), so this doesn't work: >>> Article.objects.all()[2:] Traceback (most recent call last): ... AssertionError: 'offset' is not allowed without 'limit' I want to get X last entries from a DB like in example above. How can I specify

Whitespaces in URLs

2008-04-07 Thread garrido
Hi everyone, Forgive me if this is a stupid question, but here goes: I have started my first Django project, and in it I have an object called "Categories" defined in my models. In my urls.py, I have a rule that matches http://mysite.com/category/, and everything up to here is fine. However, ca

Re: lighttpd & django, fcgi issues

2008-04-07 Thread skunkwerk
thanks Douglas, i guess there's something wrong with the way lighttpd and django are connecting, because both of them are installed properly. Which means there has to be something wrong with one or more of: a) the start fcgi daemon command b) lighttpd.conf c) yourfilename.fcgi as far as a)

Re: Django on a shared host

2008-04-07 Thread papertrail
Hi, Thank you very much for your quick reply. I got it pretty much right after you wrote it yesterday... I figured I'd get it working first, then reply with my results for everyone's benefit. :) Alas, it really took all day yesterday, a good night's rest and then getting a fresh start with a fres

Re: lighttpd & django, fcgi issues

2008-04-07 Thread Douglas E
On Apr 6, 11:53 pm, skunkwerk <[EMAIL PROTECTED]> wrote: > I'm having trouble running django with lighttpd (I'm not on a shared > host). Here is what I've installed: > > ubuntu 7.10 > lighttpd > flup > cmemcache > python > > When I go to my web address which maps to the django project > directory

Re: Eliminating DRY violations in urlpatterns

2008-04-07 Thread Marc Fargas
Hi, El lun, 07-04-2008 a las 09:08 -0700, bobhaugen escribió: > My view that creates a new order ends with this statement: > return HttpResponseRedirect('%s/%s/' >% ('order', new_order.id)) > [...] > The result of all the above is that I needed two different urlpattern

How do i tell if a 1-1 relation exists?

2008-04-07 Thread John M
I have a model that uses a 1-1 relationship to another model. My question is, how can I tell if either end of the 1-1 exists? Thanks John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: Eliminating DRY violations in urlpatterns

2008-04-07 Thread bobhaugen
Perfect. Thanks a lot, and sorry if I should have known that in the first place. On Apr 7, 11:32 am, Steve Potter <[EMAIL PROTECTED]> wrote: > On Apr 7, 11:08 am, bobhaugen <[EMAIL PROTECTED]> wrote: > > > My view that creates a new order ends with this statement: > > return HttpRes

Naked and Funny Skeleton

2008-04-07 Thread roman8111
http://rozrywka.yeba.pl/show.php?id=1522 --~--~-~--~~~---~--~~ 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 em

Re: Set Index (Home) Page

2008-04-07 Thread Kevin Monceaux
On Mon, 7 Apr 2008, ichbindev wrote: > that would take care of (b) where no page was matched. It would also > take care of (a) but in principle the home page should not be reached > through a "page not found" kind of thing. I agree, in your initial post you said: > Both of these are not handle

Re: Set Index (Home) Page

2008-04-07 Thread Tim Chase
ichbindev wrote: > I am trying to write urlconf file so that there is an index or home > page. If none of the patterns match, it should, by default, go to that > page. For example, a sample urlconf could be > > urlpatterns = patterns('', > (r'^time/$', current_datetime), > (r'^time/plus/(

Re: Set Index (Home) Page

2008-04-07 Thread ichbindev
Thanks, Kevin. Of the two situations (a) the user types http://www.example.com/ (b) the user types http://www.example.com/somethingelse/ that would take care of (b) where no page was matched. It would also take care of (a) but in principle the home page should not be reached through a "page not

Re: Set Index (Home) Page

2008-04-07 Thread Kevin Monceaux
On Mon, 7 Apr 2008, ichbindev wrote: > In short, is there such a thing as 'default' in urlpatterns so that it > calls a view when none of the other patterns match? Is something like: http://www.DjangoProject.com/documentation/url_dispatch/#handler404 what you're looking for? Kevin http://w

Set Index (Home) Page

2008-04-07 Thread ichbindev
I am trying to write urlconf file so that there is an index or home page. If none of the patterns match, it should, by default, go to that page. For example, a sample urlconf could be urlpatterns = patterns('', (r'^time/$', current_datetime), (r'^time/plus/(\d{1,2})/$', hours_ahead), ) I

Re: Another Cycle Tag Question

2008-04-07 Thread Kevin Monceaux
On Tue, 8 Apr 2008, Eric Abrahamsen wrote: > You just want plain old {% resetcycle %}, nothing else. It will reset > the innermost cycle you put it in... I tried the above, and still get the same results. I'm not sure if it makes a difference, but although I'm using cycle within a loop I've

middleware that works with Ajax

2008-04-07 Thread Claudio Escudero
Hi, Someone knows there is any middleware that works with Ajax? Tranks, Claudio --~--~-~--~~~---~--~~ 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.co

Re: Eliminating DRY violations in urlpatterns

2008-04-07 Thread Steve Potter
On Apr 7, 11:08 am, bobhaugen <[EMAIL PROTECTED]> wrote: > My view that creates a new order ends with this statement: > return HttpResponseRedirect('%s/%s/' >% ('order', new_order.id)) You should be able to just place a slash in front of your redirect statement so it

Re: Update to many registers

2008-04-07 Thread qwerty
Thanks both, I'll be using SQL until then ;) On Mon, Apr 7, 2008 at 12:54 PM, Tim Chase <[EMAIL PROTECTED]> wrote: > > > I've read that in the queryset-refactor branch is an .update > > method for the queryset, but it isn't some workaround (other > > than raw SQL) for the current HEAD branch?

Eliminating DRY violations in urlpatterns

2008-04-07 Thread bobhaugen
My view that creates a new order ends with this statement: return HttpResponseRedirect('%s/%s/' % ('order', new_order.id)) The 'order' URL fragment is appended to the orderentry form URL like so: (first url) http://127.0.0.1:8000/orderentry/order/4/ You can get to the

Re: Another Cycle Tag Question

2008-04-07 Thread Eric Abrahamsen
> Thanks, that sounds like just what I'm looking for. However, I've > applied > the patch and added a {% resetcycle rowcolors %} tag to the end of my > include tag's template but it's not resetting the cycle var. I > deleted > the defaulttags.pyc file to make sure it got recompiled and also

Re: How to check if instance with same values exists

2008-04-07 Thread Sebastjan Trepca
You'll have a problem with multiple threads/processes that cannot be solved on the Python level eg. 2 requests that would simultaneously try to create an instance. If your create requests aren't very dense, it would probably work with hooking on a pre_save signal and checking if it already ex

Re: Update to many registers

2008-04-07 Thread Tim Chase
> I've read that in the queryset-refactor branch is an .update > method for the queryset, but it isn't some workaround (other > than raw SQL) for the current HEAD branch? I believe that outside the QSR branch, the workaround *is* to use raw SQL. That's part of why it's being refactored :) -tim

Re: order by field1/field2

2008-04-07 Thread Tim Chase
>> how can i do: >> >> objects.order_by(f1/f2)?? > > What does "f1/f2" mean? > > You can do objects.order_by('f1','f2') I think the OP is looking for something like this 100% untested code: MyModel.objects.extra( select={"scaled": "f1/f2"} ).order_by("scaled") which would sort b

Re: Update to many registers

2008-04-07 Thread qwerty
Exactly like that, but the problem is that it throws an update per record. In cases where there are too many records it'll be slow (Take for example a list of 100.000 registers to be updated). I've read that in the queryset-refactor branch is an .update method for the queryset, but it isn't some

Re: order by field1/field2

2008-04-07 Thread Sebastjan Trepca
What does "f1/f2" mean? You can do objects.order_by('f1','f2') Sebastjan On 4/7/08, zak <[EMAIL PROTECTED]> wrote: > > Hi, > > how can i do: > > objects.order_by(f1/f2)?? > > Thanks, > > Zak > > > -- Sebastjan --~--~-~--~~~---~--~~ You received this mess

Re: Update to many registers

2008-04-07 Thread Sebastjan Trepca
You mean like services = Service.objects.filter(condition) for service in services: ... update the service... service.save() ? This is quite slow but should work if I understand you correctly. Sebastjan On 4/7/08, qwerty <[EMAIL PROTECTED]> wrote: > > Hi all, > > I've a models.Mod

order by field1/field2

2008-04-07 Thread zak
Hi, how can i do: objects.order_by(f1/f2)?? Thanks, Zak --~--~-~--~~~---~--~~ 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 t

Re: Another Cycle Tag Question

2008-04-07 Thread Kevin Monceaux
Eric, On Mon, 7 Apr 2008, Eric Abrahamsen wrote: > > Someone pointed me at this page, and I've been happily using the > resetcyle tag ever since.. > > http://code.djangoproject.com/ticket/5908 Thanks, that sounds like just what I'm looking for. However, I've applied the patch and added a {% re

Re: Multi user application using admin and generic views

2008-04-07 Thread Sebastjan Trepca
http://www.djangoproject.com/documentation/authentication/#authentication-in-web-requests On 4/7/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I 'm developing a web application for multi-user. Because of power of > admin interface and generic views, I 'd like to use them as much

Multi user application using admin and generic views

2008-04-07 Thread meledictas
Hi, I 'm developing a web application for multi-user. Because of power of admin interface and generic views, I 'd like to use them as much as possible. For multiple user application, specific views seem to be need, especially permission checking. Are there any example application about this? Any

Re: Creating a Random Hash for Invitations

2008-04-07 Thread Alex Ezell
Thanks for the advice, phillc. I ended up doing this in the view. As you mention, one of the reasons is that when the invite is used (user clicks the link), I mark the invite as being completed. I don't need to recalculate the hash at that point. I'm basically just using it as an ID for that row

Re: Another Cycle Tag Question

2008-04-07 Thread Eric Abrahamsen
Someone pointed me at this page, and I've been happily using the resetcyle tag ever since.. http://code.djangoproject.com/ticket/5908 On Apr 7, 2008, at 10:33 PM, Kevin Monceaux wrote: > > Django Fans, > > I have another cycle tag question. Is there any way to reset a > cycle tag > variab

Testing dynamic post data

2008-04-07 Thread Tony
I am still a newbie with Django but I am well on my way to completing my first Django application, but not yet as I am having some trouble testing and any help would be greatly recieved. I am having trouble testing some POST data. What I am trying to do in my view is post some dynamic data and t

Re: Creating a Random Hash for Invitations

2008-04-07 Thread phillc
ive implemented a hash in the save method, and ive implemented in the model default=(hash function), and ive done it in my view. they all worked fine, just remember if you override save, if you have any data that goes along with the invite and edit it, the hash will be created again unless you wr

My First Django Site

2008-04-07 Thread Kevin Monceaux
Django Fans, I started out planning to convert one or two dynamic pages of a local canine agility club's web site which I act as webmaster for to Django to see if I really liked Django and to get an idea of how long it would take to convert the whole site. Well, in just under a week I ended u

Update to many registers

2008-04-07 Thread qwerty
Hi all, I've a models.Model class called it Services with more than 1.000.000 registers. I need to perform an update on many of those registers throw a condition, but I don't want to fallback to raw SQL, is there any option of doing this with Django's ORM? Greets, Angel --~--~-~--~~

Re: Making login work with every page.

2008-04-07 Thread Thomas Guettler
shabda schrieb: > If a user is not logged in, then on each page, I have a login form. > This form posts to /accounts/login/ which does calls > contrib.auth.views.login. This view only logs in a user if the > session.test_cookie_worked(). > > So this means that from each page I need to call, > if n

Another Cycle Tag Question

2008-04-07 Thread Kevin Monceaux
Django Fans, I have another cycle tag question. Is there any way to reset a cycle tag variable so that it starts from the beginning? In a inclusion tag's template I have a {% cycle 'Odd' 'Even' as rowcolors %} tag at the top of the template and elsewhere in the template use {% cycle rowcolor

Re: ModelForms check if value has changed.

2008-04-07 Thread Thomas Guettler
Petar schrieb: > Dear someone, > > I have a ModelForm for my User (standard django) model. I want to > check if the email is unique so I created a clean_email method which > works fine. The only problem is that I only want to check the email > address when it's changed. > > Is their a way to get t

Re: How to check if instance with same values exists

2008-04-07 Thread Thomas Guettler
meppum schrieb: > I want to check the values of every new instance before I save it to > make sure that it doesn't match an instance that already exists in the > database. I know I could use db constraints and use the > unique_together setting but is there a way to do this in code? Is > there a wa

Re: When does form.clean get called?

2008-04-07 Thread shabda
So is there a cleaner way to work in form.clean instead of doing if for.cleaned_datahas_key(field): for every element? On Apr 7, 6:06 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Apr 7, 2008 at 8:19 AM, shabda <[EMAIL PROTECTED]> wrote: > > > If I have a required field and I do not spe

Re: paginator

2008-04-07 Thread Thomas Guettler
Horst Gutmann schrieb: > When you do the actual Paginator.page call the Paginator does nothing > more than you'd have with > Object.objects.[...].all()[lowerlimit:upperlimit]. > > And it does Object.objects.all().count() Which results in "SELECT COUNT(*) ..." Thomas -- Thomas Guettler, ht

middleware that works with Ajax

2008-04-07 Thread Claudio Escudero
Hi, Someone knows there is any middleware that works with Ajax, similar to RJS of Ruby on Rails? Tranks Claudio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: filter issue

2008-04-07 Thread Tim Chase
> TableName.objects.filter(fieldname_gt, val) I think you mean TableName.objects.filter(fieldname_gt=val) > But i want to be able to do the following: > > TableName.objects.filter(fieldname + "__gt", val) Here's where Python's keyword/dictionary expansion[1] becomes helpful: params = {

Re: ModelForms check if value has changed.

2008-04-07 Thread Karen Tracey
On Mon, Apr 7, 2008 at 9:37 AM, Petar <[EMAIL PROTECTED]> wrote: > > Hi Michael, > > your suggestion doesn't work for my situation. It isn't important if > the value has been filled in, but only if the value has changed from > the originally filled in value. Then you can checked the entered valu

filter issue

2008-04-07 Thread zak
Hello, So this works: TableName.objects.filter(fieldname_gt, val) But i want to be able to do the following: TableName.objects.filter(fieldname + "__gt", val) What am i missing?? Thanks, Zak --~--~-~--~~~---~--~~ You received this message because you are sub

Re: ModelForms check if value has changed.

2008-04-07 Thread Petar
Hi Michael, your suggestion doesn't work for my situation. It isn't important if the value has been filled in, but only if the value has changed from the originally filled in value. On 7 apr, 02:31, Michael <[EMAIL PROTECTED]> wrote: > Inside the clean method you have access to self.instance.pk,

Re: More Advanced Forms Help

2008-04-07 Thread yml
Hello, Your particular situation look to me very similar to the Poll, Choice sample presented on this blog : http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/ I hope this will help you. --yml On Apr 6, 2:29 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:

Re: paginator

2008-04-07 Thread Karen Tracey
On Mon, Apr 7, 2008 at 9:23 AM, zak <[EMAIL PROTECTED]> wrote: > > Hello, > > If i do something like this: > > p = paginator(MyTable.objects.all(), 100), > > where I expect MyTable.objects.all() to return about 20,000 results, > > then will involve doing the sql query like SELECT *? or is the > pa

Re: paginator

2008-04-07 Thread Horst Gutmann
When you do the actual Paginator.page call the Paginator does nothing more than you'd have with Object.objects.[...].all()[lowerlimit:upperlimit]. So yes, from what I can see in the source it's like doing a normal query with the right LIMITs applied :-) - Horst On Mon, Apr 7, 2008 at 3:23 PM, z

paginator

2008-04-07 Thread zak
Hello, If i do something like this: p = paginator(MyTable.objects.all(), 100), where I expect MyTable.objects.all() to return about 20,000 results, then will involve doing the sql query like SELECT *? or is the paginator as smart as objects.filter, and instead will do the queries as the pages

Re: Making user emails unique

2008-04-07 Thread Michael
> > In your case, you could simply copy and refact the form itself, not > the entire app, and implement that logic in there i think if your > templates dir is before the app's template dir, django would pick up > your copy, wouldn't it??? Otherwise you could also just hijack the > signup view t

Re: When does form.clean get called?

2008-04-07 Thread Karen Tracey
On Mon, Apr 7, 2008 at 8:19 AM, shabda <[EMAIL PROTECTED]> wrote: > > If I have a required field and I do not specify a value for the field, > should form.clean get called? My understanding, after reading > > http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation > ,

Re: Serving binary files "through" django

2008-04-07 Thread Eric Abrahamsen
> 1. Frontend-Proxy and static file server (i.e. Nginx od lighttpd) >if URL matches local file or rule: serve it >else: request file from Backend-Server (i.e. Apache) > 2. Backend Server >handle urls as in urls.py or your resolving strategy and serve > dynamic Data accordingly. > > In

Re: Making user emails unique

2008-04-07 Thread wiswaud
On Apr 6, 9:04 pm, Julien <[EMAIL PROTECTED]> wrote: > In fact, I'd prefer to leave what comes with Django, including contrib > apps, untouched. So that I can benefit from bug fixing and > implementation of new features done by the community. > > How about hijacking the User EmailField definitio

When does form.clean get called?

2008-04-07 Thread shabda
If I have a required field and I do not specify a value for the field, should form.clean get called? My understanding, after reading http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation, is that it should not, as clean_ will fail, and so form.clean will not be call

Re: why can't use my own freeform.html

2008-04-07 Thread book4e
I put freeform.html free_preview.html and posted.html under * project/templates/comments/* instead of *myapp/templates/comments/* and now django found these customed comments templates. Thank you for your patience. --~--~-~--~~~---~--~~ You received this message be

why can't use my own freeform.html

2008-04-07 Thread book4e
Hi all, I followed http://code.djangoproject.com/wiki/UsingFreeComment but can't let my own freeform work. I have already put freeform.html free_preview.html and posted.html under myapp/templates/comments/. There is no hidden field 'url' when I check html source although I put it in freeform.html.

Re: Serving binary files "through" django

2008-04-07 Thread Thomas Kerpe
Hi Eric Am 06.04.2008 um 06:49 schrieb Eric Abrahamsen: > > Guess I'll have to serve the files from django's apache, not my other > media server, but it seems like this will do it. That depends on your setup. You can also use a X-Sendfile or X-Accel-Redirect capable Server as your frontend-Pr

Latest computer & Mobiles

2008-04-07 Thread svgiri
Hello friends.., Success usually comes to those who are too busy to be looking for it. Visit Latest Mobiles,Laptops,Comp..., www.mobile-computer4all.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Re: how to create many records in a single transaction (or in a few transactions)?

2008-04-07 Thread Valery
Hi thanks, it worked out :) regards Valery On Apr 4, 2:04 pm, sector119 <[EMAIL PROTECTED]> wrote: > http://www.djangoproject.com/documentation/transactions/ > > On 4 Кві, 13:54, Valery <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > what is the usual Django's way to create many records in a sin

Re: Testing Search form processing

2008-04-07 Thread Tony
Ah I know where I have gone wrong now. I should have specified q instead of query in my test function. Its so obvious now. I think I spent too long looking at test function, it made my eyes blurry. Thanks Tony On Apr 7, 10:47 am, Tony <[EMAIL PROTECTED]> wrote: > I have developed an application

save the child in parent class

2008-04-07 Thread soe
Hi all, this is my model , I am using foriegn key in slot , so all the slot will be attached to class Layout if i was not wrong.I want to make save function in parent class that will save all child class too. class Layout(models.Model): lastUpdate=models.DateTimeField(auto_now=True) Serve

Testing Search form processing

2008-04-07 Thread Tony
I have developed an application using the search form from chapter 7 of the Django Book, http://www.djangobook.com/en/1.0/chapter07/. I am having trouble testing the search view, it seems like (from my view below) it is not returning 'q', but rather, returning nothing. It might be the way I have

Re: "get next" and "get last" on any field?

2008-04-07 Thread SlowLearner
Brilliant, thanks for that. As an aside, if anyone ends up finding this thread looking for a similar solution try looking here: http://www.djangobook.com/en/1.0/appendixC/ There is lots of good stuff there. I had looked in the djangobook but spent a lot of time reading the model section thinkin