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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
import vkontakte | |
import sys | |
import ipdb |
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
def get_chained_select_choices(content_type, depth=1, with_field_types=False): | |
""" Gets field names from the content_type. | |
depth=1 means return any fk or manytomany fields as well | |
TODO: depth>1 is not implemented yet | |
""" | |
if depth > 1: | |
raise Exception("depth should be 0 or 1") | |
# helpers | |
model_klass = content_type.model_class() |
NewerOlder