Re: dict variable in template

2008-07-04 Thread Dave Smith
On Fri, Jul 4, 2008 at 7:39 PM, Jason <[EMAIL PROTECTED]> wrote:

>
> Thanks for the replies, everyone.  I double-checked my message to make
> sure it would be clear.  Wonderful!  And yet, I posted to the wrong
> group :(  If I have a follow-up I'll post in the users forum or the
> Google App Engine forum.


There's also an #appengine channel on irc.freenode.net (and, if your
question
is specific to Django, there's also a #django channel). Oft times these will
get you immediate answers.

Dave

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: dict variable in template

2008-07-04 Thread Jason

Thanks for the replies, everyone.  I double-checked my message to make
sure it would be clear.  Wonderful!  And yet, I posted to the wrong
group :(  If I have a follow-up I'll post in the users forum or the
Google App Engine forum.

On Jul 5, 2:25 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Sat, Jul 5, 2008 at 10:20 AM, Jason <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I'm a newbie and using Django in the context of Google App Engine.
>
> Hi Jason,
>
> 1) Django-developers is a mailing list for discussing the development
> of django itself, not for general user queries. Questions like this
> one should be asked on django-users.
>
> 2) Given that your question is about Google App Engine, you may have
> more luck asking in discussion group specific to App Engine. There are
> some subtle differences between Google App Engine and Django, so an
> answer which is completely correct for Django may be incorrect for App
> Engine.
>
> Yours,
> Russ Magee %-)
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: dict variable in template

2008-07-04 Thread Malcolm Tredinnick

And I only just noticed you posted to django-dev instead of
django-users. This isn't the right list for that. Apologies for
answering your question.

Malcolm


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: dict variable in template

2008-07-04 Thread Malcolm Tredinnick


On Fri, 2008-07-04 at 19:20 -0700, Jason wrote:
> Hello,
> 
> I'm a newbie and using Django in the context of Google App Engine.  In
> my Python code I have:
> url = users.create_login_url(self.request.uri)
> data['attribute1'] = 10
> data['attribute2'] = 20
> formdata = {
>   'data': data,
>   'url': url,
>   'attribute_list': [attribute1, attribute2]
> }
> path = os.path.join(os.path.dirname(__file__), 'index.html')
> self.response.out.write(template.render(path, formdata))
> 
> In index.html I have:
> {% for attribute in attribute_list %}
>   {{ attribute }}  value="{{ data.attribute }}">
> {% endfor %}
> 
> The resulting HTML is:
> atttribute1 
> atttribute2 
> 
> What I am wanting is for the 10 and the 20 to appear in the value
> attribute of those text boxes.

Django doesn't do indirect lookups like that. The thing after the dot in
{{{ data.attribute }} has to be the name of an attribute, not the name
of a variable that is used to look up the name of an attribute. You
could write a filter to do the indirect lookup for you (I believe there
might even be one in djangosnippets.org), but almost always you'll find
the cleaner solution is not to construct your data that way.

In this case, you can just as easily write:

{% for name,value in data.items %}
   ...
{% endfor %}

Alternatively, you could make data be a list of tuples (which would be a
better data structure if you want the results in a well-defined order,
since dictionary orderings will change as you add more things).

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: dict variable in template

2008-07-04 Thread Russell Keith-Magee

On Sat, Jul 5, 2008 at 10:20 AM, Jason <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I'm a newbie and using Django in the context of Google App Engine.

Hi Jason,

1) Django-developers is a mailing list for discussing the development
of django itself, not for general user queries. Questions like this
one should be asked on django-users.

2) Given that your question is about Google App Engine, you may have
more luck asking in discussion group specific to App Engine. There are
some subtle differences between Google App Engine and Django, so an
answer which is completely correct for Django may be incorrect for App
Engine.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: QueryDict.iteritems behaves differently than QueryDict.items

2008-07-04 Thread Tai Lee

1.0 should ideally ship with Zarro Boogs, so any bugs (not DDN)
especially trivial ones with a patch including relavent tests / docs
should be marked for 1.0 milestone, I think ;)


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



dict variable in template

2008-07-04 Thread Jason

Hello,

I'm a newbie and using Django in the context of Google App Engine.  In
my Python code I have:
url = users.create_login_url(self.request.uri)
data['attribute1'] = 10
data['attribute2'] = 20
formdata = {
  'data': data,
  'url': url,
  'attribute_list': [attribute1, attribute2]
}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, formdata))

In index.html I have:
{% for attribute in attribute_list %}
  {{ attribute }} 
{% endfor %}

The resulting HTML is:
atttribute1 
atttribute2 

What I am wanting is for the 10 and the 20 to appear in the value
attribute of those text boxes.
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: #7560: Delegate (most) type conversion to backends

2008-07-04 Thread Leo Soto M.

On Fri, Jul 4, 2008 at 12:27 AM, Leo Soto M. <[EMAIL PROTECTED]> wrote:
> So the new [...]

A quick update: After more testing with real django applications I
discovered that I was breaking get_next_by_FIELD. This fourth patch[1]
fixes this issue and includes tests for this use case (which wasn't
exercised on the rest of the suite)

[1] 
http://code.djangoproject.com/attachment/ticket/7560/get_db_prep_refactor-4.patch
-- 
Leo Soto M.
http://blog.leosoto.com

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: Non editable fields in admin

2008-07-04 Thread TiNo
How about creating a widget that just displays the data? Then override the
form and use this widget instead of the default widget.

On Fri, Jul 4, 2008 at 6:14 PM, Alex Rades <[EMAIL PROTECTED]> wrote:

> Hi,
> I'm writing an application which makes a pretty heavy use of the
> newforms-admin administrative site.
>
> One recurring need is displaying of informative fields (fields which should
> not be editable from the admin site, but only viewed).
> For example, imagine to have a DateField field into a Story class, which is
> automatically updated every time a user writes a new story. It is
> desiderable to see this value in the admin site, but has no sense (actually
> is wrong) to allow modifications to it.
>
> Note that this is different from the purpose of the 'editable' attribute,
> what I'm talking about is a presentation-only feature, and for this reason
> we could put it into ModelAdmin classes:
>
> class StoryOptions(admin.ModelAdmin):
> readonly_fields = ('lastupdate',)
>
> People have been asking this a lot of times, at least here:
>
> http://code.djangoproject.com/ticket/342
> http://code.djangoproject.com/ticket/611
> http://code.djangoproject.com/ticket/1714
> http://code.djangoproject.com/ticket/3990
>
> Is there a working solution to display this kind of readonly data in the
> admin site?
>
> Thank you
>
>
> >
>

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Enjoy seeing pictures

2008-07-04 Thread Anjali

Enjoy seeing pictures
   with new
  videos
   visit 
  http://hatsforgirls.blogspot.com
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Non editable fields in admin

2008-07-04 Thread Alex Rades
Hi,
I'm writing an application which makes a pretty heavy use of the
newforms-admin administrative site.

One recurring need is displaying of informative fields (fields which should
not be editable from the admin site, but only viewed).
For example, imagine to have a DateField field into a Story class, which is
automatically updated every time a user writes a new story. It is
desiderable to see this value in the admin site, but has no sense (actually
is wrong) to allow modifications to it.

Note that this is different from the purpose of the 'editable' attribute,
what I'm talking about is a presentation-only feature, and for this reason
we could put it into ModelAdmin classes:

class StoryOptions(admin.ModelAdmin):
readonly_fields = ('lastupdate',)

People have been asking this a lot of times, at least here:

http://code.djangoproject.com/ticket/342
http://code.djangoproject.com/ticket/611
http://code.djangoproject.com/ticket/1714
http://code.djangoproject.com/ticket/3990

Is there a working solution to display this kind of readonly data in the
admin site?

Thank you

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Videos in womens hostel

2008-07-04 Thread nari

**
http:\\lakshmiraiprofile.blogspot.com
**
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Moscow local sprint

2008-07-04 Thread Ivan Sagalaev

Hello!

We at Yandex have decided to host a local sprint in Moscow, Russia 
during the EuroPython Django sprint [1]. I invite Django developers in 
Moscow to come and participate! (Though chances that you've already 
heard about it :-) )

[1]: http://company.yandex.ru/blog/message.xml?msg=102921

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



to see the kuselan trilar

2008-07-04 Thread jasmine

to see the kuselan trilar
super star rajinikanth in kuselan
more details
just click it
**
http://lakshmipriyasan.blogspot.com/
***
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: QueryDict.iteritems behaves differently than QueryDict.items

2008-07-04 Thread Jure Vrscaj

> Also, what compatibility does it break? I can't see how this is a  common 
> use-case.

It might break existing code, code that depends on iteritems()
yielding lists. Maybe not a common use case, but it got me scratching
my head more than once.

On Jul 4, 7:40 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Certainly file a ticket so that the information doesn't get lost, Jure.
> The inconsistency looks a little wrong, although I'd have to think a bit
> about which return type is the "right" one, since there are arguments
> both ways.

The ticket, patch and test is here: http://code.djangoproject.com/ticket/7331

Milestone is currently set to post-1.0, but I'd argue it's better to
fix it for 1.0, if at all.

Thanks for looking into it.

regards,
jure
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---