Re: Problem with i18n

2005-12-03 Thread hugo

>it works only if I remove the r from the parameter at lines 78, 94 and
>103.

Ah, actually that's even correct - I somehow mixed popen and popen3
syntax :-)

Fix is in SVN now.

bye, Georg



Test cookie's age

2005-12-03 Thread Jiri Barton

I don't know if I'm getting it all right... The test cookie's age is
the same as the age of any other cookie.

My application is using views/auth/login.py, SESSION_SAVE_EVERY_REQUEST
= True, and SESSION_COOKIE_AGE = 600.

Let's have the following scenario. A user logs out of the application.
This will bring it to the login screen, with the test cookie posted.
Another user comes in fifteen minutes (the test cookie has expired),
and cannot log in because the computer says,

"Your Web browser doesn't appear to have cookies enabled."

Of course, logging in again right at the moment afterwards puts the
user right through.

I'm trying to say the use case for the test cookie might be different
from the ordinary cookies. What do you think? My question is, can I set
the test cookie's age close to infinity? Won't this pose a security
risk?

TIA,
Jiri



Re: Contrib markup app not to be installed?

2005-12-03 Thread Robert Wittams

Ian Holsman wrote:
> shouldn't a warning/informational message be generated in this case.
> something like
> 
> $ django-admin install markup
> INFO: no models found to install.. skipping markup
> 
> ?

Given that the command acts on a model module, *not* on an app, this
wouldn't work. It will instead say 'No module named markup', which is
accurate. You have probably been using a model files named the same as
your apps, so didn't notice this.

We did look at making it work on an app and it might change to that in
future.



Re: Contrib markup app not to be installed?

2005-12-03 Thread Ian Holsman

shouldn't a warning/informational message be generated in this case.
something like

$ django-admin install markup
INFO: no models found to install.. skipping markup

?

On 12/3/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
> On Dec 3, 2005, at 5:13 AM, James Bennett wrote:
> > While setting up a new project tonight, I was running through and
> > doing a 'django-admin.py install' for each of the apps from
> > django.contrib I'll be using, and when I got to the markup app, I got
> > the following error:
> >
> > Error: No module named markup. Are you sure your INSTALLED_APPS
> > setting is correct?
> >
> > I've got 'django.contrib.markup' in INSTALLED_APPS, and the markup app
> > certainly seems to be a Python module. Is it not meant to be installed
> > with 'django-admin.py' (since I recall Jacob saying that all you need
> > is to have it in INSTALLED_APPS and then do 'load markup' in your
> > template)?
>
> Yeah, it doesn't get installed -- the markup app has no models, just
> the custom template tag.
>
> Jacob
>


--
[EMAIL PROTECTED] -- blog: http://feh.holsman.net/ -- PH: ++61-3-9877-0909

If everything seems under control, you're not going fast enough. -
Mario Andretti


Re: Problem with i18n

2005-12-03 Thread olive

Georg,

it works only if I remove the r from the parameter at lines 78, 94 and
103.

Olivier.

PS: I have downloaded the win32 version of gettext from sourceforge.



Re: Problem with i18n

2005-12-03 Thread hugo

Hi,

>There is no such xgettext on my system, do I need to download/install
>3rd party tool ?

Yes, to make use of make-messages.py you have to install the gnu
gettext utilities. The script uses xgettext, msguniq and msgmerge. And
I absolutely don't know wether all this actually will run with Windows
at all - I don't have a Windows system to test on, I can only test with
Linux and OS X.

The problem with the "arg 2 must be 't' or 'b'" should be fixed now, I
commited a small change to the utility (adding 'b' to the 'r' in those
calls).

bye, Georg



Re: AddManipulator does not populate select

2005-12-03 Thread Robert Wittams

Robert Wittams wrote:
> Maniac wrote:
> 
>>Robert Wittams wrote:
>>
>>
>>>Why are you flattening the data again? You only do this once, when
>>>extracting the data out of the object instance (or the defaults). The
>>>data is already 'flat' when it comes out of a POST. do_html2python gets
>>>it back into a form suitable for both saving and populating form fields.
>>> 
>>>
>>
>>Uhm... So "flatten_data" is essentially "do_python2html"? If yes, may be
>>just rename it to prevent confusion?
>>
> 
> No. Read the source before suggesting changes to it.
> 

What I mean here is that do_html2python and flatten_data are not
inverses of one another, and so its a bad idea to name them as if they are.

tbh, do_python2html is a horrible name anyway.
At some point we are going to need to renovate the whole lot of

.do_python2html
.get_validation_errors
and the bit of  .save that makes objects,

in order to allow for validations based on objects rather than unprocess
ed POST data, and rational dealing with files.

Something like
object, data, errors = manipulator.process_request(request)



Not sure of how exactly this would end up though.

Robert



Re: AddManipulator does not populate select

2005-12-03 Thread Robert Wittams

Maniac wrote:
> 
> Robert Wittams wrote:
> 
>> Why are you flattening the data again? You only do this once, when
>> extracting the data out of the object instance (or the defaults). The
>> data is already 'flat' when it comes out of a POST. do_html2python gets
>> it back into a form suitable for both saving and populating form fields.
>>  
>>
> Uhm... So "flatten_data" is essentially "do_python2html"? If yes, may be
> just rename it to prevent confusion?
> 
No. Read the source before suggesting changes to it.



Problem with i18n

2005-12-03 Thread olive

Hello,

C:\soft\Python23\Lib\site-packages\sonikete>make-messages.py -l fr
processing language fr
Traceback (most recent call last):
  File "C:\soft\django_src\django\bin\make-messages.py", line 78, in ?
(stdin, stdout, stderr) = os.popen3(cmd, 'r')
ValueError: popen3() arg 2 must be 't' or 'b'

When I set the 2nd arg to t or b then:
C:\soft\Python23\Lib\site-packages\sonikete>make-messages.py -l fr
processing language fr
errors happened while running xgettext on settings.py
'xgettext' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

There is no such xgettext on my system, do I need to download/install
3rd party tool ?

Then I've created django.po by hand:
C:\soft\Python23\Lib\site-packages\sonikete>compile-messages.py
processing file django.po in
C:\soft\Python23\Lib\site-packages\sonikete\locale\fr\LC_MESSAGES
'msgfmt' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

I have added the directory path which contain msgfmt.py to PATH but the
result is the same.

What do I need to do ?

Olivier.

ValueError: popen3() arg 2 must be 't' or 'b



Re: AddManipulator does not populate select

2005-12-03 Thread Kenneth Gonsalves

On Saturday 03 Dec 2005 5:50 pm, Robert Wittams wrote:
> Kenneth Gonsalves wrote:
> > On Saturday 03 Dec 2005 4:48 pm, Robert Wittams wrote:
> >>Kenneth Gonsalves wrote:
> >>>hi,
> >>>when using AddManipulator and returning the form for
> >>> correcting errors, the select field does not get populated
> >>> with the choice selected. I could do this manually, but does
> >>> django have a way of doing it automatically?
> >>
> >>If using trunk, are you using flatten_data as directed in
> >>
> >>http://code.djangoproject.com/wiki/NewAdminChanges ?
> >
> > this only describes how to do it in ChangeManipulator - i used
> > flatten_data in the AddManipulator like this:
> >
> > if request.POST:
> > data = request.POST.copy()
> > errors = manipulator.get_validation_errors(data)
> > manipulator.do_html2python(data)
> > data = manipulator.flatten_data()
>
> Erm...throwing away the data we got from the POST...
>
> > if not errors:
> >
> > enquiry = manipulator.save(data)
> > return HttpResponseRedirect("/yyy/xxx/")
> >
> > but the select field still didnt get populated
>
> Why are you flattening the data again? You only do this once,
> when extracting the data out of the object instance (or the
> defaults). The data is already 'flat' when it comes out of a
> POST. do_html2python gets it back into a form suitable for both
> saving and populating form fields.
>
> What you are doing here is getting the default data out of the
> manipulator again as far as I can tell.

ok - it works now thanks

-- 
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!


Re: Contrib markup app not to be installed?

2005-12-03 Thread Jacob Kaplan-Moss


On Dec 3, 2005, at 5:13 AM, James Bennett wrote:

While setting up a new project tonight, I was running through and
doing a 'django-admin.py install' for each of the apps from
django.contrib I'll be using, and when I got to the markup app, I got
the following error:

Error: No module named markup. Are you sure your INSTALLED_APPS
setting is correct?

I've got 'django.contrib.markup' in INSTALLED_APPS, and the markup app
certainly seems to be a Python module. Is it not meant to be installed
with 'django-admin.py' (since I recall Jacob saying that all you need
is to have it in INSTALLED_APPS and then do 'load markup' in your
template)?


Yeah, it doesn't get installed -- the markup app has no models, just  
the custom template tag.


Jacob


Re: Problem with TinyMCE integration

2005-12-03 Thread olive

Thanks a lot



Re: AddManipulator does not populate select

2005-12-03 Thread Kenneth Gonsalves

On Saturday 03 Dec 2005 4:48 pm, Robert Wittams wrote:
> Kenneth Gonsalves wrote:
> > hi,
> > when using AddManipulator and returning the form for correcting
> > errors, the select field does not get populated with the choice
> > selected. I could do this manually, but does django have a way
> > of doing it automatically?
>
> If using trunk, are you using flatten_data as directed in
>
> http://code.djangoproject.com/wiki/NewAdminChanges ?

this only describes how to do it in ChangeManipulator - i used 
flatten_data in the AddManipulator like this:

if request.POST:
        data = request.POST.copy()
        errors = manipulator.get_validation_errors(data)
        manipulator.do_html2python(data)
        data = manipulator.flatten_data()
        if not errors:
            
            enquiry = manipulator.save(data)
            return HttpResponseRedirect("/yyy/xxx/")

but the select field still didnt get populated

-- 
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!


manytomany not working

2005-12-03 Thread Lee

Using revision 1526: I define two model classes, one with a manytomany
field to the other.
The expected convenience functions for looking up related objects are
only created for one of the classes.

Reverting to revision 1039 and making no other changes, everything
works. (I reverted to that
because it is the revision I'm using for another project.)



Re: Contrib markup app not to be installed?

2005-12-03 Thread James Bennett

On 12/3/05, Robert Wittams <[EMAIL PROTECTED]> wrote:
> The install is for installing a model-module, not an app. As the markup
> app has no model modules, and there is no model module named markup,
> this is not going to work.

OK, I'd figured as much from a little further poking around, but just
wanted to be sure that's how it's supposed to be. Thanks for the quick
reply.


--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


Contrib markup app not to be installed?

2005-12-03 Thread James Bennett

While setting up a new project tonight, I was running through and
doing a 'django-admin.py install' for each of the apps from
django.contrib I'll be using, and when I got to the markup app, I got
the following error:

Error: No module named markup. Are you sure your INSTALLED_APPS
setting is correct?

I've got 'django.contrib.markup' in INSTALLED_APPS, and the markup app
certainly seems to be a Python module. Is it not meant to be installed
with 'django-admin.py' (since I recall Jacob saying that all you need
is to have it in INSTALLED_APPS and then do 'load markup' in your
template)?


--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


Django logo

2005-12-03 Thread Maniac


I'm writing a blog post about Django and want to use a logo as a 
decoration. There are number of nice badges on 
http://www.djangoproject.com/community/badges/ but they all have Django 
logo with some text. Neither of them seem to make sense for just an 
illustration.


So I'd like to ask kindly of addition on that page of pure Django logo 
without any text (if you had time, of course). Thanks!