Re: streaming upload

2008-07-03 Thread Mike Axiak
Hi jm, I've been trying to reproduce your problem with no success. Can you please post your nginx configuration (a safe version, obviously)? Also, if you stop by #django, my username is axiak. It might be easier to track this down in IRC. Cheers, Mike On Jul 2, 6:26 pm, umrzyk <[EMAIL

Re: store user as owner automaticaly

2008-04-10 Thread Mike Axiak
I usually do it via JavaScript [1]. However, this only works in an environment when you trust the person editing the content (i.e. the Admin). -Mike 1: http://mike.axiak.net/media/js/admin_overrides.js --~--~-~--~~~---~--~~ You received this message because you

Re: (Very) Large File Upload - mod_python MemoryError

2008-04-09 Thread Mike Axiak
I'm am one of the authors of the 2070 patch [1]. Indeed, it is what will help you here. However, I'm not sure how it will work with your code as I don't really see the context and I'm not omniscient. However, here's how you'd write to files in #2070:: from django.core.files.filemove import

Re: Google App Engine & Django

2008-04-08 Thread Mike Axiak
I've posted a message [1] on google's App Engine group asking for some insight into the DataStore <--> Django Models mapping problem. Hopefully it won't get lost amid the influx of emails on that list. Cheers, Mike 1:

Re: using threadlocals to get current user outside views

2008-04-03 Thread Mike Axiak
I wouldn't use it. For the admin, I find myself using javascript just fine to do what I want. I usually have a middleware that sets the current user id as a cookie, then run something like the following javascript in the admin on window load: (requires jquery with cookie plugin) /*

Re: Track number of hits on object

2008-04-03 Thread Mike Axiak
On Apr 3, 3:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If you are counting hits as every time it is accesed from the db, I > would overide the __init__ method. I'd rather be explicit. Writing {{ obj.get_hits }} is really not that taxing. You can also modify the get_hits() method

Re: Track number of hits on object

2008-04-03 Thread Mike Axiak
Hey Evan, If you're looking for performance, you might want to try using memcached's 'inc' command. You might have to get the backend directly from django's cache api and hence break abstraction, but it might be worth it. If the exact number of hits aren't that important to you, maybe you can

Re: CacheMiddleware issue

2008-03-28 Thread Mike Axiak
; > Thanks, Brandon > > On Mar 27, 5:45 pm, Mike Axiak <[EMAIL PROTECTED]> wrote: > > > Brandon, > > > It appears that the Cache Middleware does not read the content from > > the file before caching the response [1]. I'm not sure if this is a > > bug

Re: CacheMiddleware issue

2008-03-27 Thread Mike Axiak
Brandon, It appears that the Cache Middleware does not read the content from the file before caching the response [1]. I'm not sure if this is a bug or not...though I'd probably lean towards it being a bug. (Do we not cache middleware to *always* evaluate a file object before caching the

Re: Feisty-updates now contains Python-2.5.1final

2007-05-26 Thread Mike Axiak
AIL PROTECTED]> wrote: > On Sun, May 27, 2007 at 12:36:04AM -0000, Mike Axiak wrote: > > Ubuntu Feisty Fawn now has Python 2.5 [1] (thanks, Matthias Klose!). > > For any apt-compatible system, the following should/might work: > > Funny enough, you should note that Feisty _sh

Feisty-updates now contains Python-2.5.1final

2007-05-26 Thread Mike Axiak
Hello, This seems to warrant an announcement (just given the volume of IRC problems in the recent past)... Ubuntu Feisty Fawn now has Python 2.5 [1] (thanks, Matthias Klose!). For any apt-compatible system, the following should/might work: Add to your apt/sources.list (if it's not in there

Re: newbie asks how to filter QuerySet of authors using first and last name at the same time

2007-05-24 Thread Mike Axiak
You need a little more power than what you're doing. My initial reaction would be to use operator and Q objects: from django.db.models import Q import operator Q_user_search = reduce(operator.or_, [Q(first = first, last=last) for (first, last) in authorList])

Re: Sorting on calculated fields

2007-05-24 Thread Mike Axiak
transform for efficiency, just put it in a list: query_list = [(x.calculated_field, x) for x in queryset] query_list.sort() query_list = [x[1] for x in query_list] All of these solutions, however, do not scale as well as they would if you could express them in SQL. Cheers, Mike Axiak

Re: manipulator.do_html2python(new_data) not working?

2007-05-23 Thread Mike Axiak
If you have checkbox fields you also need to run ``prepare``:: ... manipulator.prepare(new_data) manipulator.do_html2python(new_data) ... I hope this helps, -Mike On May 23, 12:11 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Can you post your manipulator code? > > On May

Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-04 Thread Mike Axiak
Hi, I copied the code exactly as you have it and tested, and -- as I expected -- it worked fine. Are you sure you set the first_name and last_name fields correctly? Perhaps you're looking at the wrong object? Cheers, Michael Axiak On May 4, 7:19 am, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote:

Re: Is it possible to redirect with POST data?

2007-05-03 Thread Mike Axiak
esponse(data) conn.close() raise Http404 This is a very rough sketch of the shadiness you can do. Cheers, Mike Axiak 1: http://docs.python.org/lib/module-httplib.html On May 3, 4:24 pm, "Bob T." <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a situation where I would l

Re: Adding fields dinamically to a model

2007-05-03 Thread Mike Axiak
/magical, you can write careful __getattribute__ and __setattribute__ to emulate fields. Cheers, Mike Axiak On May 3, 12:50 pm, Gulopine <[EMAIL PROTECTED]> wrote: > I know of one way of going about this, but it relies on a Django patch > (#4144) that hasn't been in

Re: Dictionaries of dictionaries in a template

2007-05-03 Thread Mike Axiak
Hi Will, When you do {{ site }}, it should follow the rules and print str(ts_data[...]), which is probably not what you want. A more pythonic way to do what you want: {% for site in ts_data.items %} Site: {{ site.0 }} Rank: {{ site.1.rank }} ... {% endfor %} Cheers, Mike Axiak On May

Re: QueryDict variables with multiple levels

2007-05-03 Thread Mike Axiak
Actually, doing something similar to this was actually a source of a DoS attack on PHP [1]. It does seem to me one of the features of Django that there is little processing done to the actual request. Cheers, Mike Axiak 1: http://www.php-security.org/MOPB/MOPB-03-2007.html On May 3, 11:58 am

Re: Preselected drop-down menu value with oldforms...

2007-05-02 Thread Mike Axiak
of errors = new_data = {}, write out: errors = {} new_data = {'drop_selection': 'US'} I hope this helps! Cheers, Mike Axiak On May 2, 9:34 pm, dbee <[EMAIL PROTECTED]> wrote: > Guys, I'm trying to preselect a value for a drop down menu by passing > that menu a value. Probl

Re: request for generic views functionality...

2007-04-14 Thread Mike Axiak
processor to get the information you need? Note that it may be the case that neither of these appropriately match your problem. In that case, why not write your own 4-line view? You can even use function wrappers (in python > 2.3, decorator syntax) to maintain DRY. Hope this helps. Cheers, M

Re: Dumb URL question

2007-04-14 Thread Mike Axiak
, Mike Axiak On Apr 14, 10:34 am, "Mike Hostetler" <[EMAIL PROTECTED]> wrote: > I've been looking at this for a couple of hours and I have no idea > what is happening. > > In my urls.py I have this: > > urlpatterns = patterns('', > (r'^admin/myap

Dynamic International Fields Available

2007-04-14 Thread Mike Axiak
/. Cheers, Mike Axiak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED

Re: Django app serves PDFs but browser doesn't render them

2007-04-05 Thread Mike Axiak
is available at http://www.djangosnippets.org/snippets/157/ Hope this helps you, Mike Axiak On Apr 4, 11:41 pm, queezy <[EMAIL PROTECTED]> wrote: > Ah, the light just went on (finally!). I will put the http variable in > where pdfbytes is found. > > Thanks Malcolm! >

Re: Another Django CMS customization question

2007-04-04 Thread Mike Axiak
a CMS you want, why don't you like something already created? Cheers, Mike Axiak On Apr 4, 7:20 pm, "Joshua" <[EMAIL PROTECTED]> wrote: > Hello all, > > I am completely new to the Django project and have some initial > questions that I hope someone can answer for me. &g

Re: Q Object Oddity

2007-02-03 Thread Mike Axiak
d used two inner joins, which IMHO is an incorrect interpretation. -Mike On Feb 3, 8:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > On 4 Lut, 00:46, "Mike Axiak" <[EMAIL PROTECTED]> wrote: > > > y = Q(satprepreginfo__program =

Re: Q Object Oddity

2007-02-03 Thread Mike Axiak
uot;."user_id" INNER JOIN "program_satprepreginfo" AS "auth_user__satprepreginfo" ON "auth_user"."id" = "auth_user__satprepreginfo"."user_id" WHERE ( ( ("auth_user__registrationprofile"."program_id" = 6 AN

Q Object Oddity

2007-02-03 Thread Mike Axiak
Hey, I'm using Django release (currently 0.95.0, waiting for etch to move to 0.95.1) with some patches (lazyuser patch comes to mind) on an internal development. The question is, I was trying to do some Q object combinations and was met with some weird results: y = Q(satprepreginfo__program =