Re: How to make dictionary out of model instance

2007-07-16 Thread Ben van Staveren

If you have an instance, you could just do:

myUserModelInstance.__dict__ -- that'll get you the data you want,  
and a bunch of extra stuff you most likely don't want. I don't really  
recommend doing this either, since it's not "the right way" IMO, but  
it solves your problem.

On 16/07/2007, at 4:53 PM, Eratothene wrote:

>
> I need to make dictionary out of django.auth.model.User instance in
> such format:
>
> {'username':'val1', 'password':'val2', 'email':'',
> 'first_name':'val3', 'last_name':'val4' ...}
>
> In order to populate this data in to the custom form. I have read all
> documentation available in order to resolve this simple task, how to
> make it?
>
>
> >


--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django serving static PDF file

2007-07-17 Thread Ben van Staveren

You're better off not doing it with Django, just make a directory  
that won't be handled by Django and stick all your static content in  
there. After all, the webserver is usually better at serving static  
files than Django is :)


On 17/07/2007, at 2:26 PM, Arnold Chen wrote:

>
> Can any one please tell me how to serve a static PDF in django ? The
> file is located in the server, and do not need to be created on the
> fly (by using report lab). I have done it in PHP by using header, but
> i just don't know how to do it with django. Thanks
>
>
> >


--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django serving static PDF file

2007-07-17 Thread Ben van Staveren

Generally that's done by spitting out some custom headers;

Content-Type: text/pdf
Content-Disposition: attachment; filename=yourfilename.pdf

That way most browsers will give you the option to open or to save- 
as. To do that does require that they're sent dynamically, but as  
said before it'd be a shame to use Django for that because of the  
overhead you incur. Better off to just write some mod_python module  
that will handle that sort of things.

IMO, anyway :)

On 17/07/2007, at 3:29 PM, Arnold Chen wrote:

>
> Besides, i want to revise my first question as:
>
> How to serve static file by "pushing" a PDF to client? In php, there
> is a way to serve PDF by pushing the file to the client, and client to
> choose "Save As" or "Open" the file directly.
>
> Adobe reader is very slow if they run in browsers, and most of the
> time, they hang the browser, so is there a way to push ?
>
> regards,
> Arnold
>
> On Jul 17, 4:03 pm, Arnold Chen <[EMAIL PROTECTED]> wrote:
>> Thanks Ben,
>>
>> Besides, i've found thatwww.lawrence.comandwww.ljworld.com(which
>> are famous sites that use django) use ahttp://media.their-domain- 
>> name.com
>> to store the media files.
>> All static files, images, css are from thehttp://media.their- 
>> domain-name.com
>> server. Obviously the media subdomain is not a django environment, i
>> wonder if we can setup an environment like that, and can i still
>> upload image to the media subdomain from the django admin console?
>>
>> Arnold
>>
>> On Jul 17, 3:29 pm, Ben van Staveren <[EMAIL PROTECTED]>  
>> wrote:
>>
>>> You're better off not doing it with Django, just make a directory
>>> that won't be handled by Django and stick all your static content in
>>> there. After all, the webserver is usually better at serving static
>>> files than Django is :)
>>
>>> On 17/07/2007, at 2:26 PM, Arnold Chen wrote:
>>
>>>> Can any one please tell me how to serve a static PDF in django ?  
>>>> The
>>>> file is located in the server, and do not need to be created on the
>>>> fly (by using report lab). I have done it in PHP by using  
>>>> header, but
>>>> i just don't know how to do it with django. Thanks
>
>
> >


--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help needed

2007-08-24 Thread Ben van Staveren


On 24/08/2007, at 3:03 PM, james_027 wrote:

>
> Hi ani,
>
> On Aug 24, 3:42 pm, Ani Nair <[EMAIL PROTECTED]> wrote:
>> Hi I'm new to this.. I want to know whether django restricts the use
>> of '?' in urls. I am unable to use it in the url config
>
> My guess is that "?" is a special char in regex which django uses in
> url config... try to escape it. Hope it helps

How about '?' being the separator between an URL and it's query string?

/B

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Error During Django Install on Mac

2007-10-23 Thread Ben van Staveren

No offense but uh, RTFM?

(Protip: man sudo, man su)


On 24/10/2007, at 1:45 PM, jnap wrote:

>
> anyone?
>
> On Oct 24, 2:36 am, jnap <[EMAIL PROTECTED]> wrote:
>> sorry for another dumb question...but how do i do it as root?
>>
>> On Oct 24, 2:32 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>>
>>> On 24-Oct-07, at 11:55 AM, jnap wrote:
>>
 jnap:~ jnap$ ln -s /usr/local/lib/python2.3/site-packages/ 
 django_src/
 django/bin/django-admin.py /usr/local/bin/django-admin.py
 ln: /usr/local/bin/django-admin.py: Permission denied
>>
>>> you have to do it as root
>>
>>> --
>>
>>> regards
>>> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/
>
>
> >


--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: AsianAirfares.com Beats Closest Competitor 6 Out of 10 in International Travel Comparison

2007-10-26 Thread Ben van Staveren

>>
> The django-users list spam abuse has become nearly intolerable. As a
> subscriber to numerous other technically oriented mailing lists, I  
> very
> rarely have to deal with any spam whatsoever. Google Groups may be  
> free,
> but it is apparently not without cost.
>
> Cl

Next time, try to, you know, edit before you hit send. Quoting the  
entire spam just to add an observation that everyone already realised  
is quite useless. 

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---