You are not logged in.

Change Language:

Profile for schoolisout

Name schoolisout
Email Address n/a
Posts5
  • read an existent cookie
    Board » Django » Middleware
    Hello,

    I'm writting an application in Django that needs reading an existent cookie that is created after you login in an intranet written in Perl.
    The thing is that I want to call my application from the Perl Intranet and I need the login data (profile,user,id) that is encapsuled in a cookie.
    Cookie name is 'iddsic' and the content is something like that: hash&6caf9063a81cf917a2398ca6b614595b&id&001&profile&administrator&time&1286182890&ip&xxx.xx.xxx.xx&user&clara

    How can I do that?
    I tried this but it did'nt work:

    -I includede this in MIDDLEWARE_CLASSES
    'django.contrib.sessions.middleware.SessionMiddleware',

    -in the views.py

    if "iddsic" in request.COOKIES:
    return HttpResponse("Your profile is %s" % \
    request.COOKIES["profile"])
    else:
    return HttpResponse("You don't have profile.")

    It always enter in the else and I dont know why because the cookie already exists and 'iddsic' is it's name

    Thanks!


  • Change the dateTime field format
    Board » Django » Models
    Hi,

    I'm trying to change the dateTime field format to dd/mm/Y, in order to introduce it that way in a form. I see Django doesn't have this format by default and I don't know exactly what changes I have to make and where make them.

    if anyone can help me..

    Thank you :)
  • how to compare a form field from a form and a field from a list
    Board » Django » Templates
    HI,

    I have a list and a form generated using modelformset_factory (i want to have the chance to edit it). The thing is I want to compare a field from the list with the field from the form. But, let's say I have a 'code' field in the object list and a 'code' field in the form object. Django did'nt let me to compare them like that:

    ifequal(form.cod object.cod)

    I've tried using form.cod.value but it did'nt work.

    Somebody knows how to compare them?

    Thank you!
  • Re: How to customize the size of the fields when I use modelformset_factory
    Board » Django » Templates
    That's exactly what I was looking for

    Thank you!
  • How to customize the size of the fields when I use modelformset_factory
    Board » Django » Templates
    Hi!,

    My problem is: when I use modelformset_factory to present a formset to edit my model instances, it always presents the form with the same size in each field, no matter if I change the model max_lenght or the tag options in the template. Could someone help me to customize the size of the fields in the forms generated using modelformset_factory?

    Thanks a lot


Powered by Sphene Community Tools