Re: muliple pagination on same page

2014-08-27 Thread hardik sottany
Sir I will mail my appointment modal please give me a sample solution
On Aug 27, 2014 8:36 PM, "Camilo Torres"  wrote:

> This is basically a DB query issue. Follow these general directions:
>
> 1. In your page add a form with a select with the filtering options.
> 2. In your view, instead of getting all the instance of your model, filter
> by the selected option.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/6Q9-DElNxPU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ff014ba5-d10c-4a54-9039-799794278a00%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMboYZJgddc%3DKPAzSkANmyR1qs5dzu23RvBiir0ZHgKEfqTofw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


response to ajax (jquery) with variables

2014-08-27 Thread Antonio Russoniello

Hello,

i hope you can help me with this, I'm trying to send to an ajax (jquery 
from my html template) a response but i would like to send also a new 
variable.


in my html template I have:

$("#init_date").click(function(){
var some_date = {'init_date': init_date, 'end_date': end_date};
$.post("/filter_dates/", some_date, function(response){
if(response === 'success'){
/MAKE SOMETHING//!!!/
else{ alert('error'); }
});
});

my django view look like:

def filter_date(request):
if request.method == 'POST':
example = ['A','B','C']
init_date = request.POST['init_date']
end_date = request.POST['end_date']
 MAKE SOMETHING!!
return HttpResponse('success') /AND HERE I WOULD LIKE TO SEND 
THE example ARRAY.../

else:
return HttpResponse('error')

How can I send the array o some other variable as response?

Regards,
AR

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53FE7E44.4020104%40musicparticles.com.
For more options, visit https://groups.google.com/d/optout.


Django URLs em arquivos CSS

2014-08-27 Thread Edson Pereira da Silva
#art-main 
{ 
   background: #63AFDE url('images/page.png') top center scroll;
}

Como resolver o problema da TAG URL para receber a caminho da imagem?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/210e1c98-3d12-4b99-98e4-77f253e23005%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


HttpResponse methods difference

2014-08-27 Thread Yarick Antonov
What the difference between HttpResponse.Write() 
,
 
HttpResponse.flush() 

 
and HttpResponse.tell() 

 
methods?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e692f169-817d-475f-9dbc-7885ab71b47f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MultiValueDictKeyError in Django 1.6

2014-08-27 Thread Mike Dewhirst

On 28/08/2014 10:26 AM, Collin Anderson wrote:

are you using a custom template or a custom form?


That was it.

Thank you very much Collin

Cheers

Mike



--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/73220083-92db-43a4-98e1-c49bd42e4d83%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53FE7A3C.7080807%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: MultiValueDictKeyError in Django 1.6

2014-08-27 Thread Collin Anderson
are you using a custom template or a custom form?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/73220083-92db-43a4-98e1-c49bd42e4d83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MultiValueDictKeyError in Django 1.6

2014-08-27 Thread Mike Dewhirst
On updating from Django 1.5 to 1.6 I'm seeing MultiValueDictKeyError 
(see below) on saving a fairly complex set of linked models in the Admin 
whether anything actually changed or not.


Postgres 9.1
Python 2.7 and 3.4
Apache on Ubuntu 12.04 and manage.py runserver on Windows 8.1

Downgrading to 1.5 again makes the problem go away on all the above. So 
that's what I've done.


I'll dig a bit deeper via Google shortly but it might save me a heap of 
time if anyone else seen this and found a nice simple fix?


Thanks

Mike



Environment:


Request Method: POST
Request URL: http://localhost:8000/admin/substance/substance/1/

Django Version: 1.6.5
Python Version: 3.4.0
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.staticfiles',
 'common',
 'company',
 'workplace',
 'substance',
 'refer')
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware')


Traceback:
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\core\handlers\base.py" 
in get_response
  112. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\contrib\admin\options.py" 
in wrapper
  432. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py" 
in _wrapped_view

  99. response = view_func(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\views\decorators\cache.py" 
in _wrapped_view_func

  52. response = view_func(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\contrib\admin\sites.py" in 
inner

  198. return view(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py" 
in _wrapper

  29. return bound_func(*args, **kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py" 
in _wrapped_view

  99. response = view_func(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py" 
in bound_func

  25. return func(self, *args2, **kwargs2)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\db\transaction.py" in 
inner

  371. return func(*args, **kwargs)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\contrib\admin\options.py" 
in change_view

  1229. if all_valid(formsets) and form_validated:
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in 
all_valid

  415. if not formset.is_valid():
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in 
is_valid

  292. err = self.errors
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in 
errors

  267. self.full_clean()
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in 
full_clean

  314. form = self.forms[i]
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\functional.py" 
in __get__
  49. res = instance.__dict__[self.func.__name__] = 
self.func(instance)
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in 
forms
  133. forms = [self._construct_form(i) for i in 
xrange(self.total_form_count())]
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in 

  133. forms = [self._construct_form(i) for i in 
xrange(self.total_form_count())]
File "C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\models.py" 
in _construct_form
  848. form = super(BaseInlineFormSet, self)._construct_form(i, 
**kwargs)
File "C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\models.py" 
in _construct_form

  564. pk = self.data[pk_key]
File 
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\datastructures.py" 
in __getitem__

  301. raise MultiValueDictKeyError(repr(key))

Exception Type: MultiValueDictKeyError at /admin/substance/substance/1/
Exception Value: "'uses-0-id'"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: How quickly do Django unit tests run?...

2014-08-27 Thread Benjamin Scherrey
Postgres. best of luck.


On Thu, Aug 28, 2014 at 4:16 AM, Fred Stluka  wrote:

>  Ben,
>
> Thanks!  That's exactly the kind of ballpark figure I wanted.
>
> Sounds like I should be expecting roughly 5-10 tests/sec, plus
> maybe 10-20 secs DB setup/migration.  I'm currently seeing 1
> test per 7-9 secs, plus 50-60 secs DB setup time (syncdb, not
> South, since I'm setting SOUTH_TESTS_MIGRATE = False).
>
> Yeah, something must be wrong here.  I'm running 100X slower
> than expected.
>
> BTW, are those numbers using SQLite, MySQL, PostgreSQL, other?
> So far, I'm using MySQL, running locally on a pretty fast Mac laptop.
> I'm planning to switch to SQLite for testing, to make it run faster,
> but haven't gotten that to work yet.
>
> My next steps will be try again with SQLite, and perhaps get the
> test suite to run in the PyCharm debugger so I can step through
> the code and see where all the time is going.
>
> Thanks again!
>
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com  --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>  On 8/27/14 4:21 PM, Benjamin Scherrey wrote:
>
> Clearly that depends on what your tests do. One of our projects runs ~400
> tests in about a minute. If your tests do much database access or have
> complex setUp/tearDown then that's not going to be as fast of course. The
> Django 1.7 project I'm working on at the moment takes a total of 12.7
> seconds to complete but most of that time is the setup and migrations
> execution for the test db. Once it starts the 36 tests I have now complete
> in 3.58 seconds in verbose mode with full branch coverage turned on.
>
>  coverage run --branch --source="partner,item,utils,importing,channel"
> manage.py test --verbosity=2 && coverage report --show-missing
>
>  -- Ben
>
>
> On Thu, Aug 28, 2014 at 3:13 AM, Fred Stluka  wrote:
>
>>  Benjamin,
>>
>> OK, Thanks!  So roughly how fast would you expect?  Hundreds
>> of trivial tests per minute?  Thousands per minute?
>>
>> Thanks!
>> --Fred
>> --
>> Fred Stluka -- mailto:f...@bristle.com  --
>> http://bristle.com/~fred/
>> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
>> Open Source: Without walls and fences, we need no Windows or Gates.
>> --
>>   On 8/27/14 3:57 PM, Benjamin Scherrey wrote:
>>
>>  Something's definitely wrong. Except for the initial setup for the test
>> run (in 1.7 migrations run each time for example), the individual tests
>> should execute as fast as any normal python unit test.
>>
>>
>> On Wed, Aug 27, 2014 at 9:06 PM, Fred Stluka  wrote:
>>
>>> How quickly do Django unit tests run?
>>>
>>> Mine are taking 7-9 seconds each, even for trivial tests like:
>>> self.assertEqual(1 + 1, 2)
>>> that are all in the same test class of the same app.
>>>
>>> Is this typical?  Or do I have something misconfigured.
>>>
>>> Thanks!
>>> --Fred
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/53FDE5E7.6040506%40bristle.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>>  --
>> Chief Systems Architect Proteus Technologies 
>> Chief Fan Biggest Fan Productions 
>> Personal blog where I am not your demographic
>> .
>>
>>  This email intended solely for those who have received it. If you have
>> received this email by accident - well lucky you!!
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>>  To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHN%3D9D4DNokh2VG47JE9m39FWuR%2Bcc%3D-inUL%3DeRJEr18YHnFRQ%40mail.gmail.com
>> .
>>
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>  --
>>  You received this message because you are subscribed to the Google

Re: How quickly do Django unit tests run?...

2014-08-27 Thread Fred Stluka

Ben,

Thanks!  That's exactly the kind of ballpark figure I wanted.

Sounds like I should be expecting roughly 5-10 tests/sec, plus
maybe 10-20 secs DB setup/migration.  I'm currently seeing 1
test per 7-9 secs, plus 50-60 secs DB setup time (syncdb, not
South, since I'm setting SOUTH_TESTS_MIGRATE = False).

Yeah, something must be wrong here.  I'm running 100X slower
than expected.

BTW, are those numbers using SQLite, MySQL, PostgreSQL, other?
So far, I'm using MySQL, running locally on a pretty fast Mac laptop.
I'm planning to switch to SQLite for testing, to make it run faster,
but haven't gotten that to work yet.

My next steps will be try again with SQLite, and perhaps get the
test suite to run in the PyCharm debugger so I can step through
the code and see where all the time is going.

Thanks again!
--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 8/27/14 4:21 PM, Benjamin Scherrey wrote:
Clearly that depends on what your tests do. One of our projects runs 
~400 tests in about a minute. If your tests do much database access or 
have complex setUp/tearDown then that's not going to be as fast of 
course. The Django 1.7 project I'm working on at the moment takes a 
total of 12.7 seconds to complete but most of that time is the setup 
and migrations execution for the test db. Once it starts the 36 tests 
I have now complete in 3.58 seconds in verbose mode with full branch 
coverage turned on.


coverage run --branch --source="partner,item,utils,importing,channel" 
manage.py test --verbosity=2 && coverage report --show-missing


-- Ben


On Thu, Aug 28, 2014 at 3:13 AM, Fred Stluka > wrote:


Benjamin,

OK, Thanks!  So roughly how fast would you expect? Hundreds
of trivial tests per minute?  Thousands per minute?

Thanks!
--Fred

Fred Stluka -- mailto:f...@bristle.com --
http://bristle.com/~fred/ 
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 8/27/14 3:57 PM, Benjamin Scherrey wrote:

Something's definitely wrong. Except for the initial setup for
the test run (in 1.7 migrations run each time for example), the
individual tests should execute as fast as any normal python unit
test.


On Wed, Aug 27, 2014 at 9:06 PM, Fred Stluka > wrote:

How quickly do Django unit tests run?

Mine are taking 7-9 seconds each, even for trivial tests like:
self.assertEqual(1 + 1, 2)
that are all in the same test class of the same app.

Is this typical?  Or do I have something misconfigured.

Thanks!
--Fred

-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from
it, send an email to
django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to
django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/53FDE5E7.6040506%40bristle.com.
For more options, visit https://groups.google.com/d/optout.




-- 
Chief Systems Architect Proteus Technologies


Chief Fan Biggest Fan Productions 
Personal blog where I am not your demographic
.

This email intended solely for those who have received it. If you
have received this email by accident - well lucky you!!
-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to
django-users@googlegroups.com .
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit


Re: How quickly do Django unit tests run?...

2014-08-27 Thread Benjamin Scherrey
Clearly that depends on what your tests do. One of our projects runs ~400
tests in about a minute. If your tests do much database access or have
complex setUp/tearDown then that's not going to be as fast of course. The
Django 1.7 project I'm working on at the moment takes a total of 12.7
seconds to complete but most of that time is the setup and migrations
execution for the test db. Once it starts the 36 tests I have now complete
in 3.58 seconds in verbose mode with full branch coverage turned on.

coverage run --branch --source="partner,item,utils,importing,channel"
manage.py test --verbosity=2 && coverage report --show-missing

-- Ben


On Thu, Aug 28, 2014 at 3:13 AM, Fred Stluka  wrote:

>  Benjamin,
>
> OK, Thanks!  So roughly how fast would you expect?  Hundreds
> of trivial tests per minute?  Thousands per minute?
>
> Thanks!
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com  --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>  On 8/27/14 3:57 PM, Benjamin Scherrey wrote:
>
> Something's definitely wrong. Except for the initial setup for the test
> run (in 1.7 migrations run each time for example), the individual tests
> should execute as fast as any normal python unit test.
>
>
> On Wed, Aug 27, 2014 at 9:06 PM, Fred Stluka  wrote:
>
>> How quickly do Django unit tests run?
>>
>> Mine are taking 7-9 seconds each, even for trivial tests like:
>> self.assertEqual(1 + 1, 2)
>> that are all in the same test class of the same app.
>>
>> Is this typical?  Or do I have something misconfigured.
>>
>> Thanks!
>> --Fred
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/53FDE5E7.6040506%40bristle.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>  --
> Chief Systems Architect Proteus Technologies 
> Chief Fan Biggest Fan Productions 
> Personal blog where I am not your demographic
> .
>
>  This email intended solely for those who have received it. If you have
> received this email by accident - well lucky you!!
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHN%3D9D4DNokh2VG47JE9m39FWuR%2Bcc%3D-inUL%3DeRJEr18YHnFRQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/53FE3BDE.8020305%40bristle.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chief Systems Architect Proteus Technologies 
Chief Fan Biggest Fan Productions 
Personal blog where I am not your demographic
.

This email intended solely for those who have received it. If you have
received this email by accident - well lucky you!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: How quickly do Django unit tests run?...

2014-08-27 Thread Fred Stluka

Benjamin,

OK, Thanks!  So roughly how fast would you expect?  Hundreds
of trivial tests per minute?  Thousands per minute?

Thanks!
--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 8/27/14 3:57 PM, Benjamin Scherrey wrote:
Something's definitely wrong. Except for the initial setup for the 
test run (in 1.7 migrations run each time for example), the individual 
tests should execute as fast as any normal python unit test.



On Wed, Aug 27, 2014 at 9:06 PM, Fred Stluka > wrote:


How quickly do Django unit tests run?

Mine are taking 7-9 seconds each, even for trivial tests like:
self.assertEqual(1 + 1, 2)
that are all in the same test class of the same app.

Is this typical?  Or do I have something misconfigured.

Thanks!
--Fred

-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/53FDE5E7.6040506%40bristle.com.
For more options, visit https://groups.google.com/d/optout.




--
Chief Systems Architect Proteus Technologies 
Chief Fan Biggest Fan Productions 
Personal blog where I am not your demographic 
.


This email intended solely for those who have received it. If you have 
received this email by accident - well lucky you!!

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHN%3D9D4DNokh2VG47JE9m39FWuR%2Bcc%3D-inUL%3DeRJEr18YHnFRQ%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53FE3BDE.8020305%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem importing blank date using https://github.com/edcrewe/django-csvimport

2014-08-27 Thread Benjamin Scherrey
Unfortunately python's csv capabilities have a fundamental problem - they
can't express null/None content. Any empty content will always show up as
an empty string ''. So what's being pass to your date constructor is an
empty string which is not a valid date format. Best work around is to
generally iterate over your results and replace any '' value with None.

-- Ben


On Thu, Aug 28, 2014 at 2:44 AM, Joel Goldstick 
wrote:

> I'm using an application to import some csv files to my models.  This
> package bombs with the error
> Exception Value: [u"'' value has an invalid date format. It must be in
> -MM-DD format."]
>
> when the csv has empty data.
>
> I've googled, and it looks like there is some discussion on the github
> page making me think this should work for me, but it doesn't
>
> Any ideas?
> --
> Joel Goldstick
> http://joelgoldstick.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPM-O%2BxFqva%2BDUFuT8vPArETWo561iJeuzLeLZARL-yxoP%2BwZA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chief Systems Architect Proteus Technologies 
Chief Fan Biggest Fan Productions 
Personal blog where I am not your demographic
.

This email intended solely for those who have received it. If you have
received this email by accident - well lucky you!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHN%3D9D7pgGu2_dwNB_o6n-qNWXTeDTb%2Bv%3DKopy642Cn%2B0Fm6nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How quickly do Django unit tests run?...

2014-08-27 Thread Benjamin Scherrey
Something's definitely wrong. Except for the initial setup for the test run
(in 1.7 migrations run each time for example), the individual tests should
execute as fast as any normal python unit test.


On Wed, Aug 27, 2014 at 9:06 PM, Fred Stluka  wrote:

> How quickly do Django unit tests run?
>
> Mine are taking 7-9 seconds each, even for trivial tests like:
> self.assertEqual(1 + 1, 2)
> that are all in the same test class of the same app.
>
> Is this typical?  Or do I have something misconfigured.
>
> Thanks!
> --Fred
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/53FDE5E7.6040506%40bristle.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chief Systems Architect Proteus Technologies 
Chief Fan Biggest Fan Productions 
Personal blog where I am not your demographic
.

This email intended solely for those who have received it. If you have
received this email by accident - well lucky you!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHN%3D9D4DNokh2VG47JE9m39FWuR%2Bcc%3D-inUL%3DeRJEr18YHnFRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


problem importing blank date using https://github.com/edcrewe/django-csvimport

2014-08-27 Thread Joel Goldstick
I'm using an application to import some csv files to my models.  This
package bombs with the error
Exception Value: [u"'' value has an invalid date format. It must be in
-MM-DD format."]

when the csv has empty data.

I've googled, and it looks like there is some discussion on the github
page making me think this should work for me, but it doesn't

Any ideas?
-- 
Joel Goldstick
http://joelgoldstick.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPM-O%2BxFqva%2BDUFuT8vPArETWo561iJeuzLeLZARL-yxoP%2BwZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: multiples database

2014-08-27 Thread n lubkov
but 
"If you attempt to access a database that you haven’t defined in your 
DATABASES 
 
setting, Django will raise adjango.db.utils.ConnectionDoesNotExist 
exception."
i need a way to access a database without defined it in the database setting


El miércoles, 27 de agosto de 2014 11:31:52 UTC-5, n lubkov escribió:
>
> Hello, I need to figure if this is possible using django.
>
> I have a main database (admin) and a database (clients) for each client. 
>
> The main database is just a list of clients and the name of the database 
> of each client.
>
> The client’s database records all the data of the clients business.
>
>  
>
> I need to be able to connect dynamically to each client database within 
> code itself, no alteration of the “settings” file. 
>
> Can this be done???
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bc8e9fdb-4776-4391-96ac-d479e4c49120%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


multiples database

2014-08-27 Thread n lubkov


Hello, I need to figure if this is possible using django.

I have a main database (admin) and a database (clients) for each client. 

The main database is just a list of clients and the name of the database of 
each client.

The client’s database records all the data of the clients business.

 

I need to be able to connect dynamically to each client database within 
code itself, no alteration of the “settings” file. 

Can this be done???

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/42baa343-e2bb-438c-8331-461bd4127fee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: multiples database

2014-08-27 Thread Larry Martell
On Wed, Aug 27, 2014 at 12:31 PM, n lubkov  wrote:
> Hello, I need to figure if this is possible using django.
>
> I have a main database (admin) and a database (clients) for each client.
>
> The main database is just a list of clients and the name of the database of
> each client.
>
> The client’s database records all the data of the clients business.
>
>
>
> I need to be able to connect dynamically to each client database within code
> itself, no alteration of the “settings” file.
>
> Can this be done???

https://docs.djangoproject.com/en/1.6/topics/db/multi-db/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY5azJdHU7fn9XdqR0FmaUOwuTh%3D%3DsygJLis7aYVunaVQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: muliple pagination on same page

2014-08-27 Thread Camilo Torres
This is basically a DB query issue. Follow these general directions:

1. In your page add a form with a select with the filtering options.
2. In your view, instead of getting all the instance of your model, filter by 
the selected option.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ff014ba5-d10c-4a54-9039-799794278a00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error importing dbapi2...

2014-08-27 Thread Camilo Torres
If you are running inside a virtualenv, assure you have the sqlite3 module 
installed inside the v-env, or run toggleglobalsitepackages inside the v-env.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/91d24a6a-0364-40d9-a593-7b3e081063fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TypeError: "Source code string cannot contain null bytes"

2014-08-27 Thread Camilo Torres
As it says: you have a null character in your  source code script. That is an 
invalid character for a python script; this does not seems to be related with 
Django.

Open your source code script with a powerfull text editor capable of showing 
hidden/special characters, then look for a 'null' character somewhere in your 
code.

If you pasted a text, assure you correctly copy the source.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cb1ae209-1bd6-4ab4-afdd-2515c57ea5f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django manage.py commands not displaying

2014-08-27 Thread Collin Anderson
wow. that's an ancient manage.py. now-a-days it looks like this:

https://github.com/django/django/blob/master/django/conf/project_template/manage.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1dd96360-5e1e-4c3f-8974-b1b1dda2587f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can not add a group to a custom auth user

2014-08-27 Thread Collin Anderson
i assume "groups" is an editable field in the admin.

after the admin calls merchant.save(), it then clears out and re-assigns 
the value of groups based on the data in the input field.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/40f10aed-6e0a-46d6-84e9-30dd3823ac54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How quickly do Django unit tests run?...

2014-08-27 Thread Fred Stluka

How quickly do Django unit tests run?

Mine are taking 7-9 seconds each, even for trivial tests like:
self.assertEqual(1 + 1, 2)
that are all in the same test class of the same app.

Is this typical?  Or do I have something misconfigured.

Thanks!
--Fred

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53FDE5E7.6040506%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Re: django manage.py commands not displaying

2014-08-27 Thread RSS
it`s standart:
#!/usr/bin/env python
import os
import sys
import imp

try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the 
directory containing %r. It appears you've customized things.\nYou'll have 
to run django-admin.py, passing it your settings module.\n" % __file__)
sys.exit(1)

import settings

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") #path to 
the settings py file
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) 

manage.py, settings... In root folder public_html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/958ae613-8c68-4e75-81d2-675074a6aa8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django manage.py commands not displaying

2014-08-27 Thread RSS

>
> Can you please post the content of your manage.py?
> Cheers
>

it`s standart:
#!/usr/bin/env python
import os
import sys
import imp

try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the 
directory containing %r. It appears you've customized things.\nYou'll have 
to run django-admin.py, passing it your settings module.\n" % __file__)
sys.exit(1)

import settings

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") #path to 
the settings py file
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) 

manage.py, settings... all in root folder: public_html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1da60ff-d84c-44f8-98da-525cfd7ebdcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django manage.py commands not displaying

2014-08-27 Thread marc
Can you please post the content of your manage.py?

Cheers

Am Dienstag, 26. August 2014 15:28:43 UTC+2 schrieb RSS:
>
> sorry my bad English
>
> i`m working on hosting
>
> project structure:
> --myenv
> --rsskg.ru
> public_html
> --virtaulenv-1.9
>
> $ cd projects.ru/public_html
> $ source ~/myenv/bin/activate 
> $ ./manage.py
> ...Available subcommands:
> here nothing
>
> $ django-admin.py
> Available subcommands:
> [django]
> ...
> It`s Ok
>
> Why this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08a58308-9e4d-4957-8bd0-d3dcb4dfe722%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: hosting django app

2014-08-27 Thread ngangsia akumbo
thanks

On Tuesday, August 26, 2014 2:28:03 PM UTC+1, wuo...@gmail.com wrote:
>
> https://www.digitalocean.com/?refcode=2bcdb0958160
>
> I paying 5$ in month. Very good support.
>
> вторник, 26 августа 2014 г., 13:46:12 UTC+4 пользователь ngangsia akumbo 
> написал:
>>
>> thanks guys
>>
>>>
>>>
>> On Friday, August 22, 2014 7:29:02 PM UTC+1, Cal Leeming [iops.io] wrote:
>>>
>>> Have a look at Heroku too
>>>
>>> Alternative, your own VPS on DigitalOcean if you have enough in-house 
>>> devops guys
>>>
>>> Cal
>>>
>>>
>>> On Fri, Aug 22, 2014 at 9:25 AM, ngangsia akumbo  
>>> wrote:
>>>
 my boss uses php to build web apps

 he is n9ot very convince that django can be very cheap in hosting as 
 php.

 is there any way i can host a django app whic is as cheap as php?
  
 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/30d329d4-04c6-46cb-bc9a-76844e15d90a%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4333f7c2-6841-475a-b2f1-403d43648f89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Comments in real time

2014-08-27 Thread Aaron Reabow
thank you for the responses, I will have a go at each.

I wonder if the angular and websockets approaches could compliment each 
other...

On Friday, 22 August 2014 20:52:26 UTC+2, Julo Waks wrote:
>
> If you need to save the comments, take a look to django-angular.
> Its an integration of angularJS into django.
> Where you can save the model via javascript, i really recommend you 
> Angular for this.
> --
> *From: * Collin Anderson  
> *Sender: * django...@googlegroups.com  
> *Date: *Fri, 22 Aug 2014 10:37:22 -0700 (PDT)
> *To: *
> *ReplyTo: * django...@googlegroups.com  
> *Subject: *Re: Comments in real time
>
> You could also look into the EventSource JavaScript API.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/4df79594-fc7d-42be-acec-4c2385afe10a%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/397920ed-f494-4a0d-834f-0745837ee003%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django ORM generate inefficient SQL

2014-08-27 Thread Simon Charette
This is already tracked in #19259 
.

Le jeudi 21 août 2014 06:49:41 UTC-4, Alex Lebedev a écrit :
>
> Hi, guys!
>
> I have encountered a problem. When I use the following code in django 
> shell:
>
> from django.contrib.auth.models import Group
> from django.db.models import Count
> print Group.objects.annotate(cnt=Count('user')).values('id', 
> 'cnt').query.sql_with_params()
>  
> Django ORM generate the following SQL query:
>
> 'SELECT `auth_group`.`id`, COUNT(`auth_user_groups`.`user_id`) AS 
> `cnt` FROM `auth_group` LEFT OUTER JOIN `auth_user_groups` ON ( 
> `auth_group`.`id` = `auth_user_groups`.`group_id` ) GROUP BY 
> `auth_group`.`id`, `auth_group`.`name` ORDER BY NULL'
>
> "auth_group.name" occurs in "group by" statement. But this column isn't 
> represented in "select" statement. Such query is inefficient (expecially 
> for large tables with many columns and rows).
>
> Debuging of Django SQLCompiler ( 
> https://github.com/django/django/blob/stable/1.6.x/django/db/models/sql/compiler.py#L568
>  
> ) gives me the following information:
> - postgresql:
> "self.query.select" == "self.query.group_by" == "[(u'auth_group', 
> u'id'), (u'auth_group', 'name')]"
> "self.connection.features.allows_group_by_pk" is False
> "len(self.query.get_meta().concrete_fields) == len(self.query.select)" 
> is False
> 'auth_group'.'name' appears in result because of "cols = self.query.
> group_by + having_group_by + select_cols"
> - mysql:
> "self.query.select" == "self.query.group_by" == "[(u'auth_group', 
> u'id'), (u'auth_group', 'name')]"
> "self.connection.features.allows_group_by_pk" is True
> "len(self.query.get_meta().concrete_fields) == len(self.query.select)" 
> is False
> 'auth_group'.'name' appears in result because of "cols = self.query.
> group_by + having_group_by + select_cols"
>
> In the same time, the following code (without .values()):
>
> from django.contrib.auth.models import Group
> from django.db.models import Count
> print Group.objects.annotate(cnt=Count('user')).query.sql_with_params()
>
> gives the right SQL query for mysql (because "len(self.query.get_meta().
> concrete_fields) == len(self.query.select)" is True):
>
> 'SELECT `auth_group`.`id`, `auth_group`.`name`, 
> COUNT(`auth_user_groups`.`user_id`) AS `cnt` FROM `auth_group` LEFT OUTER 
> JOIN `auth_user_groups` ON ( `auth_group`.`id` = 
> `auth_user_groups`.`group_id` ) GROUP BY `auth_group`.`id` ORDER BY NULL'
>
> Is it a bug? Should I create a bug report or something?
>
> Thanks in advance!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e884cbce-58ff-4704-bf0f-990b85fca407%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.