Re: Date() in Django query

2016-06-14 Thread Simon Charette
Hi Galil, In the next version of Django (1.10) you'll be able to use the TruncDate expression[1] for this exact purpose: MyModel.objects.annotate(join_date=TruncDate('join_time')).values_list('join_date', flat=True) In the mean time you can simply use a Func expression[2]: MyModel.objects.an

Re: How to copy data from one server (mysql) to another server(mysql) on regular basis. Need to replicate data

2016-06-14 Thread James Schneider
On Tue, Jun 14, 2016 at 8:30 AM, sushovan majumdar wrote: > Hello, > I have to move data from database server to new database server. Schema is > same for both. > I want to write a cron job which would keep replicating data from old > server to newer one. > In future I will throw away the old dat

Re: How to copy data from one server (mysql) to another server(mysql) on regular basis. Need to replicate data

2016-06-14 Thread Mc. Holid
i think it would be able to be handle by generating syncronisation script with sql yog and run the script from linux cron, or by using the events if you use mysql as the db On Tuesday, June 14, 2016 at 10:30:40 PM UTC+7, sushovan majumdar wrote: > > Hello, > I have to move data from database se

Re: Absolute beginner step by step

2016-06-14 Thread Mc. Holid
Dear All It seem this is the best starting guide for me, Just one to ask about the tips and trick how do you deal with the so many "unknown syntax", some time we have to use this ' character some time use ", then mention the name of a database field followed with array. Could anyone suggest f

Re: Date() in Django query

2016-06-14 Thread Stephen J. Butler
Assuming "obj" is an instance of a Model class for this table: obj.jointime.date() On Tue, Jun 14, 2016 at 8:52 AM, Galil wrote: > Hi, > > How can I convert this SQL query into a Django query? > > SELECT DATE(JoinTime) FROM table > > Please keep in mind that JoinTime is in datetime format and I

Re: Display of user model extension in admin

2016-06-14 Thread Larry Martell
On Tue, Jun 14, 2016 at 10:52 AM, Larry Martell wrote: > On Mon, Jun 13, 2016 at 4:12 PM, Larry Martell > wrote: >> I have extended the user model to another table I called UserInfo, and >> I added it to the add user admin page. >> >> So now when I go to add a user I see this on the page: >> >>

How to copy data from one server (mysql) to another server(mysql) on regular basis. Need to replicate data

2016-06-14 Thread sushovan majumdar
Hello, I have to move data from database server to new database server. Schema is same for both. I want to write a cron job which would keep replicating data from old server to newer one. In future I will throw away the old database server. I was looking into database routers in django to achie

Re: Display of user model extension in admin

2016-06-14 Thread Larry Martell
On Mon, Jun 13, 2016 at 4:12 PM, Larry Martell wrote: > I have extended the user model to another table I called UserInfo, and > I added it to the add user admin page. > > So now when I go to add a user I see this on the page: > > User Info > User Info: #1 > > If I edit a user that exists I see: >

Date() in Django query

2016-06-14 Thread Galil
Hi, How can I convert this SQL query into a Django query? SELECT DATE(JoinTime) FROM table Please keep in mind that JoinTime is in datetime format and I want it to be date. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr