Dictionaries are 'dict' data types, that means
key=value set of pairs
so is easy to know always the name of a var and the value of the var... If I
understand correctly this dictionary is "exploted" to the view... I mean
it's key value pairs are populated to the view for access them directly,
some like
put in a controller:
def some():
return dict(key1="2343", 23=12)
def some2 dict("hi"="there")
now in your view:
{{=dir()]}
I guess it goes trough the manipulation over the elements of the returned
dict with some of http://docs.python.org/library/functions.html#locals or
http://docs.python.org/library/functions.html#globals
See here for furter understanding
http://www.faqs.org/docs/diveintopython/dialect_locals.html#dialect.locals.readonly.example
2010/1/29 candide2023 <[email protected]>
> hi, I am new here, in python and web2py as well. I was thinking about
> to get involved in web programming, I started with php (studied about
> 2 weeks) and then tried django (about 1 day) and now web2py(about 2
> weeks) I am going through the manual. Anyways, there is one poing that
> I didnt get.
>
> Why do we have dict's. and why do we always need to use it as:
>
> def index()
> ...
>
> return dict (a=b)
>
> this is where I didnt get.
>
> Thanks for the reply.
>
> Best,
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<web2py%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.