Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 9:12 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 5/29/07, Ahmad Alhashemi <[EMAIL PROTECTED]> wrote: > > > I can't extend Django applications with extra features that require > > auto-discovery. I'm working on a CMS using

Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 7:53 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On 5/29/07, Ahmad Alhashemi <[EMAIL PROTECTED]> wrote: > > > Well, it is called INSTALLED_APPS, not MODELS_OF_INSTALLED_APPS, > > right? :) > > > The only reason that the "model

Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 7:24 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > Hey Ahmed -- > > Let's back up a step here: what's the problem you're having with the > way Django currently does INSTALLED_APPS? What can't you do that you'd > like to do? > > Jacob I can't change my application structure witho

Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 7:16 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On 5/29/07, Ahmad Alhashemi <[EMAIL PROTECTED]> wrote: > > > I'm definitely not suggesting a major infrastructure change. I'm just > > suggesting something similar to the passing vie

Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 7:12 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 5/29/07, Ahmad Alhashemi <[EMAIL PROTECTED]> wrote: > > > Why are we reinventing import everywhere in django? Is this really > > common in python, passing strings containing package na

Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 3:36 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On the topic of "magic", that's a very polarizing phrase. There's no > one definition of magic in the Python sense, so each person is free to > define it differently. For instance, your proposal seems (in a way) > more magical to me,

Re: Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
On May 29, 2:55 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > Could you elaborate on what's "magical" about an application? It's > just a Python module, with one convention imposed on where you put > model classes so that Django can auto-discover them; adding a whole > new level of infrastructu

Can we use a django application class?

2007-05-29 Thread Ahmad Alhashemi
Hello, Right now, django applications are strange creatures. They are python packages with some magic. They have to have a "models" module. Everything else is free form. We have strong conventions like urls.py, maybe admin.py, but they all have to be explicitly called and used in the project. Ho

Re: Contrib context processor?

2006-10-13 Thread Ahmad Alhashemi
Also, this is the most recent thread about this: http://groups.google.com/group/django-developers/browse_thread/thread/11b9a6f2b18f7daf/02cb8b3974f0a329?lnk=st&q=context+processor+settings&rnum=1#02cb8b3974f0a329 You can probably find much more threads regarding this. --Ahmad On 10/13/06, Jame

Re: Extend URL resolver support for HTTP Methods / REST support

2006-09-22 Thread Ahmad Alhashemi
+1 on the idea. It is starting to make less and less sense to treat a GET and a POST the same way just because they use the same URL. I don't think the implementation is ugly, either. I can't see how it can be made cleaner, except for using constants instead of strings for GET, POST, ..etc. But

Re: Validation Aware Models and django.forms on steroids

2006-08-25 Thread Ahmad Alhashemi
On Aug 24, 2006, at 2:21 PM, Brantley Harris wrote: > > The whole raising a Form thing is just a shocking idea. +1 At first, I really digged this raising a Form, but then I realized that it is just returning a value, but too cleverly... 1. It feels like a goto is happening (execution jumping in

Re: Django.contrib applications modifying Django to work properly?

2006-08-22 Thread Ahmad Alhashemi
On 8/22/06, Mart <[EMAIL PROTECTED]> wrote: > > Hi Chris, > > I was just wondering why wasn't there any helper methods to achieve > exactly the same result as you can by editing the Django source (in > your case the django.db), but without editing anything out of your > application's directory. >

Re: slow response when using manage runserver without Internet connection

2006-08-22 Thread Ahmad Alhashemi
Hi, I'm not sure I have a solution, but are you sure it is the built in server that is slow? Maybe you have some kind of a browser extension trying to access the Internet. Maybe you should try it using a different browser and see if there is any difference. Also, what address are you using to ac

Re: XSS comments from PHP Creator

2006-08-21 Thread Ahmad Alhashemi
On 8/22/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > On 21/08/2006, at 9:24 PM, [EMAIL PROTECTED] wrote: > > @ Ahmad - mod_security (modsecurity.org) is fantastic, and I highly > > recommend installing it on all apaches, but filtering content at the > > webserver level is a sledgehammer approach a

Re: XSS comments from PHP Creator

2006-08-20 Thread Ahmad Alhashemi
This reminds me of the autoescaping arguments. Note that you can do this outside of Django. I think that there is something like this for apache called mod_security. It works regardless of the scripting language/framework you are using. --Ahmad On 8/20/06, Paul Sargent <[EMAIL PROTECTED]> wrote

Re: translation of content

2006-08-12 Thread Ahmad Alhashemi
Kenneth Gonsalves wrote: > hi, > just a few random thoughts on translation of content. At first i was > leaning towards developing a dependant model for each model which > would hold translations. One thing i have realised is that of all the > field types, only three - CharField, TextField and num

Re: modularity of apps

2006-08-04 Thread Ahmad Alhashemi
Malcolm Tredinnick wrote: > I'm not a fan of infinite flexibility as solutions for undefined future > problems, so it's good that you've put in some specific cases you've > encountered. Food for thought here. +1 on that. All these suggestions are going to make Django much fatter. It will make th

Re: the template system's whitespace handling

2006-08-04 Thread Ahmad Alhashemi
In Rails, template tags can have an extra hyphen at the end to denote the fact that they should consume the newline right after the tag. So: {% some_tag %} Would look like this: {% some_tag -%} Isn't it possible to just add this functionality by making the newline that comes right after the ta

Re: Where escaping belongs

2006-08-04 Thread Ahmad Alhashemi
> Regarding doing a "security audit", assuming you had some method of > defining the default escaping (if any) it would seem easier and safer > to audit if you were looking for cases where you didn't need to escape > (the more rare case). But this is getting back to the main auto-escape > discussi

Re: Where escaping belongs

2006-08-01 Thread Ahmad Alhashemi
I think that this is prone to error. At least for me, when I see a piece of code like this one, I will definitly think that it needs to be escaped: {{ content }} But if I'm passing something in the view code without escaping, I will have to check the template to make sure it is being handled pro

Re: Default escaping -- again!

2006-07-28 Thread Ahmad Alhashemi
Simon Willison wrote: > Here's an idea I don't think anyone has brought up yet: what if > escaping was on by default for templates ending in .html and off by > default for templates ending in .txt? This does seem like a practical solution. But I think that it gives more meaning to template file n

Re: Default escaping -- again!

2006-07-27 Thread Ahmad Alhashemi
Default escaping couples the Django templates with HTML. I don't think that this is a good idea, even if HTML is, incidentally, the most commonly used language in templates, for the time being. --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: A proposal for URL generation

2006-07-26 Thread Ahmad Alhashemi
Great to hear that Adrian. Nevermind my post then :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe

Re: Reversed urlresolvers and included urlconfs

2006-07-26 Thread Ahmad Alhashemi
This is a know issue waiting for a solution that will satisfy the developers. I've just posted a proposed solution here in the developers list. You can also check the ticket which was opened nine months ago and is still unresolved: http://code.djangoproject.com/ticket/672 --~--~-~--~

A proposal for URL generation

2006-07-26 Thread Ahmad Alhashemi
This is a well know problem. You can read about it in the background section below. The ticket for this problem have been sitting unresolved for a long time now. I would really like to get some feedback from the developers. If you like this, I will submit a patch with the implemenation. My soluti

Re: Model inheritance API

2006-07-26 Thread Ahmad Alhashemi
A few corrections... > 2. I'm not sure weather multiple inheritance will be a feasible > solution in Python (because the code that is going to introspect the > Thing super class and add its fields to our class is model.Model, which > is one of the suer classes). It is actually feasible, I just c

Re: Model inheritance API

2006-07-26 Thread Ahmad Alhashemi
Malcolm Tredinnick wrote: > --- > 1. Abstract Base class > --- > One use-case for subclassing is to use the base class as a place to > store common fields and functionality. It is purely a "factor out the > common stuff" holder and you don't ever intend to u

Re: Cutting applications vertically, like multiple weblogs software

2006-07-02 Thread Ahmad Alhashemi
Sorry again everyone. I don't actually have a specific application. Allow me to check all the suggestions, take a better look at Django then I promise I'll come back and summarize my findings. In the mean time, does the need to tie the views with the models also apply to the proposed Row Level Pe

Re: Cutting applications vertically, like multiple weblogs software

2006-07-02 Thread Ahmad Alhashemi
Hi Luke, I agree that explicitness is better. But I think implicit filtering here is not that bad for two reasons. The first is, as I said, it is the rule not the exception. The second is that it makes it extremely easy to start your application as a single site application then turn it into a mu

Re: Cutting applications vertically, like multiple weblogs software

2006-07-01 Thread Ahmad Alhashemi
Hi Malcolm, Thank you for your reply. Sorry that my first email wasn't clear. I wasn't asking on how to add this feature to an actual application I currently have, I'm asking for pointers because I want to add a new feature to Django's core that will make it easier to add such a feature to any D

Cutting applications vertically, like multiple weblogs software

2006-06-30 Thread Ahmad Alhashemi
Hello, Immagine that I created a weblog application. Then I decide to make it accomodate multiple weblogs, by adding a weblog model and weblog_id to all records in the application. Is there an easy way to achieve this without having to change all the model code in the application? I mean so that