Created
May 23, 2011 18:47
-
-
Save garindra/987269 to your computer and use it in GitHub Desktop.
PyDOM API examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyDOM import PyDOM | |
class ExampleViewComponent(PyDOM): | |
def draw(self): | |
self.div() #Result : '<div></div>' | |
class AnotherViewComponent(PyDOM): | |
def draw(self): | |
self.div('Hi!').span().text('this is a block of text') #Result : '<div>Hi</div><span></span>this is a block of text' | |
dom = AnotherViewComponent() | |
print dom.generate() #Renders : '<div>Hi</div><span></span>this is a block of text' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment