Re: would is_loggedin be better than is_anonymous?

2006-07-12 Thread Gary Wilson
What if we instead make it so that context_processor.auth only sets the "user" template variable if request.user is not an AnonymousUser instance and then in templates you would use {% if user %} I am logged in. {% endif %} to determine if the user is logged in. If the user is not logged in, th

Re: Test framework for end-user applications

2006-07-12 Thread Adrian Holovaty
On 7/12/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > I'm almost ready to submit some patches (I still need to do some code > cleanup and write some documentation), but before I do: > 1) Are there any comments on the approach that I have suggested? > 2) Is this a big enough change that peop

Re: Test framework for end-user applications

2006-07-12 Thread Jay Parlar
On 7/12/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > Unless you can make a particularly convincing case for using an alternative, > based upon some deficiency of unittest that will adversely affect django > testing, I'm inclined to stick with whats in the standard library. > > If the powe

Re: Test framework for end-user applications

2006-07-12 Thread Malcolm Tredinnick
On Wed, 2006-07-12 at 17:13 +0300, Jyrki Pulliainen wrote: > On 7/12/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: [...] > > When a test targets is executed, django-admin: > > 1) creates a test database named 'test_' + settings.DATABASE_NAME > > This is created to the database server being u

Re: Test framework for end-user applications

2006-07-12 Thread Russell Keith-Magee
On 7/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Just as an additional data point, or point of discussion or whatever,...In summary, it's py.test without the magic, plus support for pluginsthat can be used to change test selection, running and reporting.Unless you can make a particularly c

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread oggie rob
Create your own admin/submit_line.html template. -rob --~--~-~--~~~---~--~~ 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 unsubscri

Re: Test framework for end-user applications

2006-07-12 Thread Russell Keith-Magee
On 7/12/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: I'll write up what I was thinking about in another mail; I started topost it in response to this, but it adds no value to your proposal.Baited breath, and all that :-) We are going to see more and more cases of a models/ sub-directory, notj

Re: Test framework for end-user applications

2006-07-12 Thread Russell Keith-Magee
On 7/12/06, Michael Radziej <[EMAIL PROTECTED]> wrote: For my own project, I put together a testing middleware for viewsand manipulators, which saves the context given to a template andallows tests that are solely context based. The middleware canalso write out test cases while you use the browser.

Re: related object's fields in the admin options

2006-07-12 Thread Luke Plant
On Wednesday 12 July 2006 21:27, Gary Wilson wrote: > Jay Parlar wrote: > > You can use functions inside list_display: > > > > class Admin: > > list_display = ('get_last_name',) > > > > def get_last_name(self): > > return self.user.last_name > > get_last_name.short_desc

Re: Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Luke Plant
On Wednesday 12 July 2006 16:49, Iván Alemán wrote: > does anyone have integrated django with an actual development > environment, like the one I described above LAMP? > > does the integration works with minor workarounds? I'm not quite sure what you mean. I'm using Django with LAMP (L = Linux

Re: would is_loggedin be better than is_anonymous?

2006-07-12 Thread SmileyChris
Yea, I'm not really that sold on .is_loggedin() either... some alternatives: .is_real_user() .is_known() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Iain Duncan
> For the admin interface, probably your best option is to override the > delete view. This is very simple, actually, because all actions are > directed by the url and can be overridden by urls.py. > > So, in your urls.py file, above include('admin/', ...), type in > something like: > (r'(\w+)/(\

Re: Translation problem when not logged in

2006-07-12 Thread Gribbie
I do have {% load i18n %} in my template already - will try your function tomorrow, it's home time now :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Iain Duncan
> For the admin interface, probably your best option is to override the > delete view. This is very simple, actually, because all actions are > directed by the url and can be overridden by urls.py. > > So, in your urls.py file, above include('admin/', ...), type in > something like: > (r'(\w+)/(\

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread oggie rob
> That's what I'm after. But I see no reason why we could accomodate more > options! =) For the admin interface, probably your best option is to override the delete view. This is very simple, actually, because all actions are directed by the url and can be overridden by urls.py. So, in your url

Re: related object's fields in the admin options

2006-07-12 Thread Gary Wilson
Jay Parlar wrote: > You can use functions inside list_display: > > class Admin: > list_display = ('get_last_name',) > > def get_last_name(self): > return self.user.last_name > get_last_name.short_description = "Last Name" But you can't sort or seach it. --~--~---

Re: Translation problem when not logged in

2006-07-12 Thread Nebojsa Djordjevic
Gribbie wrote: > I've got a click the flag on the welcome screen - when they 1st load > the page it is in english - it uses the last 2 lines of the method: > > request.session['django_language']='en-uk' > return render_to_response('welcome.html', {'request':request, > 'user':request.u

Re: related object's fields in the admin options

2006-07-12 Thread Jay Parlar
On 7/12/06, Gary Wilson <[EMAIL PROTECTED]> wrote: > > So I've got a model resembling: > > == > from django.contrib.auth.models import User > > class ExtendedUser(models.Model): > user = models.OneToOneField(User) > > class Admin: > list_display = ('user',) > search

related object's fields in the admin options

2006-07-12 Thread Gary Wilson
So I've got a model resembling: == from django.contrib.auth.models import User class ExtendedUser(models.Model): user = models.OneToOneField(User) class Admin: list_display = ('user',) search_fields = ('user',) == The admin has a user column but it is so

Re: Translation problem when not logged in

2006-07-12 Thread Gribbie
If I display {{request.sesssion.django_language}} on my template it is "en-uk" on 1st load which is correct. I then click the french flag which passes lang='fr' and... If I use HttpResponseRedirect then the page is translated but {{request.sesssion.django_language}} is still 'en-uk'. If I use r

Re: Suggestion for #1602, urlify.js blocks out non-English chars [was urlify.js blocks out...]

2006-07-12 Thread everes
Hi. If we japanese make character mappings, it will be millions and can't cover all of them. Mapping plan doesn't seem realistic for Chinese too. So I agree with Antonio and Bill. But people who use latin charcter prefer mappings to encoding, I think. How about plugable python logic with each c

Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Iván Alemán
hello, we're a group of 11 developers + 2 designers, we basically develop using LAMP + Smarty + Subversion and Dojo we are starting a new project that includes several sections and features like blogs, forums, music section, members profiles, etc, some sections are already in a "beta" stage and o

Re: Manipulators going away?

2006-07-12 Thread Le Roux
Hi When will Manipulators be replaced? I didn't notice any big checkins that might relate to it and couldn't find more info in the wiki or on django-developers. I'm a bit worried, because I've got quite a lot of code in custom manipulators. Never really liked them much, so any improvements will

Re: Test framework for end-user applications

2006-07-12 Thread Jyrki Pulliainen
On 7/12/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > I've got a project at work that requires a formal test harness, so I > thought I would kill two birds with one stone and spend some time adding a > formal test framework for all Django applications. > > This came up a few weeks ago [1],

Re: Test framework for end-user applications

2006-07-12 Thread [EMAIL PROTECTED]
Just as an additional data point, or point of discussion or whatever, I've been working on a plugin for my test runner (nose) that is quite similar in operation to what you've described above. If you want to check it out, you can get nose via easy install: easy_install nose and the plugin here: s

Re: Suggestion for #1602, urlify.js blocks out non-English chars

2006-07-12 Thread Petar Marić
Here're Serbian mappings (default Serbian language in Django is Serbian Latin): var SERBIAN_LATIN_MAP = { "š": "s", "đ": "dj", "ž": "z", "č": "c", "ć": "c" } var SERBIAN_CYRILLIC_MAP = { "а": "a", "б": "b", "в": "v", "г": "g", "д": "d", "ђ": "dj", "е": "e", "ж": "z", "з": "z", "и":

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Jeff Forcier
It's too early in the morning for me to read this thread in detail, but I'd like to mention that I ran into a similar problem a while back and wrote a small patch for it. It's against a pre-MR trunk and I haven't had time to update it for post-MR, but it's pretty simple and should be easy to modif

Re: Manual settings and the user's environment

2006-07-12 Thread Malcolm Tredinnick
On Thu, 2006-07-06 at 11:20 +0800, Russell Keith-Magee wrote: > On 7/6/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: [...] > One idea that was bounced around in my conversation with the > client was > that TIME_ZONE defaults to empty (or None, preferably) and if, >

Re: Translation problem when not logged in

2006-07-12 Thread Gribbie
Hiya I've got a click the flag on the welcome screen - when they 1st load the page it is in english - it uses the last 2 lines of the method: request.session['django_language']='en-uk' return render_to_response('welcome.html', {'request':request, 'user':request.user}) If they click

Re: Suggestion for #1602, urlify.js blocks out non-English chars [was urlify.js blocks out...]

2006-07-12 Thread David Larlet
2006/7/12, Bill de hÓra <[EMAIL PROTECTED]>: > > Malcolm Tredinnick wrote: > > > Personally, I was kind of hoping whoever wrote > > the patch might think this sort of thing through and give us a concrete > > target to throw ideas at. :-) > > Hi Malcolm, > > Here we go: > > [snip] > > > I need to t

Re: Suggestion for #1602, urlify.js blocks out non-English chars

2006-07-12 Thread Bill de hÓra
Andrey Golovizin wrote: > Bill de hÓra wrote: >> I need to test this properly and fill in the mappings > > The official Cyrillic-Latin mapping could be found here: > http://en.wikipedia.org/wiki/Translit Great resource Andrey, thanks. I'll fold that mapping in. cheers Bill --~--~-~--~

Re: Suggestion for #1602, urlify.js blocks out non-English chars [was urlify.js blocks out...]

2006-07-12 Thread Bill de hÓra
James Bennett wrote: > On 7/11/06, Bill de hÓra <[EMAIL PROTECTED]> wrote: >> I need to test this properly and fill in the mappings, but the gist of >> the approach should be clear. When that's done, unless someone has an >> objection, I'll file a patch against > > The structure and logic look go

Re: Suggestion for #1602, urlify.js blocks out non-English chars [was urlify.js blocks out...]

2006-07-12 Thread Bill de hÓra
Malcolm Tredinnick wrote: >> return s.substring(0, num_chars);// trim to first num_chars chars >> return s.substring(0, num_chars);// trim to first num_chars chars >> } >> ]]] > > Probably only one of the last two lines is necessary. :-) DRY! > I am the about the worst guy in the worl

Re: Translation problem when not logged in

2006-07-12 Thread Nebojsa Djordjevic
Gribbie wrote: > Hi Nebojsa > > Thanks for your reply - we are using django internationalisation. It > all works fine when logged in it's just the introduction pages before > the user logs in where we have the problem. Well, if django i18n engine can't find out proffered locale from the browse

Re: Translation problem when not logged in

2006-07-12 Thread Gribbie
Hi Nebojsa Thanks for your reply - we are using django internationalisation. It all works fine when logged in it's just the introduction pages before the user logs in where we have the problem. Many thanks Gribbie --~--~-~--~~~---~--~~ You received this message

Re: Test framework for end-user applications

2006-07-12 Thread Malcolm Tredinnick
On Wed, 2006-07-12 at 15:38 +0800, Russell Keith-Magee wrote: > > Hi all, > > I've got a project at work that requires a formal test harness, so I > thought I would kill two birds with one stone and spend some time > adding a formal test framework for all Django applications. Hmmm .. deja vu.

Re: Translation problem when not logged in

2006-07-12 Thread Nebojsa Djordjevic
Gribbie wrote: > Hi > > I have an application which when the user is logged in translates > using: > request.session['django_language']='en-uk' or what ever language > code they select. > > This works fine when the user is logged in but I'd like to offer the > user the option to translate th

Re: Test framework for end-user applications

2006-07-12 Thread Michael Radziej
Russell Keith-Magee wrote: > I've got a project at work that requires a formal test harness, so I thought > I would kill two birds with one stone and spend some time adding a formal > test framework for all Django applications. Russell, that sounds great! It looks like everyone's reinventing the

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Michael Radziej
James Bennett wrote: > On 7/12/06, Michael Radziej <[EMAIL PROTECTED]> wrote: >> If you allow Null, this is in my opinion a strong indication that >> deleting the other end should not cascade but set Null. > > Whatever the default ends up being, whether it stays cascading or > moves to restrictin

About iServicePro

2006-07-12 Thread zw_sea
iServicePro is an innovative approach to offering affordable tools for Java and J2EE developers. in particular, we are a professional team for applying oneself to develop and integrate eclipse plug-in for user applications. Our mission now is to deliver business value and to maximize developers'

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Iain Duncan
> But, yes, it is often very useful. > > As far as I can see, the cascade happens in the Model.delete() > function, and not really in the admin. Therefore all deletes are > cascading unless you carefully set the foreign keys to Null before > you delete. You cannot change this behaviour wit

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread James Bennett
On 7/12/06, Michael Radziej <[EMAIL PROTECTED]> wrote: > If you allow Null, this is in my opinion a strong indication that > deleting the other end should not cascade but set Null. Whatever the default ends up being, whether it stays cascading or moves to restricting, assuming that allowing NULL

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Michael Radziej
Hi, the cascading delete came to surprise for me, too. I'm quite familiar with a range of relational databases, and none of them does cascading by default. They usually forbid it by default. That's why I did not expect it at all, and of course it happened during a demonstration, nearly wi

Test framework for end-user applications

2006-07-12 Thread Russell Keith-Magee
Hi all, I've got a project at work that requires a formal test harness, so I thought I would kill two birds with one stone and spend some time adding a formal test framework for all Django applications. This came up a few weeks ago [1], and although I didn't comment at the time, it struck me as a

Re: How to change foreign key deletion behaviour?

2006-07-12 Thread Iain Duncan
> Not that I'm aware of. Personally, I think we've got bigger fish to > fry, especially since the cascading delete performed by the admin > *should* be a familiar behavior for those who've worked with databases > before. I agree, it makes sense from a database user/designer perspective. Problem i