Re: Making Django easier to get started

2005-11-22 Thread James Bennett
On 11/22/05, Beorn <[EMAIL PROTECTED]> wrote: > There are two parts to "ease of learning". One is how easy it is to > get started, the other is how easy it is to keep going. Ruby does > pretty well on both fronts. One of the things that bothers me about Rails is that you get the "instant gratif

Re: SITE's -- an idea to make them transparent/easier to use

2005-11-22 Thread Kevin
Ok, I jumped into Django's code and it seems that the where_constraints is instead an array of sql strings, not the keyword mapping. so instead of: where_constraints = {'online__exact: True} you would need: where_constraints = ['online = true'] Unfortunately, this basically makes it impossible t

Re: Making Django easier to get started

2005-11-22 Thread Beorn
There are two parts to "ease of learning". One is how easy it is to get started, the other is how easy it is to keep going. Ruby does pretty well on both fronts. Ruby's more extensive skeleton isn't all bad: Ruby generates a lot of empty directories that actually "sell" the notion that this is

Re: Multi-language support in Django

2005-11-22 Thread wang bin
Thanks for reply, and hi Krzysztof Drozd I don't understand some code you writed, could you please explain it, thanks. And also my english is not good, if any offend please forgive me :) 2005/11/22, Krzysztof Drozd <[EMAIL PROTECTED]>: > class Publication(meta.Model): > title = meta.CharField(

Re: Smart input filtering

2005-11-22 Thread Robert Wittams
Looking at it again, I think you might be right - any default filter is going to miss stuff, and cause unexpected data loss. Also, the more we do catch, the greater the runtime penalty. (If you think about it, filtering input to be 'safe' for a computation almost canonically maps to the halting pr

Re: SITE's -- an idea to make them transparent/easier to use

2005-11-22 Thread Kevin
In my same sample scenario, would this prevent me from accessing the "offline" articles in the admin or from python? Can you create a more specific query in get_list() that cancels that where_constraints? eg, If I changed my model to: class Article(Model): online = BooleanField() clas

Re: meta.Model extrass

2005-11-22 Thread Krzysztof Drozd
in my case: class Conteiner(meta.Model): name = meta.CharField() class META: admin = meta.Admin() class Site(meta.Model): title = meta.CharField() con = meta.ForeginKey(Conteiner) class META: admin = meta.Admin() and now when i have: con1: s1.lang=pl,s2.lang=en,s3=lang=de con2:

Re: Smart input filtering

2005-11-22 Thread Luke Plant
On 22/11/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > No. The developer finds out that if he wants to create an XSS attack > catalog, he needs to be explicit about it. If a developer fails to read > the documentation, he is not going to get the most out of the framework. We are both wanting t

Re: SITE's -- an idea to make them transparent/easier to use

2005-11-22 Thread Adrian Holovaty
On 11/22/05, Simon Willison <[EMAIL PROTECTED]> wrote: > Rails has a neat solution to this problem: http://api.rubyonrails.com/ > classes/ActiveRecord/Base.html#M000728 > > Article.with_scope(:find => { :conditions => "blog_id = 1" }) do > Article.find(1) # => SELECT * from articles WHERE blo

Re: meta.Model extrass

2005-11-22 Thread Adrian Holovaty
On 11/22/05, Krzysztof Drozd <[EMAIL PROTECTED]> wrote: > can i do that with the lang field?? see: > http://groups.google.com/group/django-developers/browse_thread/thread/3491a40d8b680ee9 > on "Multi-language support in Django" thred on this group??? Yes, that's definitely possible -- you can mak

Re: SITE's -- an idea to make them transparent/easier to use

2005-11-22 Thread Simon Willison
On 21 Nov 2005, at 19:17, Kevin wrote: class Article(meta.Model): online = meta.BooleanField() But now my views are littered with: articles.get_list(online__exact=True) I'd much prefer to have this online check to be done "behind the scenes" so I don't forget to test for it in someplace

Re: meta.Model extrass

2005-11-22 Thread Krzysztof Drozd
yes, that is it :) thanks can i do that with the lang field?? see: http://groups.google.com/group/django-developers/browse_thread/thread/3491a40d8b680ee9 on "Multi-language support in Django" thred on this group??? if yes, then django is the best thing on the world :)

Re: meta.Model extrass

2005-11-22 Thread Adrian Holovaty
On 11/22/05, Krzysztof Drozd <[EMAIL PROTECTED]> wrote: > it would by nice to have a new extra field in the django admin panel > thats can work as a publish un publish poll/site/... or > publish_on_date. > > now django show all stufffs in the DB, what when i have write a TEXT or > Poll and won pub

Post-dating objects (was: meta.Model extrass)

2005-11-22 Thread Jacob Kaplan-Moss
On Nov 22, 2005, at 7:36 AM, Krzysztof Drozd wrote: it would by nice to have a new extra field in the django admin panel thats can work as a publish un publish poll/site/... or publish_on_date. This is best done at the view level; an object is an object and the database shouldn't know about

meta.Model extrass

2005-11-22 Thread Krzysztof Drozd
it would by nice to have a new extra field in the django admin panel thats can work as a publish un publish poll/site/... or publish_on_date. now django show all stufffs in the DB, what when i have write a TEXT or Poll and won publish it in next week?? my english is poor and ugly i know that :)

Re: Multi-language support in Django

2005-11-22 Thread Krzysztof Drozd
i have some idee. my model: from django.core import meta from django.conf.settings import LANGUAGES class Publication(meta.Model): pub_name = meta.CharField(maxlength=16,verbose_name='publication name') class META: admin = meta.Admin() class Site(meta.Model): language = meta

Re: Smart input filtering

2005-11-22 Thread Simon Willison
On 22 Nov 2005, at 09:03, Simon wrote: PHP does (try) to do something similar - with the magic_quotes_gpc setting ( gpc = "Get, Post, Cookie" ), it automatically adds slashes to strings - for those who don't do PHP: I think the web development world has pretty much universally agreed th

Re: Multi-language support in Django

2005-11-22 Thread hugo
>Currently Django only supports selecting a language based on > the browser's Accept-Language setting. Most web > frameworks allows overriding this setting with a > cookie-based setting, so that you can easily switch the > language without changing the browser settings. Is anyone > working on th

Multi-language support in Django

2005-11-22 Thread wang bin
Currently Django only supports selecting a language based on the browser's Accept-Language setting. Most web frameworks allows overriding this setting with a cookie-based setting, so that you can easily switch the language without changing the browser settings. Is anyone working on this? If not,

Re: Smart input filtering

2005-11-22 Thread Simon
Hi all, PHP does (try) to do something similar - with the magic_quotes_gpc setting ( gpc = "Get, Post, Cookie" ), it automatically adds slashes to strings - for those who don't do PHP: 1) the user enters: O'reilly 2) this data is slashed to O\'reilly and placed into the superglobal array ( i.e.

Re: Smart input filtering

2005-11-22 Thread Sune Kirkeby
On 11/22/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > Why are you ignoring the whole aim of this thread? The point is to do > the *safest* thing possible *when* the developer doesn't specify > anything else. The point is when the developer wants to do something > potentially *stupid and dangero