Re: Specific models without a database table

2011-08-22 Thread bruno desthuilliers
On 20 août, 03:33, Kristofer Pettijohn wrote: > Hello, > > Is it possible to create specific models without a database table? Depends on your definition of "models". If you mean "django.db.Model" subclasses, nope - this part is nothing but a layer between your app and the database. Now you can o

Re: Specific models without a database table

2011-08-22 Thread bruno desthuilliers
On 20 août, 12:51, Malcolm Box wrote: > On 20 August 2011 02:33, Kristofer Pettijohn wrote: > > > Hello, > > > Is it possible to create specific models without a database table? > > Yes, it's possible. You want the "managed" attribute on the model - > seehttps://docs.djangoproject.com/en/1.3/ref/

Re: Specific models without a database table

2011-08-21 Thread Kristofer Pettijohn
> That is substantially harder, but could be possible. The main problem is that > the Django ORM will want to write SQL queries when there's a link to the > EmailAccount model. > > Your best bet is probably a proxy model that contains a reference to the > relevant API record (e.g. the email add

Re: Specific models without a database table

2011-08-21 Thread Kristofer Pettijohn
From: sedl...@gmail.com To: "Django users" Sent: Saturday, August 20, 2011 11:44:33 AM Subject: Re: Specific models without a database table Hi, you may use custom model manager (responsible for retrieving objects from DB) and custom save method (which would not call Model.save), t

Re: Specific models without a database table

2011-08-20 Thread sedl...@gmail.com
Hi, you may use custom model manager (responsible for retrieving objects from DB) and custom save method (which would not call Model.save), together with managed=True. You may still face some issues, however I think this should be possible. Cheers, Filip On 20 srp, 12:51, Malcolm Box wrote: > O

Re: Specific models without a database table

2011-08-20 Thread Malcolm Box
On 20 August 2011 02:33, Kristofer Pettijohn wrote: > Hello, > > Is it possible to create specific models without a database table? > > Yes, it's possible. You want the "managed" attribute on the model - see https://docs.djangoproject.com/en/1.3/ref/models/options/#managed This will prevent Djang