Let's say the fpm#urls is of type list dynamic-document:
-- record fpm.dynamic-document:
string url:
string template:
We would read it:
import ftd
d = ftd.parse("foo.com/FPM.ftd")
urls = d.get("fpm#urls")
assert urls == [
{"url": "/<username>/<page>/", "template": "foo.com/username"}
]
Then we will need a method that will the a URL and urls defined above:
assert ftd.route("/jack/20/", urls) == dict(
template = "foo.com/username",
data = {
"username": "jack",
"page": 20
}
)
Let's say the
fpm#urlsis of typelist dynamic-document:We would read it:
Then we will need a method that will the a URL and
urlsdefined above: