Last active
December 26, 2015 23:39
-
-
Save marufsiddiqui/7231923 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| if __name__ == "__main__": | |
| website = raw_input("Enter website name: ") | |
| ws = Website.objects.get(subdomain=website) | |
| print "you entered ", ws.name | |
| page = raw_input("Enter page urls, comma separated for multiple pages: ") | |
| pg = Page.objects.get(url=page,website=ws) | |
| print "you entered ", pg | |
| modules = raw_input("Enter module type and block comma separated for multiple modules: ") | |
| print "you entered ", modules | |
| for mod_block in modules.split(','): | |
| module_type, block = mod_block.split(':') | |
| Module.objects.get_or_create( | |
| title=module_type, | |
| block=block, | |
| order=2, | |
| page=pg, | |
| module_type=module_type, | |
| is_published=False, | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment