Navigation menu

2011-04-12 Thread Daniel Gerzo
g whether someone came up with something more nicer? Thanks! -- Kind regards Daniel Gerzo -- 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

testing views problem

2011-04-14 Thread Daniel Gerzo
getting HttpResponse object returned from the get() method, even though the docs says it should be Response object? BTW, this is Django 1.3-release. Thanks. -- Kind regards Daniel Gerzo -- You received this message because you are subscribed to the Google Groups "Django users"

Re: testing views problem

2011-04-14 Thread Daniel Gerzo
at I am getting HttpResponse instead of Response and I don't really understand why. -- Kind regards Daniel Gerzo -- 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

Re: testing views problem

2011-04-14 Thread Daniel Gerzo
On 14.4.2011 20:12, Daniel Gerzo wrote: On 14.4.2011 18:21, Shawn Milochik wrote: If the code sample you pasted is accurate, then you have an extra space between 'activate' and the next forward-slash. I doesn't really matter what kind of URL I pass to get() method (I am actuall

compressing uploaded file

2011-04-19 Thread Daniel Gerzo
Hello all, I am uploading some text files through django (using a form FileField), and I am getting InMemoryUploadedFile objects this way. In my handle_uploaded_subtitles() method, which gets the list of InMemoryUploadedFile objects, I would like to compress these files (so that I will get ei

Re: compressing uploaded file

2011-04-20 Thread Daniel Gerzo
ub_file.file.save(file.name, bz_file) Regards, On Tue, Apr 19, 2011 at 7:36 PM, Daniel Gerzo mailto:dge...@gmail.com>> wrote: Hello all, I am uploading some text files through django (using a form FileField), and I am getting InMemoryUploadedFile objects this way. In my

validating file uploads

2011-04-20 Thread Daniel Gerzo
I need to validate all of them. Currently my validation happens in in handle_uploaded_file() method, but when I raise a ValidationError from there, it doesn't come from the form.is_valid() and thus would result in HTTP 500 response in production. Thanks. -- Yours sincerely Daniel Gerzo

Re: validating file uploads

2011-04-20 Thread Daniel Gerzo
On 20.4.2011 11:36, Daniel Gerzo wrote: Is there a way to access request.FILES from form.clean() method? I'd like to detect the invalid files within the form validation, so that I can render the errors should there be some. I guess I have solved it by accessing self.files.values() i

Re: compressing uploaded file

2011-04-20 Thread Daniel Gerzo
On 20.4.2011 17:56, Ian Clelland wrote: Well, an InMemoryUploadedFile isn't a real file, so I'm not surprised that that doesn't work. You'll have to pull the data out of it, and compress that. Try something like this: def handle_uploaded_subtitles(self, files): for uploaded_file in files:

ORM help

2011-04-22 Thread Daniel Gerzo
Hello guys, I have a following models: class Movie(models.Model): title = models.CharField(max_length=255) year = models.IntegerField(max_length=4) rating = models.DecimalField(max_digits=2, decimal_places=1, default=0) class Request(models.Model): movie = models.ForeignKey(Movi

URLs in error messages from form validation

2011-04-24 Thread Daniel Gerzo
e some way to disable it for this specific case? The form is being rendered like: id="upload">{% csrf_token %} {{ form.as_table }} type="reset" value="Reset" /> Thanks. -- Kind regards Daniel Gerzo -- You received

Re: URLs in error messages from form validation

2011-04-25 Thread Daniel Gerzo
On 25.4.2011 12:40, Kane Dou wrote: * Daniel Gerzo [2011-04-24 17:52:13 +0200]: Hello all, say I have a following form: class MyForm(forms.Form): id = forms.IntegerField(max_length=9) language = forms.CharField(max_length=10) file = forms.FileField() And a following pseudo

Re: URLs in error messages from form validation

2011-04-25 Thread Daniel Gerzo
ehere')) This indeed works, thank you very much! PS: I'm just wondering where did you find this? I was looking around the documentation and was unable to get any trace of such a function... -- Best regards Daniel Gerzo -- You received this message because you are subscribed to th

Re: Internationalization and localization

2012-01-13 Thread Daniel Gerzo
On Tue, 6 Dec 2011 16:40:42 -0800 (PST), rentgeeen wrote: But what I want to achieve is if I give somebody link: it/sample/ en/sample/ it will show that page in that language, now I have to choose language and then go to the page and see it in that language... you need django 1.4 and i18n_

Re: Database connection closed after each request?

2012-01-15 Thread Daniel Gerzo
n use django-orm[1] for that. [1] https://github.com/niwibe/django-orm Kind regards Daniel Gerzo -- 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 t

Re: Internationalization and localization

2012-01-22 Thread Daniel Gerzo
On 21.1.2012 22:53, Radek Valachovic wrote: but thats developer edition not released yet well you can use https://github.com/brocaar/django-i18nurls instead (which is basically the same thing which was imported into django) until 1.4 is released. you need django 1.4 and i18n_patterns:

GeoDjango distance queryset filter with distance value stored within model

2012-03-03 Thread Daniel Gerzo
Hello guys, I have an Order model, that has an origin PointField and a range IntegerField. Furthermore, there is an UserProfile model, which has a geo_location PointField. Now, I have an User instance, user. I want to select all Orders, whose distance between Order.origin and user.userprofile

Re: Userprofile, signal and admin inline edit.

2012-11-29 Thread Daniel Gerzo
Hello Jon, have you ever found a solution for this? Thanks. On Tuesday, June 14, 2011 5:04:09 PM UTC+2, Jon Biddle wrote: > > The issue seems to come from the fact that the order of operations > when you create the user looks like this: > > 1) Django admin saves the new User > 2) post_save on