Re: Model or Form class

2016-03-12 Thread Tony Flury
You can use forms.Form when you want to build a custom form which isn't directly connected to a model on the database. For instance one use for a forms.Form is where you are collecting data which will be stored into attributes on different models. The documentation I think uses forms.ModelForn

Re: Showing BooleanField checkbox on left

2016-01-15 Thread Tony Flury
On Thursday, 14 January 2016 17:55:41 UTC, Sayse wrote: > > Yea I've heard of it. Have they managed to achieve this? I'd be interested > to see how they've done it if so... > > I was hoping to find a way to do this with native django if possible > One way that might work is to subclass the Ch

Re: why cannot delete attribute id of model?

2016-01-11 Thread Tony Flury
Stating the value of either the id or pk field to None is the recommended way to rest the primary key when you take a copy of a record, but Xudong wanted to delete the field entirely: which I don't understand. -- You received this message because you are subscribed to the Google Groups "Djang

Re: why cannot delete attribute id of model?

2016-01-11 Thread Tony Flury
Why do you want to delete the id field. The idea of a primary key field is central to relational databases. If you to suppress the automatically generated primary key then you need to assign another field as the unique primary key: as far as I know that will prevent the id field being created.

Re: Execute code which runs on the database only when the server is running - and doesn't need users to view pages.

2016-01-11 Thread Tony Flury
Andreas, Thanks for your answer. Certainly it looks like running celery might alleviate the issue with threading stopping the management commands, but the problem with your suggestion lies with that flag. If My code was able to identify that the server is running to the point of being able to s

Execute code which runs on the database only when the server is running - and doesn't need users to view pages.

2016-01-11 Thread Tony Flury
I have a small background task (executed by using threading.Timer) which I want to start up when the server starts, but doesn't need to start when a management command runs. The background task performs operations on the database, so relies on importing the models etc. I have tried using the A