First i want to thanks you for watching my post! I have used django for two month for an enterprise project. And im a kind of french noob in web developpement and in django developpment :D
这里我的问题是:为了确定要求的关键。 本届会议之后,又将这一关键内容提上去:
一、导 言
def check(request):
if request.method == POST :
RequestContext(request)
try:
m = MsGnlMember.objects.get(mbr_nom=request.POST[ username ])
except (ObjectDoesNotExist):
return render_to_response( login.html , { BAD : True, username : Unknown User })
if m.mbr_mdp == request.POST[ mdp ]:
Here ===> request.session[ MBR_INSTANCE ] = m
return index(request)
def index(request):
username = request.session["MBR_INSTANCE"].mbr_nom
request.session.modified = True # does not fix my problem
getNote = GetNoteForm()
saveNote = SaveNoteForm()
search = SearchForm()
return render_to_response( index.html , { FORM_GETNOTE : getNote,
FORM_SAVENOTE : saveNote,
FORM_SEARCH : search,
USERNAME : username},
context_instance=RequestContext(request))
该代码的工作相当好(根据查询结果,用户名称在指数.html上改动),但在页数上。
def arbo_get_acts(request):
if request.method == POST and request.is_ajax():
if "MBR_INSTANCE" in request.session:
acts = MsWriAct.objects.filter(act_mbr=request.session[ MBR_INSTANCE ])
acts_serialised = serializers.serialize( json , acts)
return HttpResponse(acts_serialised, application/json )
else:
acts_serialised = {}
return HttpResponse(acts_serialised, application/json )
and i never enter in my if statement : ( snif snif so please explain me what im doing wrong or what i don t understand
EDIT: Ok Everyone, yesterday i test my code at home and it worked pretty well. At work it continue to fail. After a long journey and hard labor i found. It made tilt when i was thinking that "why it works at home and not at work". At home i m using Linux, at work windows. ........ First google search: Here is the shame on me: https://code.djangoproject.com/ticket/9084 File-based session does not store any data on Windows
T_T 如何放松两天的发展