Skip to content

dynamic document router #3

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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