Q about cache backend for sessions and clustering

2009-01-18 Thread Andrew Ingram
for the first request won't be returned until the session data has been written successfully - which means there are no sync issues. Is the same true of the memcached-based backend? i.e is the response delayed until there is some confirmation that the cache has been written to? Regards, Andrew

Enhanced versions of simple_tag?

2009-01-20 Thread Andrew Ingram
(user_id,number): return Order.objects.filter(user_id=user_id).limit(number) like this: {% latest_orders request.user.id 5 as orders %} Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

I don't even know where to begin writing this template-tags

2009-01-20 Thread Andrew Ingram
can think of is very unappealing. Regards, Andrew Ingram --~--~-~--~~~---~--~~ 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 unsubs

Context and Variable.resolve

2009-01-21 Thread Andrew Ingram
regexps could be used to do some basic branching. Any thoughts would be appreciated. Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Context and Variable.resolve

2009-01-22 Thread Andrew Ingram
Hm, I thought that's what I had tried, obviously I was doing something slightly wrong. Oh well, it works now. Thanks for your help :) bruno desthuilliers wrote: > As often with Python, the simplest thing to do is to fire a Python > shell and explore the problem: > > from django import

Problem with django-tagging and with_all/with_any

2009-01-22 Thread Andrew Ingram
(('listing','joe')) It returns the banner, when by my understanding it shouldn't. It's returning the same result as: Banner.tag_objects.with_any(('listing','joe')) Have I completely misunderstood how this is supposed to work? Regards, Andrew Ingram

Re: I don't even know where to begin writing this template-tags

2009-01-22 Thread Andrew Ingram
That works great, thanks! bruno desthuilliers wrote: > http://www.djangosnippets.org/snippets/1293/ > This may help: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

ImageField, width_field, height_field not working

2009-01-23 Thread Andrew Ingram
. Regards, Andrew Ingram --~--~-~--~~~---~--~~ 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 d

Re: ImageField, width_field, height_field not working

2009-01-23 Thread Andrew Ingram
Thanks for your response Karen, I've tried the workaround in the ticket and I get this error: Exception Type: AttributeError Exception Value: 'InMemoryUploadedFile' object has no attribute 'width' I have a vague recollection that this was actually working before I did the

Re: ImageField, width_field, height_field not working

2009-01-23 Thread Andrew Ingram
I've just tried saving the model using the approach followed in Django's unit test and the database gets populated correctly, this reinforces the likelihood of it being an admin-related issue. Regards, Andrew Ingram, Karen Tracey wrote: > http://code.djangoproject.com/ticket/9545 >

Re: ImageField, width_field, height_field not working

2009-01-23 Thread Andrew Ingram
I reverted Django to revision 9756 (just after aggregation was merged in) and everyone works fine, so evidently a commit made in the last few days has caused this issue. Regards, Andrew Ingram On Jan 23, 6:40 pm, Andrew Ingram <a...@andrewingram.net> wrote: > I've just tried saving

Re: ImageField, width_field, height_field not working

2009-01-23 Thread Andrew Ingram
> > Regards, > Malcolm > I've narrowed it down to revision 9766: "Fixed #10044: You can now assign directly to file fields (`instance.filefield = somefile`)." http://code.djangoproject.com/ticket/10044 It's late now, but I'll update the ticket tommorrow if nobody else has

reverse foreignkey "add" method using multiple INSERTs

2009-01-27 Thread Andrew Ingram
using a single INSERT with all the objects. I'm no expert on whether this is optimal or not, I just want to be sure that this behaviour is deliberate rather than an oversight. Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you

Has anyone looked into writing an SSH backend for file uploads?

2009-01-29 Thread Andrew Ingram
to connect to which would allow you to upload to all the machines at once (but even if there's one that only allows you to upload to one machine that would still be useful). Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-29 Thread Andrew Ingram
On Jan 29, 1:19 pm, Christian Joergensen wrote: > What if one of the machines was unresponsive at the time of the upload? One option would be to have all the files uploaded locally, but the handler would additionally copy to the other locations. The other would just to be to have

Re: Django Forms in HTML 4.01 Strict

2009-01-29 Thread Andrew Ingram
it has yet to be done (nobody has agreed on the best way to do it) Regards, Andrew Ingram --~--~-~--~~~---~--~~ 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@googl

Re: Someone using django trunk for production?

2009-01-31 Thread Andrew Ingram
hey're broken if used in the admin module after revision 9765. That's the only issue I'm aware of with trunk. Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: Error saving a Model with a custom image field

2009-02-02 Thread Andrew Ingram
k and will cause an exception. I've rolled back to revision 9765 for the time being. Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: problem with simple shopping cart

2009-02-02 Thread Andrew Ingram
save this to the db and store the cart id in the session. This can create a problem with having a bunch of orphan carts in the db after the sessions have expired though, normal solution is to have a script that periodically cleans up any old carts. Other solution is that you store the

Re: Looking to give presentation on Django at work

2009-02-09 Thread Andrew Ingram
have you looked on djangosnippets.org? 2009/2/9 jeffself : > > Is there a presentation available that I can use? Would like to skip > the whole building of the presentation myself if possible. If there > isn't one, I may create an "open-source" presentation myself and make

Re: comparisons with java framework

2009-02-11 Thread Andrew Ingram
develop a cross-platform build script for the docs is one thing but it's pretty arrogant to dismiss it outright. The Django devs are perfectly entitled to ignore Windows as far as docs go, but please don't make assumptions about the abilities and needs of your

Re: comparisons with java framework

2009-02-11 Thread Andrew Ingram
iginally. > > Alex If this is the case then maybe all we need is better instructions on building the documentation to be added to the Django site. - Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: Multiple different user profile objects - Django code design help

2009-02-19 Thread Andrew Ingram
h user.order_account or user.newsletter_account. Regards, Andrew Ingram Gok Mop wrote: > I'm struggling with how to design something, and I'm pretty sure > somebody has an easy solution. > > I need to store different information about different classes of > users. I want to attach thos

Manually parsing a URL and returning the view name and args

2009-02-27 Thread Andrew Ingram
them to return the correct URL. Is there a straightforward way to use django's url parser to take a URL and return the information I need? Presumably to turn them back into a URL I just need to use the reverse functionality somehow. Regards, Andrew Ingram

Re: Manually parsing a URL and returning the view name and args

2009-02-27 Thread Andrew Ingram
That's a good point, I'll solve the problem by setting up redirects. Still it's nice to know about the resolve function. Regards, Andrew Ingram 2009/2/27 Ned Batchelder <n...@nedbatchelder.com>: > > I'm curious why you think view names and arguments will remain unchanged > in t

Re: Using Javascript

2008-10-08 Thread Andrew Ingram
use a django-served template for your JS file. 2008/10/8 Johnny <[EMAIL PROTECTED]>: > Hi everyone, > > I'm writting a Web App using Django and I got problems to make appear or > deasappear some content. > > Here is the code I was using to write a part of the windows: > > >

Reorder a queryset/list with respect to another list

2008-10-08 Thread Andrew Ingram
to the list of Ids. I know Django templates have reorder functionality, but that just sorts by a property, what I'm looking for is a bit more complex. Is there anything at the Python level I should be using? Thanks, - Andrew Ingram --~--~-~--~~~---~--~~ You received

Re: Reorder a queryset/list with respect to another list

2008-10-09 Thread Andrew Ingram
Malcolm Tredinnick wrote > Here's one way that comes to mind: When you do the selection based on > the id's, use the in_bulk() queryset method. That returns you a > dictionary mapping each id value to the object with that id (see below > for how to do this without in_bulk() if that's not

Re: Root Access

2008-07-12 Thread Andrew Ingram
solutions I can't see myself doing anything more than a simple blog without looking into a VPS or dedicated server with root access. Regards, Andrew Ingram Tim Johnson wrote: > I'm a long-time python web programmer. My company is interested in Django. > > I note from the following Amazon UR

Re: Injecting error messages into ModelForm

2008-07-13 Thread Andrew Ingram
other frameworks i've tried. - Andrew Ingram Torsten Bronger wrote: > Hallöchen! > > While ModelForm.is_valid() finds field validation errors, it cannot > catch errors in uniqueness or referential integrity as far as I can > see. Thus, I have to check them in my view.py code sepa

Re: Is Django development active?

2008-07-20 Thread Andrew Ingram
James Bennett wrote: > On Sun, Jul 20, 2008 at 6:57 AM, Hussein B <[EMAIL PROTECTED]> wrote: > >> I got that illusion due the slow official releases cycle... >> > > Be careful with this logic, because it is misleading. For example: > Britain has not had a new Prime Minister since June

Python literal to equivalent model with efficient updates

2008-09-08 Thread Andrew Ingram
, Andrew Ingram --~--~-~--~~~---~--~~ 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 [EMAIL

Re: using save() on FormWizard

2008-09-17 Thread Andrew Ingram
In the done() method you are provided with a list of the validated forms so you can just do: for form in form_list: form.save() before returning your response 2008/9/17 Martin <[EMAIL PROTECTED]>: > > Greetings, > > i'm playing with FormWizard and i'm having some problem saving each > step

Re: Access logs?

2009-03-18 Thread Andrew Ingram
Django doeesn't do any request logging, it should be handled by your web server's own logging (usually apache). There's nothing special about Django that would cause it to be treated any differently. - Andrew Theme Park Photo, LLC wrote: > Is there an existing Django application that will log

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Andrew Ingram
with some limitations but you keep fairly short and logical URLs. Regards, Andrew Ingram 2009/4/16 Marcin Mierzejewski <marcin.mierzejew...@gmail.com>: > > Hi Aidas, > >> 7. Using the controlling words before the type of list: >>     /by-popularity/products

Re: Search and urls

2009-04-21 Thread Andrew Ingram
e do this, but without the /search/ part. The site we are building uses search as a filter, so any listing page can have ?q=foo added to perform a search within the list. As an added bonus, by using a query parameter it makes it possible to track search usage in Google Analytics without hacking

[Querysets] Trying to determine status of an order based on the properties of its order items

2009-04-23 Thread Andrew Ingram
the orders for individual orders rather than for everyone, but an efficient solution is still preferred. Any ideas would be appreciated Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Parsing the arguments in HTTP GET

2009-05-19 Thread Andrew Ingram
This is the only real way to do this with Django, though I do wish there was a core Django way to validate GET params, ie which ones are allowed and what format they should be. - Andrew Ingram 2009/5/19 Will Matos <w...@tcdi.com>: > > You wouldn't match this using a url patter

Re: Parsing the arguments in HTTP GET

2009-05-19 Thread Andrew Ingram
I've used the forms framework with GET (I'm using it for a search form and a 'q' parameter), but it never occurred to me to use it to validate non-form parameters. Thanks! - Andrew Ingram 2009/5/19 Russell Keith-Magee <freakboy3...@gmail.com>: > > On Tue, May 19, 2009 at 10:3

Prevent ImageField from trying to load the file automatically on model load?

2009-05-28 Thread Andrew Ingram
locally which obviously doesn't exist. All I want from the imagefield is the filename/path, everything else I need from the image file itself is already stored in the database. Is there a way I can disable the file-loading part of the imagefield? Regards, Andrew Ingram

Re: Prevent ImageField from trying to load the file automatically on model load?

2009-05-28 Thread Andrew Ingram
That seems to have fixed the problem, thanks! - Andrew On 28 May, 13:45, Michael <newmani...@gmail.com> wrote: > On Thu, May 28, 2009 at 8:21 AM, Andrew Ingram <a...@andrewingram.net>wrote: > > > > > Hi all, > > > Some of our models make use of Image

strange database issue, values getting saved correctly, but not appearing through querysets

2009-06-12 Thread Andrew Ingram
, the relationship works fine (it's not a site-level caching thing because the issue affects my dev environment pointing at the live database) Any thoughts would be greatly appreciated Regards, Andrew Ingram --~--~-~--~~~---~--~~ You received this message because you

Re: strange database issue, values getting saved correctly, but not appearing through querysets

2009-06-12 Thread Andrew Ingram
I've now resolved this issue, it was caused by a combination of a database config error and using the wrong model manager Regards, Andrew Ingram On 12 June, 12:09, Andrew Ingram <a...@andrewingram.net> wrote: > I'm having a problem with a manytomany relationship in Django.. >

Re: popup forms

2009-10-13 Thread Andrew Ingram
608). I hope this helps. - Andrew Ingram 2009/10/13 nabucosound <hecto...@gmail.com>: > > This is the default behaviour in Django Admin, dude... > > On Oct 13, 9:43 am, andreas schmid <a.schmi...@gmail.com> wrote: >> hi, >> >> how can i achieve a behav

Re: Do I have to pass the httprequest object to render_to_response every time?

2009-10-21 Thread Andrew Ingram
become available if you use render_to_response Regards, Andrew Ingram --~--~-~--~~~---~--~~ 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 un

Re: newforms

2008-06-02 Thread Andrew Ingram
It looks like you need to add the form to your view contexts. return render_to_response ("UPSRateLookUp/upsratelookup.html",{ "form": form "results": results, "query": query }) else: form = form_upslookup() return render_to_response

Re: {{ media_url }}

2008-06-05 Thread Andrew Ingram
Chances are that one of the views isn't passing the media template context processor to the template. = Andrew Bobby Roberts wrote: > i've got two templates in the same directory. My css works fine on > one template but not the other. My link to the css is > > > > Can you think of any

Re: {{ media_url }}

2008-06-05 Thread Andrew Ingram
On Thu, Jun 5, 2008 at 4:20 PM, Andrew Ingram <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > Chances are that one of the views isn't passing the media template > context processor to the template. > > = Andrew > > Bobby Roberts wr

Re: Question about Form Wizard

2008-06-06 Thread Andrew Ingram
I believe the general best practice is that sessions should be viewed as a last resort for storing data. You can store data in a number of places and they each have their benefits and drawbacks. The easiest place to store data is the URL, but storing user-specific information in the URL is a

Re: Model - Only allow One

2008-06-14 Thread Andrew Ingram
bruno desthuilliers wrote: > Anyway, why would you want such a thing ? I can think of one possible use, when you want some project settings to be configurable at run-time through the admin interface. At the moment I would probably relate a settings model to the site model, but I think the site