pagination peculiarities...

2011-04-15 Thread Markus T.
Hi everybody, I have a strange effect using pagination. I have a model with events that have a date, time, title, description field and so on. I display the events using pagination. In the model's Meta class I tell Django to order by date. I create a queryset like this: events =

Re: Binary Post Data to ImageField

2009-12-28 Thread Markus T.
After some digging, I finally worked it out. In case anyone is interested, here is the code for Django: from django.core.files.uploadedfile import SimpleUploadedFile def set_user_image(request, img_id): """ set/update a user's image """ if not request.user.is_authenticated(): return

Binary Post Data to ImageField

2009-12-21 Thread Markus T.
Hi, I'm trying to save binary POST data to an ImageFile field - so far with no satisfying success. I can't seem to convince the client (Flex based image editor) to send binary data as correct "multipart/form-data"; I only have the option to send as raw binary data or with POST variables. My

Re: Filter by ForeignKey reference??

2009-02-10 Thread Markus T.
That's it - thanks a lot!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: Filter by ForeignKey reference??

2009-02-03 Thread Markus T.
Thanks for your reply! Your approach returns a list of dictionaries (or tuples if values_list () is used). Do you know of a straight forward way that returns a list of model objects, like filter() or all()? (I mean something smarter than looping the returned list of tuples and creating a new

Filter by ForeignKey reference??

2009-02-02 Thread Markus T.
Hi, I have two simple models: class Country(models.Model): name = models.CharField(_("Name"), max_length=50, unique=True) class Profile(models.Model): name = models.CharField(_("Name"), max_length=50, unique=True) country = models.ForeignKey(Country) If I want

Re: Overriding Model's save method: error propagation

2009-01-14 Thread Markus T.
if x > y: should read except: of course... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group,

Re: Overriding Model's save method: error propagation

2009-01-14 Thread Markus T.
David, for me, these two links did the trick: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom-validation-to-the-admin http://docs.djangoproject.com/en/dev/ref/forms/validation/#ref-forms-validation However, validation as described in the Django docs does not happen in the