Re: accessing user info in templates

2006-02-20 Thread Max Battcher
char wrote: > Thanks! I'm still curious though. Why wouldn't user.user work? It is a "magic" issue. Basically the user field prior to magic-removal is simply the metadata container and the get_FOO stuff is auto-generated function to actually get the real data. Magic-Removal changes things

Re: accessing user info in templates

2006-02-20 Thread char
Thanks! I'm still curious though. Why wouldn't user.user work? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe

Re: accessing user info in templates

2006-02-20 Thread Maniac
char wrote: >{% for user in object_list %} > {{ user.user.first_name >}} >{% endfor %} > > Use "user.get_user" instead of "user.user". This is the same method that you use in your __repr__ just without parentheses (they aren't needed in the template syntax).

accessing user info in templates

2006-02-20 Thread char
Hi. I have an "expanded" user definition that wraps auth.user, like so: ... class MetroUser(meta.Model): user = meta.ForeignKey(User, edit_inline=meta.STACKED, num_in_admin=1, max_num_in_admin=1) notes = meta.TextField() def __repr__(self): return

Re: urllib2.open failing in Django?

2006-02-20 Thread Malcolm Tredinnick
Jakub Labath wrote: > Hi, > > I believe as soon as you call socket.setdefaultimeout it also changes > certain behavior for ALL sockets in general (blocking non blocking > etc) plus obviously the timeout. > That is in my opinion pure evil(TM) because surely database drivers, > connection handlers,

Re: urllib2.open failing in Django?

2006-02-20 Thread Jakub Labath
Hi, I believe as soon as you call socket.setdefaultimeout it also changes certain behavior for ALL sockets in general (blocking non blocking etc) plus obviously the timeout. That is in my opinion pure evil(TM) because surely database drivers, connection handlers, logging tools and god knows what

Re: Comments broken in magic-removal?

2006-02-20 Thread Malcolm Tredinnick
Andrew Gwozdziewycz wrote: > Hello, > > I'm trying to use the contrib.comments in the magic-removal branch. > I'm running into some problems though... > > {% get_free_comment_list for excuses.topic topic.id as > comment_list %} > > Is the part that is failing. This was adapted from the

Comments broken in magic-removal?

2006-02-20 Thread Andrew Gwozdziewycz
Hello, I'm trying to use the contrib.comments in the magic-removal branch. I'm running into some problems though... {% get_free_comment_list for excuses.topic topic.id as comment_list %} Is the part that is failing. This was adapted from the djangoproject.com website, as it was

Re: adding page

2006-02-20 Thread kmh
Mary Adel wrote: > I have anither questions on the flatepage > Does the flat page need any configuration for the url.py file or no > cause i made a faltepage but it didn't appear in the browser so i really > don't know the steps to make it appear in the browser If you've added:

Re: adding page

2006-02-20 Thread Mary Adel
I have anither questions on the flatepage Does the flat page need any configuration for the url.py file or no cause i made a faltepage but it didn't appear in the browser so i really don't know the steps to make it appear in the browser Thanks, Mary On Mon, 2006-02-20 at 14:03 -0500, Tom

Re: only show something(form) if javascript-enabled

2006-02-20 Thread Lachlan Cannon
gabor wrote: > hi, > > what is the standard way to only show a form if the user has > javascript-enabled? You could have the form in the page, and have it set to display: none; which is undone with js. Of course if someone has css disabled they'll see it... -- Lach Personal:

Re: django problem at dreamhost

2006-02-20 Thread Lachlan Cannon
I've been having 500 errors at Dreamhost too. The week before last I finished my site, had it up and running and everything was fine. Then checked it on the next Monday, and having not changed anything I was getting this mess. Dreamhost say they haven't changed

Re: Web Services

2006-02-20 Thread [EMAIL PROTECTED]
I wonder what will come out out http://code.djangoproject.com/ticket/115 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: only show something(form) if javascript-enabled

2006-02-20 Thread Amit Upadhyay
On 2/21/06, gabor <[EMAIL PROTECTED]> wrote: what is the standard way to only show a form if the user has_javascript_-enabled?Use id="integrity_form" style="display:none" in the form, and then document.getElementById("integrity_form").style.display = "block", ofcourse this won't happen unless

Re: only show something(form) if javascript-enabled

2006-02-20 Thread Jason Huggins
gabor wrote: > so is there a way to only show some part of the webpage (or the whole > webpage) if javascript is enabled? Use javascript to build up the form and its visual elements on pageload. A user without Javascript enabled would see a blank page. :-) -Jason

Re: only show something(form) if javascript-enabled

2006-02-20 Thread Graham King
You could make the form invisible using css: #theFormId { display: none; } then use Javascript to change this to display = block. If they don't have Javascript the form won't appear. Or you could use Javascript to write the form out, as in: document.write('
'); but the CSS

only show something(form) if javascript-enabled

2006-02-20 Thread gabor
hi, what is the standard way to only show a form if the user has javascript-enabled? i have a form which's "integrity" relies on some javascript stuff, so i really don't want the user to submit it with javascript-disabled. so is there a way to only show some part of the webpage (or the whole

Re: using the devel-webserver for production?

2006-02-20 Thread gabor
Jacob Kaplan-Moss wrote: > On Feb 20, 2006, at 3:28 PM, gabor wrote: >> 1. except that it was not meant for that, are there any fundamental >> problems with the "runserver"-webserver? > > Using runserver in production is like driving your car on a spare > tire. It'll work, but when it blows

Re: using the devel-webserver for production?

2006-02-20 Thread Jacob Kaplan-Moss
On Feb 20, 2006, at 3:28 PM, gabor wrote: > 1. except that it was not meant for that, are there any fundamental > problems with the "runserver"-webserver? Using runserver in production is like driving your car on a spare tire. It'll work, but when it blows up in your face someone's going to

using the devel-webserver for production?

2006-02-20 Thread gabor
hi, i know, i know. the webserver that's started with the "manage.py runserver", is not meant for production usage. but this is my situation: 1. the system will be used by very few people. i assume at most 10 accounts, and at most 3-4 users working with it at the same time. 2. the program

Re: adding page

2006-02-20 Thread Mary Adel
Thanks i ll have a look on it now and i ll see how it will help me On Mon, 2006-02-20 at 18:21 +0100, Sime Ramov wrote: > On Feb 20, 2006, at 8:11 AM, Mary Adel wrote: > > > > http://www.djangoproject.com/documentation/flatpages/ > > >

Re: two object returned for exact pk lookup

2006-02-20 Thread Amit Upadhyay
On 2/15/06, Maniac <[EMAIL PROTECTED]> wrote: If it's MySQL then it looks very much like threading issues (withPostgres it fails somewhat differently). There is a patch fixing it inhttp://code.djangoproject.com/ticket/463 Hi Maniac,Thanks for the pointer, I applied the patch and my application has

Re: urllib2.open failing in Django?

2006-02-20 Thread Ned Batchelder
The value was 20 (the unit is seconds). With the function call removed, the calls completed successfully in much less time than 20 seconds, on the order of 1 second, so I don't thing the timeout was actually kicking in. --Ned. --~--~-~--~~~---~--~~ You received

Re: adding page

2006-02-20 Thread Tom Tobin
On 2/20/06, Mary Adel <[EMAIL PROTECTED]> wrote: > > I have a question and i have deadline tomm :( and really i need help > I build a model called pages which has page name and page link and page > content and then i build the database and i make the admin interface to > fill all the data but the

Django Development Position Available

2006-02-20 Thread Allan
AirSage Inc. is seeking energetic Web Application Developers to expand and enhance the company's unique product offering. AirSage creates software that allows road traffic speeds and other information to be determined from cellular network signalling data. The qualified candidate will possess

Re: urllib2.open failing in Django?

2006-02-20 Thread Tom Tobin
On 2/20/06, Ned Batchelder <[EMAIL PROTECTED]> wrote: > > I found the problem on my end. It was a call to > socket.setdefaulttimeout(). The bug I had found but can't locate now > was correct: if you call that socket function, urllib2 (and httplib) > have very difficult times completing reads.

Re: Creating a menu structure

2006-02-20 Thread akaihola
I've hit the same challenge. I'd like to maintain a list of nested categories with the admin interface. Any news on this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: adding page

2006-02-20 Thread Sime Ramov
On Feb 20, 2006, at 8:11 AM, Mary Adel wrote: > http://www.djangoproject.com/documentation/flatpages/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

adding page

2006-02-20 Thread Mary Adel
I have a question and i have deadline tomm :( and really i need help I build a model called pages which has page name and page link and page content and then i build the database and i make the admin interface to fill all the data but the problem is that: I need to add page dynamically without

Re: Template Does Not exist Error

2006-02-20 Thread [EMAIL PROTECTED]
Thanks Mate! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED]

Re: Template Does Not exist Error

2006-02-20 Thread Amit Upadhyay
On 2/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi all,I'm using { % extends "parent" % } and I'm getting a "...template doesnot exist error" for the parent template.I have the two templates in the same directory and they are in a subfolder of my template directory.Use {% extends

do_html2python and errors.

2006-02-20 Thread Felix Ingram
All, I'm a bit stumped. Being a good little developer I'm following the guidelines for the new admin changes (http://code.djangoproject.com/wiki/NewAdminChanges) and calling 'do_html2python' regardless of whether there are any errors from the user. This clears up one problem I was having where

Re: urllib2.open failing in Django?

2006-02-20 Thread Ned Batchelder
I found the problem on my end. It was a call to socket.setdefaulttimeout(). The bug I had found but can't locate now was correct: if you call that socket function, urllib2 (and httplib) have very difficult times completing reads. I took out my call to setdefaulttimeout, and now it works great.

Template Does Not exist Error

2006-02-20 Thread [EMAIL PROTECTED]
Hi all, I'm using { % extends "parent" % } and I'm getting a "...template does not exist error" for the parent template. I have the two templates in the same directory and they are in a subfolder of my template directory. Has enyone had or solved this problem? I saw that someone else on this

Re: urllib2.open failing in Django?

2006-02-20 Thread Amit Upadhyay
On 2/20/06, Ned Batchelder <[EMAIL PROTECTED]> wrote: I have some code in a Django view that makes a request on anotherserver.  It uses urllib2 to make an SSL connection to the server andrequest a page.  Here's the code:I dont know about https, but I am doing a lot of fetching page over http, and

urllib2.open failing in Django?

2006-02-20 Thread Ned Batchelder
I have some code in a Django view that makes a request on another server. It uses urllib2 to make an SSL connection to the server and request a page. Here's the code: authb64 = ('%s:%s' % (username, password)).encode('base64').strip() req = urllib2.Request('https://'+url)

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread Amit Upadhyay
On 2/20/06, coulix <[EMAIL PROTECTED]> wrote: Seems like i was just unlucky in the number 5 - 6 - 8if i use a field which appears in my model with,null = Trueit seems like the validator is not eve called, is it a feature ?That may be the case, I have not tried it with null=True as yet so cant say

Re: Can't change '[algo]$[salt]$[hexdigest]' passwords!!!

2006-02-20 Thread limodou
On 2/20/06, Ben Vinger <[EMAIL PROTECTED]> wrote: > > Hello > > When I create users in the admin site, I have the > following problem: > > Newly created user cannot log using the password I've > just assigned them. > > What does "Use '[algo]$[salt]$[hexdigest]'" mean? algo is arithmetic, may be

Can't change '[algo]$[salt]$[hexdigest]' passwords!!!

2006-02-20 Thread Ben Vinger
Hello When I create users in the admin site, I have the following problem: Newly created user cannot log using the password I've just assigned them. What does "Use '[algo]$[salt]$[hexdigest]'" mean? Running Django-0.91, postgresql-8.1.2, apache_2.0.55, Python 2.4.2 on Windows 2000 Thanks

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread coulix
Seems like i was just unlucky in the number 5 - 6 - 8 if i use a field which appears in my model with ,null = True it seems like the validator is not eve called, is it a feature ? otherwise when its called i get an error : isFoo() takes exactly 3 arguments (2 given) Exception Location:

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread coulix
Oh true, didnt get the 500 error howerver no way to raise the error isValideImageWeight. all the test get added, when i check in the admin view the field "image" is empty. Is there a way to see what value does all fields have before being inserted to the db, looks like image is empty... my

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread Amit Upadhyay
On 2/20/06, coulix <[EMAIL PROTECTED]> wrote: Hum i cant spot the type expect the 500 as comments ?On 2/20/06, coulix < [EMAIL PROTECTED]> wrote: #Validatordef isValideImageWeight(self, field_data, all_data):print field_dataif len(field_data["content"] > 10 ) : # 500,000 bytes

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread coulix
Hum i cant spot the type expect the 500 as comments ? i took off the line "from manipulators import RecetteManipulator" line since i dont need it anymore, it still doesnt raise the expected erro when the file is more than 100kb. hum maybe its somwthing to do with the form template print

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread Amit Upadhyay
On 2/20/06, coulix <[EMAIL PROTECTED]> wrote: #Validatordef isValideImageWeight(self, field_data, all_data):print field_dataif len(field_data["content"] > 10 ) : # 500,000 bytes (100kB)raise validators.ValidationError, "Le fichier ne dois pas depasser100kb"Typo?

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread coulix
Thank you !! i was overdoing it ! 2 lines of code. however the validator upon image_file doest seem to work. print recettes.AddManipulator().fields (thks for the trick) give me : [FormField "nom", FormField "categorie", FormField "auteur", FormField "ingredients", FormField "etapes", FormField

Custom Form Fields, Validators and Manipulators

2006-02-20 Thread Felix Ingram
All, I'm trying to implement a custom form field similar to the Tagging example. Here's a simplified example of the model I'm using: class Port(meta.model): number = meta.IntegerField() protocol = meta.CharField(maxlength=4) class Application(meta.model): name =

Re: Manipulator and views problem, where to save object ?

2006-02-20 Thread Amit Upadhyay
On 2/20/06, coulix <[EMAIL PROTECTED]> wrote: Hello,i have a simple goal, displaying a form, populate it, save it to thedatabase.At the execption of a new validator to check the weight of the imagesent.First point  i need to write my own manipulator which is pretty much a copy of the model, i only

Manipulator and views problem, where to save object ?

2006-02-20 Thread coulix
Hello, i have a simple goal, displaying a form, populate it, save it to the database. At the execption of a new validator to check the weight of the image sent. First point i need to write my own manipulator which is pretty much a copy of the model, i only want to add a validator to one field