Skip to content

dynamic document router #3

@amitu

Description

@amitu

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
    }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions