Re: how to use get_profile?i have a question,thx!

2007-09-01 Thread [EMAIL PROTECTED]

thanks,James!

On 9月2日, 上午10时48分, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 9/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > then changed to : {{ post.author.get_profile().image }}, still got a
> > error as following:
>
> You **never** use parentheses in a template. The template language is
> not Python, and does not use the same syntax as Python.
>
> {{ post.author.get_profile.image }}
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


--~--~-~--~~~---~--~~
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: how to use get_profile?i have a question,thx!

2007-09-01 Thread James Bennett

On 9/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> then changed to : {{ post.author.get_profile().image }}, still got a
> error as following:

You **never** use parentheses in a template. The template language is
not Python, and does not use the same syntax as Python.

{{ post.author.get_profile.image }}


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



how to use get_profile?i have a question,thx!

2007-09-01 Thread [EMAIL PROTECTED]

i used post.author.get_profile().image in the shell interface,and got
the right value。

but i used it in the template as  {% post.author.get_profile().image
%} , got a error as following:
Exception Type: TemplateSyntaxError
Exception Value: Invalid block tag: 'post.author.get_profile().image'
Exception Location: c:\python25\lib\site-packages\django\template
\__init__.py in invalid_block_tag, line 337

then changed to : {{ post.author.get_profile().image }}, still got a
error as following:
Exception Type: TemplateSyntaxError
Exception Value: Could not parse the remainder: '().image' from
'post.author.get_profile().image'
Exception Location: c:\python25\lib\site-packages\django\template
\__init__.py in __init__, line 577

can someone help me, thx!


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django-countries

2007-09-01 Thread Chris Moffitt
By any chance, is the author of django-countries (
http://code.google.com/p/django-countries/ ) on the list?  I stumbled upon
this app and wanted to touch base with the developer about a couple of
things.  If you're the developer (or know who is), would you mind sending me
a note off-list with your email?

Thanks,
Chris

--~--~-~--~~~---~--~~
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: request.path in a context processor

2007-09-01 Thread Jeremy Dunck

On 9/1/07, Evan H. Carmi <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Here I have a context processor --> http://dpaste.com/18402/

Context processors must return a dictionary.

Maybe you want this:

return {'base_path': list}
?

Also, it's bad form to use variables named the same as builtins (both
str and list are builtins).
Finally, this doesn't do what you think it does:
list[:1]

If you're new to Python, have a look at this:
http://docs.python.org/tut/tut.html

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



request.path in a context processor

2007-09-01 Thread Evan H. Carmi

Hi,
Here I have a context processor --> http://dpaste.com/18402/

I have {{ base_path }} in one of my templates but it isn't returning
anything. I am not sure if I can use request.path the way I am using it.
 Any ideas?

Thanks,
Evan

--~--~-~--~~~---~--~~
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: newforms and DateField

2007-09-01 Thread Peter Melvyn

On 8/31/07, picky <[EMAIL PROTECTED]> wrote:

> I try to create a form with forms.form_for_model but I just get a text
> widget for my DateField object.

I did not try it yet, but in principle, you should set class attribute
of corresponding widget to vDateField and include related JavaScripts
from
contrib.admin.media.js.admin folder.

To set attribute, you can do it this way:

MyForm = forms.form_for_model(...)
MyForm.base_field['my_field'].widget.attrs.update({'class':'vDateField'})

Peter

--~--~-~--~~~---~--~~
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: HttpMethodsMiddleware and mod_python (REST)

2007-09-01 Thread David Larlet

2007/8/31, Benjamin Slavin <[EMAIL PROTECTED]>:
>
> On 8/31/07, David Larlet <[EMAIL PROTECTED]> wrote:
> > > request.method = request.REQUEST[_MIDDLEWARE_KEY].upper()
> > > AttributeError: can't set attribute
> > >
>
> Hello David,

Hi Ben,

>
> I don't have a mod_python install I can easily test on, but could you
> try this for me:

Sure, thanks for your help!

>
> request._req.method = request.REQUEST[_MIDDLEWARE_KEY].upper()
>
> I don't know if the _req.method attribute is read-only as well... so
> it might not work.

Unfortunately you're right:

AttributeError: attribute 'method' of 'mp_request' objects is not writable

>
> If that doesn't work, you can use:
> request.META['REQUEST_METHOD'] = request.REQUEST[_MIDDLEWARE_KEY].upper()
>

This one looks to be good, in fact I can't test it completely because
I use the restapi GSoC and there is another method attribution in it
but the initial error didn't happened anymore.

>
> Let me know which one works and I can try to come up with a
> 'works-everywhere' solution and update the snippet.
>

Ok, thank you for your suggestions.

David

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



stupid problem with subfolder

2007-09-01 Thread Julian

hi there,

i am relativly new to django, everything's quite fine until now, so
here's my problem:

i've developed a django-application with the development server. now i
want to deploy it in a subdirectory of my domain, lets call it
www.domain.com/appl/ fastcgi is running, apache's right configured.

on the root-folder www.domain.com/appl/ i get my start page, but when
i switch to www.domain.com/appl/admin/ i can see the login-form, but
the css-is vanished (the html reads "http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 500 error email to admins - user information is missing...

2007-09-01 Thread James Bennett

On 8/31/07, Udi <[EMAIL PROTECTED]> wrote:
> I see the request object has
> 'REMOTE_USER':   self._req.user,
> in meta, but I'm getting None there despite the fact that only
> authenticated users are using my site.  Am I looking in the wrong
> place?  Is there any way to get this info into the email?

REMOTE_USER is the HTTP-level information and lives in the
request.META dictionary. You'd want to be looking in 'request.user' to
find the Django-level information about the user.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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: problem with importing "Template" module

2007-09-01 Thread [EMAIL PROTECTED]

so... i \ wefind two way for solving this problem... thank you for
supporting me


--~--~-~--~~~---~--~~
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: problem with importing "Template" module

2007-09-01 Thread [EMAIL PROTECTED]

ok, i find it... there is an other way. befor importing Template in
Python interactive
interpreter you must set setting in this way:

>>> from django.conf import settings
>>> settings.configure()
>>> from django.template import Template
>>> ..


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



G I F T S - For All Occasions

2007-09-01 Thread Salah U Shamsi
* *
*Sending Gifts to your loved ones is now as easy as any thing
else.
*
**

*Click to read: *

*http://www.12three.info/gifts/index.htm*

-

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



deleting a foreign key object deletes all related items

2007-09-01 Thread kan

Suppose I have the following model
class Person(models.Model):
firstname   = models.CharField(max_length=NAME_MAX_LENGTH)
lastname= models.CharField(max_length=NAME_MAX_LENGTH)
advisor = models.ForeignKey('Person',blank=True,null=True)

def __str__(self):
return "%s, %s"%(self.lastname,self.firstname)

class Admin:
pass

with the following code

advisor = Person(firstname="daniel",lastname="smith")
advisor.save();

p2 = Person(firstname="sur",lastname="kan", advisor=advisor)
p3 = Person(firstname="nim",lastname="roo")
p4 = Person(firstname="john",lastname="hur", advisor=advisor)

p2.save()
p3.save()
p4.save()

advisor.delete() I expect should just delete the advisor object and
change p2.advisor and p4.advisor to None but advisor.delete() deletes
p2 and p4. Is there no way to have an optional relationship to a
foreignobject. Ofcourse I can find all related objects for advisor,
disconnect them from advisor and then delete the advisor. But is there
a simple standard way to do this ?

By the way I am new to django and me missing something completely
basic is possible.

regards,
suresh.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django-Python developers in Toronto wanted

2007-09-01 Thread rickles

Hi all,

I'm launching a major project in Toronto, Canada and would need 1 or 2
programmers to join in for 5 to 6 months.  If you are available,
please ping me at [EMAIL PROTECTED] and let me know that you will
be available.  I will then send you more details later.  Thanks!

Rick


--~--~-~--~~~---~--~~
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: problem with importing "Template" module

2007-09-01 Thread Alex Koshelev

In shell:

export PYTHON_PATH=/path/to/dir/where/settings.py/script/lies/:
$PYTHON_PATH
export DJANGO_SETTINGS_MODULE=settings


--~--~-~--~~~---~--~~
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: problem with importing "Template" module

2007-09-01 Thread [EMAIL PROTECTED]

tanx... i learn django from "http://www.djangobook.com/;, and i do
everything in is on "Chapter 4" but i get this error.


--~--~-~--~~~---~--~~
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: DRY violation: site name in project files

2007-09-01 Thread Davidov

Thanks for your explanation. Now I understand.

On 1 сент, 02:52, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 8/31/07, Davidov <[EMAIL PROTECTED]> wrote:
>
> > This means that project should have some knowledge about parent site.
> > This makes it difficult to move projects from site to site. Also this
> > violates DRY (you have to write site name again).
>
> For sake of convenience, the tutorial walks you through developing the
> application inside a subdirectory of the project. Doing so is not
> necessary, and in fact a reusable application must be developed
> "standalone" to avoid unnecessary coupling to a single project.
>
> > Is there a way to solve this elegant way (without modifying python
> > modules load path)?
>
> Develop the application standalone -- separate from any project --
> with the application's module in a directory that's directly on the
> Python path. Remember that the "project" concept is really a sort of
> wrapper for defining the applications and settings in use, so it's
> only technically needed when you want to work with the running
> application, and there's no need to have all the applications located
> inside the project's directory; again, the tutorial only does that
> because it's easier to keep everything in one location when you're
> just starting out.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


--~--~-~--~~~---~--~~
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-based forum software?

2007-09-01 Thread kahless

hi,
i'm the author of SCT (Sphene Community Tools: http://sct.sphene.net )
- it tries to be as easy to integrate and customizable as possible
(and still to keep some kind of simplicity) - so it would be nice to
hear the requirements from people.

by default it basically looks like this: http://sct.sphene.net/board/show/0/
(It uses the default django auth system, but an extended user profiles
model .. which is imo very nice (providing avatars & co) but not
really necessary)

cu,
  herbert

On Aug 30, 6:47 pm, Aaron Maxwell <[EMAIL PROTECTED]> wrote:
> Does anyone know of a django forum app?  I.e., to build a site providing a
> user forum.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---