Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
12a4e8aa
Commit
12a4e8aa
authored
Jul 02, 1999
by
cathi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a problem in the default insertion code.
parent
a9e1db84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
23 deletions
+28
-23
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+28
-23
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
12a4e8aa
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.1
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
7
$'
[
11
:
-
2
]
import
regex
,
sys
,
os
,
string
from
string
import
lower
,
atoi
,
rfind
,
split
,
strip
,
join
,
upper
,
find
...
...
@@ -424,10 +424,11 @@ class HTTPRequest(BaseRequest):
if
defaults
:
for
keys
,
values
in
defaults
.
items
():
if
not
form
.
has_key
(
keys
):
# if the form does not have the key
and the
#
form is not empty,
set the default
# if the form does not have the key
,
# set the default
form
[
keys
]
=
values
else
:
#The form has the key
if
getattr
(
values
,
'__class__'
,
0
)
is
record
:
# if the key is mapped to a record, get the
# record
...
...
@@ -440,27 +441,31 @@ class HTTPRequest(BaseRequest):
# the attribute, set it to the default
setattr
(
r
,
k
,
v
)
form
[
keys
]
=
r
elif
values
==
type
([]):
# the key is mapped to a list
l
=
form
[
keys
]
for
x
in
values
:
# for each x in the list
if
getattr
(
x
,
'__class__'
,
0
)
is
record
:
# if the x is a record
for
k
,
v
in
x
.
__dict__
.
items
():
# loop through each attribute and value in
# the record
for
y
in
l
:
# loop through each record in the form
# list if it doesn't have the attributes
# in the default dictionary, set them
if
not
hasattr
(
y
,
k
):
setattr
(
y
,
k
,
v
)
else
:
# x is not a record
if
not
a
in
l
:
l
.
append
(
a
)
form
[
keys
]
=
l
else
:
# the key is mapped to a list
l
=
form
[
keys
]
for
x
in
values
:
# for each x in the list
if
getattr
(
x
,
'__class__'
,
0
)
is
record
:
# if the x is a record
for
k
,
v
in
x
.
__dict__
.
items
():
# loop through each attribute and value in
# the record
for
y
in
l
:
# loop through each record in the form
# list if it doesn't have the attributes
# in the default dictionary, set them
if
not
hasattr
(
y
,
k
):
setattr
(
y
,
k
,
v
)
else
:
# x is not a record
if
not
a
in
l
:
l
.
append
(
a
)
form
[
keys
]
=
l
# The form has the key, the key is not mapped
# to a record or sequence so do nothing
pass
# Convert to tuples
if
tuple_items
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment