I'm migrating a site from Django 1.1 to 1.2 and I can't figure out how
set_test_cookie and test_cookie_worked is supposed to work when using
the CSRF middleware.
I do request.session.set_test_cookie() in my login view, then on POST,
I want to check request.session.test_cookie_worked(), but I
Storybird is adding a Python/Django developer to the team. We're a
small group working on a fun, Django-backed site that's just at the
initial launch stage. We have more ideas than developer time, so we're
looking to expand the team.
Details and contact info are at:
> I don't think there's a clean solution to this (as far as making the
> Admin work with it). I don't think the admin can make use of a custom
> manipulator without hackish code.
Bummer, I figured the best I could hope for would be to replace the
automatic manipulators to do my bidding after
> How about something along these lines (a lazy initialization pattern):
Well, the point of saving that boolean was so I could do database
queries on it (MyModel.objects.filter(has_m2m_thing=True)). That
wouldn't really work with this lazy initialization pattern, unless I'm
missing something.
> Can you describe generally what you are trying to update in the parent
> object when its ManyToMany relationships are changed. Perhaps there's
> a way to solve your specific problem without requiring more general
> purpose solutions (like Custom Manipulators).
Sure. I'm trying to set a boolean
I've got an app where I'd like to set some properties in an object's
save method based on ManyToMany relationships. I now realize that this
doesn't work (at least through the Django admin), because the
AddManipulator saves the object, and then saves the m2m relations
afterwards. Basically this is
You don't have to write all the filter statements at once, you can add
them incrementally. I usually do this kind of thing like:
var1 = request.GET.get('var1', None)
var2 = request.GET.get('var2', None)
var3 = request.GET.get('var3', None)
object_list = MyModel.objects.all()
if var1:
[EMAIL PROTECTED] wrote:
> I'd really love to be able to do something like this:
> {% if videoObject.rating > 0 %}*{% endif %}
> {% if videoObject.rating > 1 %}*{% endif %}
> {% if videoObject.rating > 2 %}*{% endif %}
If this type of code is your goal, you could do something like:
{% ifequal
Nice work John, good stuff.
Do any of the core devs see this as a candidate for inclusion in
contrib?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
9 matches
Mail list logo