我有如下觀點:
我收到錯誤:'str' 物件沒有屬性 'object'
它一定與我的字串 concat 有關 - 出了什么問題:)
謝謝
def edit_skill_plan(request):
#t = skills.objects.get(skill_id='django_5158517')
skillid = request.POST.get('editbut')
user = request.user
t = skills.objects.get(creator=user, skill_id=skillid)
t.status = 'closed'
t.save() # this will update only
complete_date = datetime.today().strftime('%Y-%m-%d')
week_num = datetime.today().strftime('%V')
x = t.skill_name
user = request.user
points = t.points
cat = t.category
year = datetime.today().strftime('%Y')
status = str(request.user.username) ' completed the task: ' str(x) ' which was worth: ' str(points) ' points'
status.object.create(creator=user, status=status, status_date=complete_date)
uj5u.com熱心網友回復:
你的最后兩行應該是,
status_code = str(request.user.username) ' completed the task: ' str(x) ' which was worth: ' str(points) ' points'
status.object.create(creator=user, status=status_code, status_date=complete_date)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/378554.html
標籤:姜戈
