Changing table name in response to a QuerySet

2015-03-16 Thread Peter of the Norse
We have two tables that — for legal reasons — are not allowed to be combined.  The data is so similar that we are using PostgreSQL table inheritance , but we can’t return the information in the same page. Originally, we only had one tabl

Re: Django multiple application with common users

2015-03-16 Thread Luis Zárate
You maybe need to take a look documentation of using routes. https://docs.djangoproject.com/en/1.7/topics/db/multi-db/#using-routers 2015-03-16 8:47 GMT-06:00 Domagoj Kovač : > Hi Raphael, > > I also though this are may options, although first option is the easiest i > would like to do somethin

Testing Migrations (django 1.7)?

2015-03-16 Thread Sean Briceland
Hi all, Previous to Django 1.7, I had a nifty solution for testing south Migrations. I'd basically get a list of migrations for an app via: migrations = Migrations('some_app') Then to get the ORM at a given point in migrations: orm_at_migration = migrations['000X_name_of_migration'].orm() I coul

Re: Need your advices to optimize when annotate foreign key

2015-03-16 Thread Simon Charette
Hi Sardor, I think you've hit a long standing bug: #19259 Annotations generating inefficient SQL on PostgreSQL Simon Le lundi 16 mars 2015 11:56:19 UTC-4, Sardor Muminov a écrit : > > > Hi Simon. > > Yes I am. I forgot to mention it. I am using Post

Re: Need your advices to optimize when annotate foreign key

2015-03-16 Thread Sardor Muminov
Hi Simon. Yes I am. I forgot to mention it. I am using PostgreSQL 9.3.6 Now I am implementing Chenxiong Qi's suggestion. Do you have any idea? On Tuesday, March 17, 2015 at 12:25:00 AM UTC+9, Simon Charette wrote: > > Hi Sardor, > > Are you using PostgreSQL? > > Simon > > Le lundi 16 mars 201

Re: Need your advices to optimize when annotate foreign key

2015-03-16 Thread Simon Charette
Hi Sardor, Are you using PostgreSQL? Simon Le lundi 16 mars 2015 05:19:38 UTC-4, Sardor Muminov a écrit : > > > > Hello there, > > > I am trying to perform aggregation from all objects which have one foreign > key. > > > These are my models: > > ... > > class Post(models.Model): > id = mode

Re: Django multiple application with common users

2015-03-16 Thread Domagoj Kovač
Hi Raphael, I also though this are may options, although first option is the easiest i would like to do something a bit more complex. I would also like to access my applications from different domains and this means options a and b cant satisfied my needs. If i use multiple databases this only

Re: Load Template without rendering/parsing

2015-03-16 Thread Guilherme Leal
Well, that preaty much closes the case Bill.. already created a function that loads the file independently, and returns a HttpResponse with its contents... But thanks a lot for everyones help! Em seg, 16 de mar de 2015 às 11:44, Bill Freeman escreveu: > But that's what the template loader does

Re: Load Template without rendering/parsing

2015-03-16 Thread Avraham Serour
return HttpResponse(content, content_type='text/html') On Mon, Mar 16, 2015 at 4:43 PM, Bill Freeman wrote: > But that's what the template loader does. It loads *DJANGO* templates. > If it does the loading, the template will receive Django processing. > > I see two choices: > > 1. Quote everyth

Re: Load Template without rendering/parsing

2015-03-16 Thread Bill Freeman
But that's what the template loader does. It loads *DJANGO* templates. If it does the loading, the template will receive Django processing. I see two choices: 1. Quote everything in the template that looks like a Django template special syntax so that the rendering process instead just renders

Re: Load Template without rendering/parsing

2015-03-16 Thread Guilherme Leal
Just to clarify the things a little bit more to Avraham.. i DO want the request to pass through django what i dont want is that django treat this particular html as a template. Em seg, 16 de mar de 2015 às 11:15, Guilherme Leal escreveu: > Can you give me an exemple? > > Em seg, 16 de mar d

Re: Load Template without rendering/parsing

2015-03-16 Thread Guilherme Leal
Can you give me an exemple? Em seg, 16 de mar de 2015 às 11:05, Avraham Serour escreveu: > if you don't want django to render your angularjs template file then don't. > > You could treat it as a static file, same way as a .png, the request > woudn't even get to django > > you can not use render

Re: Need your advices to optimize when annotate foreign key

2015-03-16 Thread tkdchen
On Monday, March 16, 2015 at 5:19:38 PM UTC+8, Sardor Muminov wrote: > > > > Hello there, > > > I am trying to perform aggregation from all objects which have one foreign > key. > > > These are my models: > > ... > > class Post(models.Model): > id = models.CharField(max_length=255, primary_k

Re: Load Template without rendering/parsing

2015-03-16 Thread Avraham Serour
if you don't want django to render your angularjs template file then don't. You could treat it as a static file, same way as a .png, the request woudn't even get to django you can not use render to return on the view, instead return the file without loading it in the template renderer On Mon, Ma

Re: Load Template without rendering/parsing

2015-03-16 Thread Guilherme Leal
and the {% ssi %} was the winner :) the only thing that i didnt liked is that i have to strictly type the file path. But that would happend either way, working with the file directly or not. anyway, worked with the {% ssi %}. Thanks A LOT! Em seg, 16 de mar de 2015 às 10:32, François Schietteca

Re: Load Template without rendering/parsing

2015-03-16 Thread François Schiettecatte
I am not sure what you mean. I have this is urls.py # Root view, goes to 'app.home.views.page' (r'^$', 'app.home.views.page'), and the code below in page() in views.py, django routes ‘/‘ to that view and it renders the home page. Or you could use {% ssi %} to include the angular stuff.

Re: Load Template without rendering/parsing

2015-03-16 Thread Guilherme Leal
This solution crossed my mind, and the only down side that i see on it, is that i cant use the "template.loader" logic for finding the right template. Em seg, 16 de mar de 2015 às 09:59, François Schiettecatte < fschietteca...@gmail.com> escreveu: > You can just read the file content and return i

Re: Load Template without rendering/parsing

2015-03-16 Thread François Schiettecatte
You can just read the file content and return it with an HttpResponse(), like this: # File handle fileHandle = None # Open the file, return a 404 if failed try: fileHandle = open(filePath, 'r') except IOError: raise Http404() # Return the file return

Load Template without rendering/parsing

2015-03-16 Thread Guilherme Leal
Hello! Anyone knows a way to load a template file WITHOUT parsing/rendering it? To ilustrate a bit more: I have a django app serving a restfull api, and everithing is just fine with it. The front end that consumes this api, is an Angular.js single page app. To centralize the routing logic, what

Re: Django multiple application with common users

2015-03-16 Thread Raphael Michel
Hi, Am Mon, 16 Mar 2015 01:23:22 -0700 (PDT) schrieb Domagoj Kovač : > I would like to have separate databases for every application > including user management. I can think of: (a) You put all the application in the same database and share a user model (look up 'reusable django apps') (b) You

Re: Django 1.7 issue

2015-03-16 Thread James Schneider
Can you please paste in a copy of your urls.py file that is referenced in the error? -James On Mar 16, 2015 1:21 AM, "Piyush Sharma" wrote: > i was following the django 1.7 documentation and having issue in creating > an app part 3 > please help > > TypeError at /polls/34/results/ > > 'function'

Message from David about views

2015-03-16 Thread Daniele Procida
Yesterday I accidentally rejected a message from a new user called David about views. Unfortunately Google Groups gives us no logs of any kind, so I have no way of correcting the error or contacting David. So David: if you're reading this, please try sending your message again, and sorry for t

Django multiple application with common users

2015-03-16 Thread Domagoj Kovač
Hi everybody, I have a question. I am working on a series of small home apps for me and my family. I have application like: - cost management - application where i track all my income and costs - market research - application that i use for market researc - food management - applicatio

Django 1.7 issue

2015-03-16 Thread Piyush Sharma
i was following the django 1.7 documentation and having issue in creating an app part 3 please help TypeError at /polls/34/results/ 'function' object has no attribute '__getitem__' Request Method:GETRequest URL:http://127.0.0.1:8000/polls/34/results/Django Version:1.9Exception Type:TypeErrorEx