Using annotate() in a custom model manager

2011-08-19 Thread LaundroMat
Hi - I have these models; with one custom manager. class OrderByHighestScoreManager(models.Manager): def get_query_set(self, *args, **kwargs): qs = super(OrderByHighestValidationsManager, self).get_query_set(*args, **kwargs) return qs.annotate(score=Count('votes__id'),).order_

Re: Django queryset custom manager - refresh caching

2010-12-20 Thread LaundroMat
On Dec 20, 2:23 pm, Daniel Roseman wrote: > On Monday, December 20, 2010 11:03:10 AM UTC, LaundroMat wrote: > > > Hi - > > > Django seems to be caching data that I query through a custom method on a > > model. I've tried to describe the issue over at SO ( >

Re: Django queryset custom manager - refresh caching

2010-12-20 Thread LaundroMat
On Dec 20, 2:23 pm, Daniel Roseman wrote: > On Monday, December 20, 2010 11:03:10 AM UTC, LaundroMat wrote: > > > Hi - > > > Django seems to be caching data that I query through a custom method on a > > model. I've tried to describe the issue over at SO ( >

Re: Localized timesince template tag?

2009-09-01 Thread LaundroMat
On Aug 31, 1:55 pm, LaundroMat wrote: > I seem to remember being able to have template tags and filters > localized in Django, but I can't find any information on this back. > Did I misremember, or have my search skill deteriorated? > > I'm particularly looking for a

Localized timesince template tag?

2009-08-31 Thread LaundroMat
I seem to remember being able to have template tags and filters localized in Django, but I can't find any information on this back. Did I misremember, or have my search skill deteriorated? I'm particularly looking for a Dutch localization of the timesince template tag.. Many thanks in advance,

Re: Modifying the way a ChoiceField is rendered

2009-06-04 Thread LaundroMat
On Jun 4, 11:15 am, Tom Evans wrote: > On Wed, 2009-06-03 at 14:28 -0700, LaundroMat wrote: > > Hi - > > > I'm trying to change the way a ChoiceField (with widget = > > forms.RadioSelect) is being rendered in a template. Currently, > > rendering the form as

Modifying the way a ChoiceField is rendered

2009-06-03 Thread LaundroMat
Hi - I'm trying to change the way a ChoiceField (with widget = forms.RadioSelect) is being rendered in a template. Currently, rendering the form as_p() for instance, will return HTML such as: choice 1 ... Is there a way to control how this ChoiceField is rendered? I'd like to use something els

Re: Django App build - the right process?

2009-02-24 Thread LaundroMat
On Feb 24, 3:25 pm, Alfonso wrote: > I've been putting together a Product Database and Customer Order > application that requires a lot of interim calculations, things like > tax, customer discounts etc.  Due to my limited knowledge of django/ > python I have been basically performing these calcu

Securely storing passwords

2009-02-24 Thread LaundroMat
Hi - I'm working on a small django app that allows users to interact with other websites where they have an account. Ofcourse, using this app means providing your username and password for the other website. What are the most secure ways of handling this information? I suppose encrypting the pas

Re: Entering unicode bytestrings in Django

2009-02-12 Thread LaundroMat
On Feb 12, 8:33 pm, Karen Tracey wrote: > On Thu, Feb 12, 2009 at 12:18 PM, LaundroMat wrote: > > > Hi - > > > I'm scraping some information from a website, but I'm having some > > trouble with special characters such as é. I'm using BeautifulSoup for &

Entering unicode bytestrings in Django

2009-02-12 Thread LaundroMat
Hi - I'm scraping some information from a website, but I'm having some trouble with special characters such as é. I'm using BeautifulSoup for the scraping, and would like to be able to have Django print out muy strings correctly (on the template, in the shell, in the admin). The way I go about i

Using AJAX and 'normal' forms

2008-11-26 Thread LaundroMat
Hi - I've just started fiddling about with the prototype library in order to build in some AJAX functionality into my django site (which hasn't gone live yet). On one part of the page I'm using the Ajax.PeriodicalUpdater function which asynchronously polls a URL and then integrates the html resp

Re: request.POST.get is not working

2008-09-10 Thread LaundroMat
On Sep 10, 1:50 pm, bharathi <[EMAIL PROTECTED]> wrote: > Hi LaundroMat, > >     I tried request.POST['task'] .. But that also not working.. >    It shows >    " MultiValueDictKeyError at /addtask/ >    "Key 'task' not found in <QueryD

Re: request.POST.get is not working

2008-09-10 Thread LaundroMat
On Sep 10, 12:25 pm, bharathi <[EMAIL PROTECTED]> wrote: > Hi, >   I am using Django1.0 >   In this request.POST.get() is not Working..It Gives empty value > (snip) What about request.POST['task']? --~--~-~--~~~---~--~~ You received this message because you are su

Re: New to django and python. error following tutorial w/ the shell

2008-05-05 Thread LaundroMat
On 6 mei, 06:32, Norman <[EMAIL PROTECTED]> wrote: > and what editor do you use? > some advice? Geany (PC & Linux, Mac probably too) is the one I use. As for books, Core Python Programming is invaluable (to me at least) - see http://www.amazon.com/Core-Python-Programming-2nd/dp/0132269937/ref=pd

Re: Subclassing a form, changing one field into required = False

2008-05-05 Thread LaundroMat
On 5 mei, 14:39, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, May 5, 2008 at 7:08 AM, LaundroMat <[EMAIL PROTECTED]> wrote: > > On 1 mei, 13:43, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > > On Thu, May 1, 2008 at 7:2

Re: using frames in django

2008-05-05 Thread LaundroMat
On 5 mei, 05:26, Gboro54 <[EMAIL PROTECTED]> wrote: > Hi everyone...I want to use frames in a web app i am building..I have > a display.html that has the frames sets and takes 2 other html > files...the one problem is the other 2 pages have variables binded to > them...I am not sure how to get th

Re: Subclassing a form, changing one field into required = False

2008-05-05 Thread LaundroMat
On 1 mei, 13:43, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, May 1, 2008 at 7:22 AM, LaundroMat <[EMAIL PROTECTED]> wrote: > > > Hi - > > > Would it be possible to subclass a form class, and in that subclass > > define that one of

Subclassing a form, changing one field into required = False

2008-05-01 Thread LaundroMat
Hi - Would it be possible to subclass a form class, and in that subclass define that one of the fields that were required in the parent class are no longer required in the subclass? Thanks, Mathieu --~--~-~--~~~---~--~~ You received this message because you are s

Confusion over new users and admin pages

2008-04-24 Thread LaundroMat
Hi, When creating a new user, is_active is automatically set to True. The django docs say this means "Designates whether this account can be used to log in. Set this flag to False instead of deleting accounts." On the admin pages of a django website however, next to the "Active" flag, the descri

Re: Django Web Hosting Service

2007-11-25 Thread LaundroMat
I have had good experiences (albeit limited; the hosted site is more a testing thing than something else at the moment) with a small orange as well: asmallorange.com On Nov 21, 2:40 pm, "Ronaldo Z. Afonso" <[EMAIL PROTECTED]> wrote: > Hi all, > > Can anybody recommend me a Django Web Hosting Se

Re: pagination for search result ...

2007-08-10 Thread LaundroMat
request["filter"] is a session variable, that's why it works :) On Aug 10, 5:25 am, "Kai Kuehne" <[EMAIL PROTECTED]> wrote: > On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote: > > > > > > > hi, > > > > def list_filter(request): > > > """Update session filter""" > > > # request['filter'] is

Re: auth system - check if user already exists

2007-08-06 Thread LaundroMat
Are you sure you want to avoid that? I remember somebody here linking to an article where this wasn't advised, because it's (apparently) quite common for members of the same household to register with the same e-mail address (but with another username ofcourse). On Aug 6, 12:02 pm, Aljosa Mohorov

Re: auth system - check if user already exists

2007-08-06 Thread LaundroMat
Of the top of my head, but would the following be helpful? user, new = User.objects.get_or_create(username = user, email = email) The function returns either: - a new user object and True if the user didn't exist yet (and had to be created); - an object with existing user data and False. Mind th

Re: OR a Q object - Problem with ManyToMany relationships?

2007-08-03 Thread LaundroMat
your (what I assume is a) > ManyToManyField/ForeignKey. > > On Aug 2, 5:37 pm, LaundroMat <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Suppose I have defined the models from the django documentation > > (http://www.djangoproject.com/documentation/db-api/). >

OR a Q object - Problem with ManyToMany relationships?

2007-08-02 Thread LaundroMat
Hi, Suppose I have defined the models from the django documentation (http://www.djangoproject.com/documentation/db-api/). I'm performing a search the entries model, and I want to look through all of its fields: from django.db.models import Q query = 'querystring'

Re: shortcut for assigning values to model?

2007-07-20 Thread LaundroMat
On 20 jul, 10:53, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > is there a short cut for assigning input data to model's data > attribute? > > if Book is a model then > > b = Book(request.POST) > b.save() > > the assignment will be done on all the match key of the request.POST > QueryDict and

Re: Logging in a newly created user

2007-07-18 Thread LaundroMat
On Jul 18, 9:08 am, Jonathan Buchanan <[EMAIL PROTECTED]> wrote: > LaundroMat wrote: > > Hi, > > > When running this, I get a "NoneType has no attribute > > is_authenticated()" error, and I cannot understand why: > > > 1 new_user = User.objects

Logging in a newly created user

2007-07-17 Thread LaundroMat
Hi, When running this, I get a "NoneType has no attribute is_authenticated()" error, and I cannot understand why: 1 new_user = User.objects.create_user(username, "your.email", password) 2 new_user.is_active = False 3 new_user.save() 4 user = authenticate(username = new_user.username, password =

Re: one model per file

2007-07-12 Thread LaundroMat
On 12 Jul, 10:21, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > I am following the official tutorial of django, and found out that > several model are define in a single file. I just wonder if we could > have one model per file? or can be as flexible as X no of models in > file A and Y no of mo