Re: SystemError from django.conf.settings

2011-05-29 Thread А . Р .
2011/5/29 Cameron 

>
>from django.conf import settings
> SystemError: ../Objects/tupleobject.c:118: bad argument to internal
> function
>
>
Seems to me as a Python bug, not something wrong in Django, so upgrading to
newer Python version may help.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question about GenericRelation

2011-05-05 Thread А . Р .
If you want an one-to-one relationship, here you go:
http://docs.djangoproject.com/en/1.3/ref/models/fields/#django.db.models.OneToOneField

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread А . Р .
2011/5/3 Ariel <...@gmail.com>:
> In my apache enviroment settings I have already set that:
>
> export LANG='en_US.UTF-8'
> export LC_ALL='en_US.UTF-8'
>
> But I still get the same error. Bedsides I am using wsgi no modpython.
>
> Please, could somebody help me ???
> Regards
> Thanks in advance.
> Ariel
>

You're getting this on the production environment only?
Anyway, there is not enough information.
All I can propose is using winpdb for debug:
http://code.djangoproject.com/wiki/DebuggingDjangoWithWinpdb

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 500 message with POST

2011-05-02 Thread А . Р .
> @csrf_exempt


> Any ideas what I'm doing wrong?

Try importing csrf_exempt at the top of your views.py:
from django.views.decorators.csrf import csrf_exempt

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Upload image using GET

2011-05-01 Thread А . Р .
2011/5/2 Matias Hernandez Arellano <...@archlinux.cl>:
>
> And if it's not possible use GET to pass the image data to the django 
> application..
> how can i pass de data from a mobile application (without user actions like a 
> web form) to the django application, and upload, or copy de data into a new 
> image??

http://en.wikipedia.org/wiki/POST_%28HTTP%29

It is possible to send POST requests without user actions.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Upload image using GET

2011-05-01 Thread А . Р .
2011/5/2 msdark <...@gmail.com>:


> The service is written in C++ and use thrift to create a Client with
> python.. so i write a simple django application like and interface to
> the C++ service.

What is "thrift"? Do you really mean it?

>
> Now i need to upload an image to the django application using a GET
> method..

You cannot, I think, unless your image is very tiny, then you can pass
it's contents as a GET parameter.
I suggest you use POST instead.

> The idea is: www.servidor.com/upload/path_to_image_in_device.png

I cannot get the image specified.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
>  Oleg Lomaka <...@gmail.com> :
>
>> Hm... Again I think I have answered this question already.
>> Book.objects.annotate(s_count=Count('sequences')).filter(s_count=0)
>
> Right, but if you're trying to get book by id, this is not an option.
> Again, you will need to query db twice.
>

Besides, separate treating of books with and without sequences isn't
a good design decision, I believe.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
 Oleg Lomaka <...@gmail.com> :

> Hm... Again I think I have answered this question already.
> Book.objects.annotate(s_count=Count('sequences')).filter(s_count=0)

Right, but if you're trying to get book by id, this is not an option.
Again, you will need to query db twice.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
 Oleg Lomaka <...@gmail.com> :

> We don't need the first query for fetching books. All data about book
> available from BookSequence too. And all filters you apply to books, you can
> apply to BookSequence via book__ filter. Again, from my first example, and
> using just one query
> bs =
> BookSequence.objects.filter(book__title__startswith='Hello').select_related()
> for s in bs:
>        print s.sequence.name, s.number_in_sequence, s.book.title

That's right. But if we have a book that doesn't belong to any sequence,
bs will be *empty*.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
Oleg Lomaka <...@gmail.com> :

> Sorry, but your question is too general as for me. Django doesn't support
> SQL joins directly. Could you specify with an example what data do you need
> to get from database using "joins"?

I just wonder if it is possible to get data from those three tables in
one sql query using django.
So far we have two queries, one fetching data from the `book` table
(title etc.), and after that the
second fetching sequences (genres, etc.) for this book.

I don't at all mind it be two separate queries, just curiosity.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
2011/5/1 Oleg Lomaka <...@gmail.com>:

> bs = BookSequence.objects.filter(book__pk=1).select_related()
> for s in bs:
>        print s.sequence.name, s.number_in_sequence

Oh, thanks!
Is it possible then to do left/right outer joins, as there may exist
books without
sequences and sequences without books?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django form inputs

2011-04-30 Thread А . Р .
2011/4/30 Pulkit Mehrotra :

>from wishlist.models import wish
>from wishlist.forms import wish

After a quick glance: you're binding wishlist.forms and wishlist
models to the same name.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.