本文整理汇总了Python中pyasm.biz.Project.get_project_name方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_project_name方法的具体用法?Python Project.get_project_name怎么用?Python Project.get_project_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.biz.Project
的用法示例。
在下文中一共展示了Project.get_project_name方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_timecard
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def _create_timecard(my, search_type, search_id):
'''create an entry in the timecard table'''
timecard = SObjectFactory.create("sthpw/timecard")
timecard.set_value("search_type", search_type)
timecard.set_value("search_id", search_id)
timecard.set_value('login', Environment.get_user_name())
timecard.set_value('project_code', Project.get_project_name())
return timecard
示例2: alter_search
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def alter_search(self, search):
# get all of the relevant tasks to the user
task_search = Search("sthpw/task")
task_search.add_column("search_id")
# only look at this project
project = Project.get_project_name()
task_search.add_filter("search_type", search.get_search_type())
# figure out who the user is
security = Environment.get_security()
login = security.get_login()
user = login.get_value("login")
print "is_artist: ", self.is_artist()
print "is_supervisor: ", self.is_supervisor()
# do some filtering
web = WebContainer.get_web()
show_assigned_only = self.checkbox.get_value()
show_process = web.get_form_values("process")
if not show_process or show_process[0] == '':
show_process = []
show_task_status = web.get_form_values("task_status")
if not show_task_status or show_task_status[0] == '':
show_task_status = []
if show_assigned_only == "on":
task_search.add_filter("assigned", user)
if show_process:
where = "process in (%s)" % ", ".join( ["'%s'" % x for x in show_process] )
task_search.add_where(where)
if show_task_status:
where = "status in (%s)" % ", ".join( ["'%s'" % x for x in show_task_status] )
task_search.add_where(where)
else:
task_search.add_where("NULL")
# record the tasks
self.tasks = task_search.get_sobjects()
# get all of the sobject ids
sobject_ids = ["'%s'" % x.get_value("search_id") for x in self.tasks]
# get all of the sobjects related to this task
if sobject_ids:
search.add_where( "id in (%s)" % ", ".join(sobject_ids) )
示例3: get_by_key
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def get_by_key(cls, key, search_type=None):
dict_key = '%s:%s' %(key, search_type)
search = Search(cls.SEARCH_TYPE)
search.add_filter("key", key)
if search_type:
search.add_filter("search_type", search_type)
if Project.get_project_name() in ['admin', 'sthpw']:
return None
prod_setting = ProdSetting.get_by_search(search, dict_key)
return prod_setting
示例4: get_value_by_key
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def get_value_by_key(cls, key, search_type=None):
'''
container_key = cls._get_container_key(key,search_type)
value = Container.get(container_key)
if value:
return value
'''
if Project.get_project_name() in ['sthpw', 'admin']:
return ''
prod_setting = cls.get_by_key(key, search_type)
value = ''
if prod_setting:
value = prod_setting.get_value("value")
return value
示例5: alter_search
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def alter_search(my, search):
value = my.search_type_sel.get_value()
project_name = Project.get_project_name()
if value:
# the full name may have been stored in WidgetSettings
if "?" in value:
search_str = value
else:
search_str = "%s?project=%s" % (value, project_name)
search.add_filter("search_type", search_str)
value = my.context_txt.get_value().strip()
if value:
search.add_filter("context", value)
my.date_sel.alter_search(search)
my.user_filter.alter_search(search)
示例6: get_by_key
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def get_by_key(cls, key, search_type=None):
from pyasm.security import Site
site = Site.get_site()
Site.set_site( Site.get_first_site() )
project = Project.get_project_code()
dict_key = '%s:%s' %(key, search_type)
search = Search(cls.SEARCH_TYPE, project_code=project)
search.add_filter("key", key)
if search_type:
search.add_filter("search_type", search_type)
if Project.get_project_name() in ['admin', 'sthpw']:
return None
prod_setting = ProdSetting.get_by_search(search, dict_key)
Site.pop_site()
return prod_setting
示例7: init
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def init(my):
project_name = Project.get_project_name()
exec("from sites.%s.modules import HeaderWdg" % project_name, \
globals(), locals())
my.add( HeaderWdg() )
undo_redo = SpanWdg()
undo_redo.set_style("float: right")
undo_redo.add_style("margin", "5px 5px")
undo_redo.add(UndoButtonWdg())
undo_redo.add(RedoButtonWdg())
undo_redo.add(IconRefreshWdg())
undo_redo.add(HelpMenuWdg())
my.add( undo_redo )
tab = MainTabWdg()
my.add(tab)
示例8: create
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def create(sobject, queue_type, priority, description, command=None):
queue = SObjectFactory.create("sthpw/queue")
queue.set_value("project_code", Project.get_project_name())
queue.set_sobject_value(sobject)
queue.set_value("queue", queue_type)
queue.set_value("state", "pending")
queue.set_value("login", Environment.get_user_name())
if command:
pickled = pickle.dumps(command)
queue.set_value("command", command.__class__.__name__)
queue.set_value("serialized", pickled)
queue.set_value("priority", priority)
queue.set_value("description", description)
queue.set_user()
queue.commit()
return queue
示例9: create
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def create(key, value, type, description='', search_type=''):
'''create a ProdSetting'''
if Project.get_project_name() in ['admin', 'sthpw']:
return None
ProdSetting.clear_cache()
setting = ProdSetting.get_by_key(key, search_type)
if not setting:
setting= SObjectFactory.create( ProdSetting.SEARCH_TYPE )
setting.set_value("key", key)
setting.set_value("value", value)
setting.set_value("type", type)
if description:
setting.set_value("description", description)
if search_type:
setting.set_value("search_type", search_type)
else:
setting.set_value("value", value)
setting.commit()
return setting
示例10: is_artist
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def is_artist(self):
# if the user is a artist, look at all of the assets
project = Project.get_project_name()
security = Environment.get_security()
return security.check_access("prod/%s" % project, "model/artist", "true")
示例11: is_supervisor
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_project_name [as 别名]
def is_supervisor(self):
# if the user is a supervisor, look at all of the assets
project = Project.get_project_name()
security = Environment.get_security()
return security.check_access("prod/%s" % project, "model/supervisor", "true")