Are there any Django events we're missing on Lanyrd?

2011-01-28 Thread Simon Willison
Hi everyone, My main project at the moment is Lanyrd, the social conference directory. It's a site that helps you find conferences to attend or speak at, and that enables you to build a profile of talks you've given and events you've attended in the past. There's just one problem: right now we

Re: Displaying ManyToMany relations in Admin

2008-09-19 Thread Simon Willison
On Sep 19, 10:24 am, "Nick Sandford" <[EMAIL PROTECTED]> wrote: > Is there some kind of limit the admin imposes on the number of items > it will show in a or the horizontal filter list? If so, can I > change it? Also, is there any better way to do this? raw_id_fields is the admin option you

Re: Restrict users to their own data

2008-09-11 Thread Simon Willison
On Sep 11, 5:23 pm, Glimps <[EMAIL PROTECTED]> wrote: >     I would like to restrict users to the data they can see/modify/ > delete on a table. I have a Reservation table that holds reservations > for multiple banners of Restaurant chain. I don't want the user from > franchiseX to be able to

ANN: dmigrations, a new migrations system for Django

2008-09-03 Thread Simon Willison
written more about the release here: http://simonwillison.net/2008/Sep/3/dmigrations/ The project (including documentation and a tutorial) is here: http://code.google.com/p/dmigrations/ I'll be discussing the project on the schema migration panel at DjangoCon this weekend. Cheers, Simon

Some Django debugging tips

2008-05-22 Thread Simon Willison
Hi all, I've written up a bunch of techniques for debugging Django applications: http://simonwillison.net/2008/May/22/debugging/ I'm collecting more tips in the comments. Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are

Re: need to use both django 0.96 and django trunk for work

2008-04-29 Thread Simon Willison
On Apr 29, 10:03 pm, berthor <[EMAIL PROTECTED]> wrote: > I was told by my boss that I would be using both django 0.96 and > django trunk on 2 separate projects. Now I'm not sure how to go about > doing this, as I have been working with only django 0.96 before. I've > downloaded the trunk

Re: sql_queries does not include all the sql statements

2008-04-29 Thread Simon Willison
On Apr 29, 9:31 am, leopay <[EMAIL PROTECTED]> wrote: > oh,sorry ,I made a mistake,it is Entry.objects.all()[0:1] > I means when I write like this Entry.objects.all()[0:1],I cannot find the > this raw sql like 'select col_name from entry_table limit 1' in > sql_queries,but if I write like this

Re: Queryset-refactor branch has been merged into trunk

2008-04-27 Thread Simon Willison
On Apr 27, 8:48 am, Thierry <[EMAIL PROTECTED]> wrote: > What's the current opinion about integrating sql alchemy into the > backend of django's ORM? There's an active project to do exactly that hosted here: http://gitorious.org/projects/django-sqlalchemy/ Some of the features in

Re: considering django for The Freesound Project, some (de)constructive critisism

2008-01-22 Thread Simon Willison
omes in, then splurge it all through to the application running behind it at once when the whole file is available to the load balancer. I'm pretty sure Perlbal has this ability. Would this solve your file upload problem, or is there something else that I'm missing? Ch

Job: Django developer in central London

2008-01-07 Thread Simon Willison
about either the job or GCap feel free to contact me directly (don't reply to the whole list). Cheers, Simon Willison --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Basic Form Design Question: Pulling as much as possible from models

2008-01-07 Thread Simon Willison
On Jan 7, 5:07 pm, Wes Winham <[EMAIL PROTECTED]> wrote: > http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ > > A shiny solution to the problem with code and the reasoning behind it. > Simon Willison is awesome. It's Malcolm that's awesome, I just link to

Re: Using a signal to update a counter cache??

2007-11-30 Thread Simon Willison
On Nov 30, 4:48 pm, "Tane Piper" <[EMAIL PROTECTED]> wrote: > As you can see in the Branch model, there is a field called num_leafs > - I've been reading the signals documentation and had a look on the > web, but I'm still having difficulty getting my head around it. What > I want to do is when

Re: Very large scale sites in Django

2007-06-02 Thread Simon Willison
On May 31, 5:30 pm, Daniel Ellison <[EMAIL PROTECTED]> wrote: > A quick glance at the memcached site says that it's used on LiveJournal, which > gets over 20,000,000 page requests per day. Excellent. Not quite at our > traffic level, but not too shabby. :) Memcached is pretty much the industry

Re: browser detection middleware

2007-05-22 Thread Simon Willison
On May 22, 9:38 am, omat <[EMAIL PROTECTED]> wrote: > Is it a good idea to use a middleware class to detect the browser > client looking at the HTTP_USER_AGENT so as to serve presentation > logic accordingly, for mobile devices or older browsers, etc...? I would advise against this because it

Re: Newforms and Hidden Fields - verifying POST data

2007-04-23 Thread Simon Willison
ered with my data!" else: my_data = pickle.loads(pickled.decode('base64')) The same technique can be used in lots of other places - cookies for example. The only way the user can tamper with the data you have sent them is if they know your SECRET_KEY. Hope that

Implementing OpenID in your Django app

2007-04-23 Thread Simon Willison
Hi all, I've just released the first version of an OpenID consumer package for Django. The idea is to make it ridiculously easy to add OpenID consumer support to any Django application - and hence allow users of OpenID to sign in without having to set up a new username and password.

Re: pure-HTTP deployment?

2006-12-22 Thread Simon Willison
Sylvain Hellegouarch wrote: I'd be interested to know which version of CP Simon was running. CP3 is way more stable, efficient and comprehensive that CP2 (and its WSGI server is like ten steps ahead). __version__ = '3.0.0beta2' I'm really interested as to what kind of failures can be

Re: pure-HTTP deployment?

2006-12-21 Thread Simon Willison
Simon Willison wrote: I'm interested in this for a couple of reasons. Firstly, it's less bits of software - if we could tell people "Install Django, install Reinhardt[1]... That [1] was meant to be accompanied with a footnote saying that Reinhardt would be an awesome name for a robust

Re: serving multiple hosts from a single django instance ?

2006-12-21 Thread Simon Willison
Sort of. I've achieved this in the past with a bit of ugliness - basically, I pointed everything at the same view and wrote my own code within it that dispatched based on the hostname. There's an open proposal at the moment to make the url dispatching logic a view function itself (a view that

Re: pure-HTTP deployment?

2006-12-21 Thread Simon Willison
Jacob Kaplan-Moss wrote: A number of people have made this same assertion, and I'm a bit curious about it. Is there a reason that using Apache/mod_python as the app server and nginx/perlbal as a distributor is somehow less effective than a pure-Python solution? I'm interested in this for a

Re: pure-HTTP deployment?

2006-12-21 Thread Simon Willison
Chad Whitacre wrote: Simon, Well, after that I have to tip my hand. :^) I've started such a project, called Aspen: http://www.zetadev.com/software/aspen/ I've got a bit of a philosophical problem with Aspen - the fact that it supports "five different development patterns". I'm interested

Re: pure-HTTP deployment?

2006-12-20 Thread Simon Willison
Jacob Kaplan-Moss wrote: On 12/20/06 2:23 PM, Chad Whitacre wrote: > I'm interested in deploying Django as a pure-Python HTTP daemon, much > like Zope and CherryPy are deployed. Is this done at all w/ Django? I'm pretty sure that's how Simon is serving his new site -- see

Django covered in podcast with Guido

2006-08-05 Thread Simon Willison
http://www.twit.tv/floss11 Django gets some good discussion about 50 minutes in. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Myghty Templates in Django - ver. 1

2006-08-01 Thread Simon Willison
> 2a. The easy way to use mygthy templates is to render them and send the > result to a "Blank" django template which will show the results > a simple view: > [...] > def myview(request): > file = AFile() > #execute a template > interpreter.execute('mytemplate.myt',

Re: Wondering about few 'burried' issues

2006-07-27 Thread Simon Willison
On 27 Jul 2006, at 11:39, Sebastian F wrote: > But then it hit me, ticket was closed with > resolution 'wontfix' (http://code.djangoproject.com/ticket/2004). I am > curious, why? Your guess is as good as mine - it looks like the ticket was closed by the person who opened it. The Django core

Re: simplejson & umlauts

2006-07-24 Thread Simon Willison
On 24 Jul 2006, at 12:21, patrickk wrote: > has anyone ever used simplejson with umlauts? > I´m reading a title from a blog-entry which has umlauts and they are > not displayed correctly. I doubt this is a problem with simplejson; it seems to handle unicode characters just fine. I imagine you

Re: AttributeError: class Http404 has no attribute 'has_header'

2006-07-24 Thread Simon Willison
On 24 Jul 2006, at 01:17, Jacob Kaplan-Moss wrote: >> Has anybody else seen this error? It's obvious that Http404 doesn't >> have the method, it's just a subclass of Exception. If this is just a >> Django bug, I'll happily post a patch, just want to feel out any >> possible stupidness on my part

Re: Any good Python book recommendations?

2006-07-22 Thread Simon Willison
On 23 Jul 2006, at 06:03, Sean Schertell wrote: > I've downloaded Dive into Python and it looks good. But I need > something I can read on the subway or in the bathtub. Something I can > dog-ear and highlight -- a real book! > > Any recommendations? I'm brand new to Python and want to learn for

Re: Duct tape

2006-07-21 Thread Simon Willison
On 21 Jul 2006, at 17:55, Elver Loho wrote: >> I wonder if you could be a bit more explicit here... I can't think of >> a single place where you "just set a variable and have it do >> something cool", so I'd like to know more about what scares you. > > The admin module?

Re: Django v code generators (codecharge)

2006-07-20 Thread Simon Willison
On 20 Jul 2006, at 15:47, walterbyrd wrote: > If I were "up to speed" with python and django, could I develop as > quickly as I could with a code generator? Yes. As a general rule, code generators are unnecessary if you are using a sufficiently dynamic language (such as Python). Historical

Re: Displaying thumbnails in the admin interface

2006-07-19 Thread Simon Willison
On 19 Jul 2006, at 16:22, kwe wrote: > Is there a way to display images in the list_display admin frontend? > > I tried writing a custom method for the model which returned the > necessary html to display the image - without success. The custom > method in the list_display just returned the raw

Re: Related tags query, many-to-many double join

2006-07-19 Thread Simon Willison
On 19 Jul 2006, at 13:50, Maciej Bliziński wrote: > is it possible to make the same thing without writing custom SQL code? No it isn't - but that's fine, that's exactly why Django allows (and encourages) you to roll your own SQL when you need to:

Re: debugging xmlhttprequest POST's is a PAIN! Need help.

2006-07-14 Thread Simon Willison
On 14 Jul 2006, at 18:34, Scott Chapman wrote: > It's in an xmlhttprequest call so I never get to see the blow up, > and it's a > form POST so I can't simply call it with some command line parms in > the > browser to see it - so I'm flying blind a bit. Get yourself Firefox and the

Re: book recommendations?

2006-07-10 Thread Simon Willison
On 10 Jul 2006, at 06:42, arthur debert wrote: > also, simon willison's javascript introduction is excellent: > > http://flickr.com/photos/simon/sets/72057594077197868/ There's a better version of it up on the Mozilla Developer wiki now - other people have been fixing all the bugs :)

Re: Store and retrieve template code from database

2006-07-05 Thread Simon Willison
On 5 Jul 2006, at 14:32, plungerman wrote: > i would like to store django template code in a database and retrieve > it for display. The Django template system was originally designed with this exact use-case in mind - we made sure that there was flexibility as to where the templates were

Re: Request_Response Problem

2006-06-27 Thread Simon Willison
On 28 Jun 2006, at 02:21, HoLin wrote: > ?type_encode=0=python=.cn=.com=.net > > using request.REQUEST.get("root") can only get the last value *.net* > how can I get the right value of root? request.GET.getlist('root') will get you back a list of all of the root= values. This is one of my

Re: Adding search functionality

2006-06-27 Thread Simon Willison
On 27 Jun 2006, at 08:53, Kristoffer wrote: > I can import Q with "from django.core.meta import Q", but I can't find > QuerySet. Did it exist in version 0.91? No. QuerySet is part of the vastly superior magic-removal ORM, which was introduced in Django 0.9.5. There are instructions on

Re: Repetitive background tasks

2006-06-26 Thread Simon Willison
On 26 Jun 2006, at 19:07, Harish Mallipeddi wrote: > I'm wondering if someone could advise me on how to do certain periodic > background tasks with django? For instance, if I needed to retrieve a > list of RSS feeds daily to check for updates how would I do that? > > Is there a way to do this

Re: OT: dynamically generated files?

2006-06-22 Thread Simon Willison
On 22 Jun 2006, at 21:33, Scott Finnie wrote: > My proposed solution is to insert the session id into the filename > (since, for a given session, there can only be one image used at any > given time). That should work but will need a cleanup job to clear > the > temp dir periodically. > > So

Re: Site testing How-To

2006-06-07 Thread Simon Willison
On 7 Jun 2006, at 05:33, Joseph Kocherhans wrote: > I think you want tocreate something like testsettings.py, and in that > file do something like: > > from myproject.settings import * > > then override the specific settings you want. It won't work with > manage.py, but your tests should be

Re: Site testing How-To

2006-06-07 Thread Simon Willison
On 7 Jun 2006, at 02:42, Todd O'Bryan wrote: > Does anybody have a best practice (or not-too-annoying practice) for > testing? > > I think I'll use Selenium to test my site, but how should I change to > a test database, populate the test database, etc.? This is an area where Django can learn a

Re: Serious Noobie question, what the $ for in urlpatterns.

2006-06-06 Thread Simon Willison
On 6 Jun 2006, at 03:26, John M wrote: > how does that differ from > > (r'^polls/'), > (r'^polls/(\d+)/$') > > Note the $ is missing from the first line of the second example. > > When you don't have a $ in the polls/ setup, it doesn't scan down to > the other entries. > > Since I'm so

Re: Ajax support, there is no need for reinventing the wheel

2006-06-05 Thread Simon Willison
On 5 Jun 2006, at 02:31, Scott Anderson wrote: > You have to make sure to trap both successes and failures in the > Javascript code -- I don't know how mochikit does that, but with > prototype you need to specify an onFailure hook to get errors. MochiKit models its async stuff on Twisted

Re: Locale from URL Middleware

2006-04-05 Thread Simon Willison
On 5 Apr 2006, at 12:26, limodou wrote: > Why you need do this? Because django can auto judge the language from > your browser request http head, or context settings, or settings. If > you like , you can provide a language selection in web page, and > that's enough. The url doesnot need to be

Re: Storing News articles - retaining some HTML tags

2006-01-19 Thread Simon Willison
On 1/19/06, tonemcd <[EMAIL PROTECTED]> wrote: > Didn't realise stripogram was so open to those sort of exploits (I've > only ever used it to get rid of the stuff that might mangle layout). > There's obviously more to this than meets the eye. Here are some interesting resources on the challenges

Re: Storing News articles - retaining some HTML tags

2006-01-19 Thread Simon Willison
On 15 Jan 2006, at 23:22, tonemcd wrote: If your articles have HTML in them, you'll need to be careful that no 'dangerous' HTML is included (javascript is the most common). A good library is stripogram - http://www.zope.org/Members/chrisw/StripOGram/readme While I still strongly advocate not

Re: Duplicate object

2006-01-12 Thread Simon Willison
On 12 Jan 2006, at 05:43, Eric Walstad wrote: The following approach ('shallow' copy) has worked well for me: import copy b = copy.copy(a) b.id = None b.save() Maybe it would be useful for all Django model objects to gain themselves a duplicate() method which does exactly this - returns

Re: Data from multiple engines/data in one Django app (or project)

2006-01-05 Thread Simon Willison
On 5 Jan 2006, at 17:48, mortenbagai wrote: Is there a way to model data from multiple, separate data sources in the same Django project? Not at the moment, but it's under active discussion: http://code.djangoproject.com/ticket/1142 Please add a brief description of your requirement to

Re: ANN: "Snakes and Rubies" (Django/Rails meetup) video/audio available

2006-01-05 Thread Simon Willison
On 5 Jan 2006, at 15:17, stinger wrote: You said in the download page "If at all possible, please use BitTorrent! Our servers thank you..." It would be useful if there were torrents for just Adrian's talk, just the Q etc. Cheers, Simon

Re: Suitability, Performance and scalability Info

2006-01-05 Thread Simon Willison
On 5 Jan 2006, at 11:40, ChaosKCW wrote: I of course want something better and django stands out. Its mostly for interactive apps, as opposed to static content, so my first questions is can I do things like javascript and xmlhttprequest (ie AJAX ) in django easily ? I am sure I can but

Re: built-in reference

2006-01-04 Thread Simon Willison
On 4 Jan 2006, at 19:42, The Boss wrote: Nevermind. It magically started working when I tried to show someone how it didn't work. It probably just needed a server restart. Django's development server code reloading stuff work's for most cases, but if you're seeing odd behaviour it's

Re: Web host for Django, what to ask for?

2006-01-01 Thread Simon Willison
On 31 Dec 2005, at 18:39, Michael Hipp wrote: I'm hoping to convince my current hosting provider (zipa.com) to support Django. (Switching providers would be a pain right now.) What would I tell them I need? apache mod_python psycopg postgresql (or mysql) (1 database?) One approach

Re: Django and Multiple Database Support

2005-12-29 Thread Simon Willison
On 29 Dec 2005, at 20:29, Jacob Kaplan-Moss wrote: I've always though that this particular -- and common -- use case should be delegated to the DB level using one of the many excellent replication/distribution tools for your database. For example, you could easily do read distribution

Re: SQL Injection

2005-12-20 Thread Simon Willison
On 21 Dec 2005, at 01:37, Silas Snider wrote: Do they just quote the string? Or do they use a 'bind variable' type idea? Example: If an attacker typed ' or 'a'='a into a password input field for instance, would the ORM properly prevent the attempted attack from

Re: Paginating complex queries

2005-11-23 Thread Simon Willison
On 23 Nov 2005, at 14:59, Afternoon wrote: Is there a way that the request object could be exposed to custom tag code, but not the template itself? The aim with the template system has always been to keep it de- coupled from the request/response stuff, so it can be used as a standalone

Re: Finding numbers of visitors

2005-11-22 Thread Simon Willison
On 22 Nov 2005, at 17:43, Luciano Rodrigues da Silva wrote: I think that is time for the admin have some statistics usage of the applications. Or maybe another app include with the package. Stats is a very obvious application for Middleware. I bet you could do something very, very cool

Re: 20 minute wiki, sortof.

2005-11-18 Thread Simon Willison
On 18 Nov 2005, at 15:26, Robert Wittams wrote: Hm, maybe when DEBUG is on, CommonMiddleware should put up an interstitial page to tell the developer what is happening? It does seem to bite a lot of people. Alternatively, we could just have CommonMiddleware throw a deliberate server

Re: 20 minute wiki, sortof.

2005-11-18 Thread Simon Willison
On 18 Nov 2005, at 09:12, David Ascher wrote: Specifically, I'd love feedback on the views ( http:// da.textdriven.com:8027/sydney/file/trunk/wiki/apps/pages/views.py) and the template ( http://da.textdriven.com:8027/sydney/file/trunk/ wiki/templates/pages/page.html You should do this in

Re: Preventing Google Web Accelerator from prefetching

2005-11-17 Thread Simon Willison
On 16 Nov 2005, at 23:10, Jacob Kaplan-Moss wrote: However... the concept is. Developers shouldn't be blocking GWA; we should be programming web apps that conform to expected HTTP behavior. GWA *only* issues GET requests, and if an app modifies data based on a GET, then the app should

Re: Several domains, one django project

2005-09-29 Thread Simon Willison
On 29 Sep 2005, at 16:10, Adrian Holovaty wrote: Yes, this is entirely possible -- it's how Django is used at World Online. You'll just need to create a separate settings file for each domain, and just point each VirtualHost in your Apache configuration at the appropriate settings file.

Re: Performance and scalability

2005-09-29 Thread Simon Willison
On 29 Sep 2005, at 15:06, Tau wrote: What you, the authors of django, can provide on the subject of django's performance and scalability. I find the framework architecture to be excellent but, literally speaking, what if I migrate my php sites to django. Will hardware upgrade be inevitable?

Re: Django-powered sites on the wiki

2005-09-14 Thread Simon Willison
On 9/14/05, Simon Willison <[EMAIL PROTECTED]> wrote: > I've started a list of public websites powered by Django on the > development wiki: Here's the link: http://code.djangoproject.com/wiki/DjangoPoweredSites

Django-powered sites on the wiki

2005-09-14 Thread Simon Willison
I've started a list of public websites powered by Django on the development wiki: Django powered sites Please add your Django-powered site if it's not already listed. Cheers, Simon Willison http://simon.incutio.com/

Re: {% if method(arguments) %}

2005-09-11 Thread Simon Willison
On 11 Sep 2005, at 20:16, Mookai wrote: Is it possible to use this syntax of do I have to write an own template tag? I want to use it to check if a module has to be displayed based on permissions: {% if user.get_module_perms(app.name) %} That syntax won't work - but the magic perms