1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

newforms-admin: Merged to [4749]

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4750 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2007-03-16 16:09:29 +00:00
parent b0bbdc744d
commit 5088488057
80 changed files with 6973 additions and 2105 deletions

View File

@@ -31,4 +31,35 @@
'nonexistent'
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
"""
### SortedDict #################################################################
>>> d = SortedDict()
>>> d['one'] = 'one'
>>> d['two'] = 'two'
>>> d['three'] = 'three'
>>> d['one']
'one'
>>> d['two']
'two'
>>> d['three']
'three'
>>> d.keys()
['one', 'two', 'three']
>>> d.values()
['one', 'two', 'three']
>>> d['one'] = 'not one'
>>> d['one']
'not one'
>>> d.keys() == d.copy().keys()
True
### DotExpandedDict ############################################################
>>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']})
>>> d['person']['1']['lastname']
['Willison']
>>> d['person']['2']['lastname']
['Holovaty']
>>> d['person']['2']['firstname']
['Adrian']
"""