Skip to content

Commit 9a5e0d1

Browse files
timnyborgGabDug
authored andcommitted
update usage.rst to include callable url
1 parent 81f751d commit 9a5e0d1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/usage.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ The ``MenuItem`` class should be instantiated and passed to the ``add_item``
2323
class method with the appropriate parameters. ``MenuItem`` accepts a wide
2424
number of options to its constructor method, the majority of which are simply
2525
attributes that become available in your templates when you're rendering out
26-
the menus. The required arguments to MenuItem are the first two; the title of
27-
the menu and the URL, and the keywords that affect menu generation are:
26+
the menus.
27+
28+
``MenuItem`` requires the first two arguments:
29+
30+
* The ``title`` of the item
31+
* The ``url`` of the item, which can be a string or a callable which accepts the request
32+
object and returns a string.
33+
34+
The keywords that affect menu generation are:
2835

2936
* The ``weight`` keyword argument affects sorting of the menu.
3037
* The ``children`` keyword argument is either a list of ``MenuItem`` objects,

0 commit comments

Comments
 (0)