Re: TransactionManagementError from inside atomic block

2017-03-29 Thread Ketan Bhatt
Hey Simon, Thank you for your response, we were able to resolve the problem soon after I posted the query. And yes, you are correct, it was an issue with having multiple DB connections and the `auto-commit` being turned off for one, but then another connection being used for querying. We earlier

Re: TransactionManagementError from inside atomic block

2017-03-29 Thread Simon Charette
Hi Ketan, I'm afraid this will be really hard to solve without the code that is raising this exception. Some details that could help debug the issue: 1. Are your workers multi-threaded? 2. Are you sure you are not calling functions performing manual transaction management? 3. Is your atomic()

Re: Executing DB-Queries during import

2017-03-29 Thread Simon Charette
> Is it advisable to execute db queries in my AppConfig ready signal handler? AppConfig.ready() is still at module-level. > Use case: I want to add URL patterns which get collected from db rows. It might be more appropriate to define an URL resolver (an object like django.conf.url) that perfor

Re: From SQL to Django Queryset API

2017-03-29 Thread Simon Charette
Hello Mauro, The following should do from django.db.models import F Movimento.objects.values( 'anno','impianto' ).annotate( dare=Sum('dare), avere=Sum('avere), diff=Sum(F('dare') - F('avere)), ) Cheers, Simon Le mercredi 29 mars 2017 16:19:37 UTC-4, Mauro Ziliani a écrit : > >

Re: NoReverseMatch when trying to use get_absolute_url with custom template tag

2017-03-29 Thread Melvyn Sopacua
On Wednesday 29 March 2017 09:16:17 Will Holmes wrote: > url(r'^(?P\d+)$/', views.viewEvent, name='viewevent'), name = viewevent > def get_absolute_url(self): > return reverse('cal:viewEvent', args=[str(self.id)], > current_app='cal') name = viewEvent > Sorry about the load of

NoReverseMatch when trying to use get_absolute_url with custom template tag

2017-03-29 Thread Will Holmes
I am making a calendar app which has a custom template tag that takes the python HTML template function and overlays objects from the Events model on the correct days. I am trying to get the displayed objects to have a link directly to an object detail/edit view and am trying to use get_absol

From SQL to Django Queryset API

2017-03-29 Thread Mauro Ziliani
Hi all. My name's Mauro and I working on a DB (SQLite3 now and Postgres in the future). I have a table Movimento with the fields anno integer,impianto integer,dare decimal(10,2),avere decimal(10,2) BY hands I can run SELECT anno,impianto, sum(dare), sum(avere) FROM movimento GROUP BY anno,impi

Re: Meta class completely missing.

2017-03-29 Thread Brandon Willis
Done. No change. What is also very bizarre is that *not* having a Meta class would make the "Restaurant" test (tests/model_inheritance/models.py : Line 107) break badly; class Restaurant has a Meta that subclasses the Meta of class Rating. So if Meta does not exist... well you see the problem. In

Re: Django bug database

2017-03-29 Thread Lelanthran Manickum
On Wednesday, 29 March 2017 14:32:27 UTC+2, Tim Graham wrote: > > I think https://code.djangoproject.com/wiki/OpenData would help. > >> >> Thank you. You are too kind :-) Warm Regards Lelanthran Manickum -- You received this message because you are subscribed to the Google Groups "Django us

Re: Executing DB-Queries during import

2017-03-29 Thread guettli
Am Mittwoch, 22. März 2017 19:20:43 UTC+1 schrieb Tim Graham: > > Correct, module level queries should be avoided. Django might try to add > some detection to warn about or prohibit that, see > https://groups.google.com/d/topic/django-developers/7JwWatLfP44/discussion > . > > I understand db qu

Re: Django bug database

2017-03-29 Thread Tim Graham
I think https://code.djangoproject.com/wiki/OpenData would help. On Wednesday, March 29, 2017 at 7:13:56 AM UTC-4, Lelanthran Manickum wrote: > > Hi all, > > I'm doing a research paper on bugs (and the nature of bugs). As Django is > one of the larger and more stable Python projects I thought the

Django 10.6 throws 'mbcs codec error' on Windows 10 machine in autoload.py

2017-03-29 Thread Paul Rusu-Tibreanu
Hi to all, I am trying to get started with Django. So installing Django through pip and following the tutorial on the project's website, I first created a "mysite" project and now try to run " python manage.py runserver". However, this gives me following error: C:\mysite>python manage.py runs

Django bug database

2017-03-29 Thread Lelanthran Manickum
Hi all, I'm doing a research paper on bugs (and the nature of bugs). As Django is one of the larger and more stable Python projects I thought the Django bug database would be a good source of data. Is it at all possible to download a dump of the Django bug database for offline data-mining? War