本文整理汇总了Python中tasks.models.Task.assigned_to方法的典型用法代码示例。如果您正苦于以下问题:Python Task.assigned_to方法的具体用法?Python Task.assigned_to怎么用?Python Task.assigned_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tasks.models.Task
的用法示例。
在下文中一共展示了Task.assigned_to方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: from tasks.models import Task [as 别名]
# 或者: from tasks.models.Task import assigned_to [as 别名]
def save(self, user):
"""
Writes and returns a Ticket() object
"""
t = Task( task = self.cleaned_data['title'],
submitter_email = self.cleaned_data['submitter_email'],
created = timezone.now(),
completed_date=self.cleaned_data['completed_date'],
status = Task.OPEN_STATUS,
note = self.cleaned_data['Note'],
project_agreement = self.cleaned_data['project_agreement'],
table = self.cleaned_data['table'],
priority = self.cleaned_data['priority'],
due_date = self.cleaned_data['due_date'],
)
if self.cleaned_data['assigned_to']:
try:
u = User.objects.get(id=self.cleaned_data['assigned_to'])
t.assigned_to = u
except User.DoesNotExist:
t.assigned_to = None
t.save()