Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 March 24, 2008 02:52:55

j.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Python using django framework


hi, i'm using django framework. but now i'm facing some problem... i want to
check if the system time is the same with the time that user input? i don't
know how to do it in django framework... but i'm sure in VB, php or
something just like this

if date() = "07:00" then
bootds
end if

just now i try this code

{% ifequal now "H:i" settings.temptime %}
aaa
{% endifequal %}

and one more thing, i have a module in models.py to wake on lan... so what
i'm trying to do is, make some schedulling program... to auto start the
client computer and auto shut down that computer... on specific time... so i
need to check if the system time is the same with the time that user
specific, then call the module in models.py..

anyone can help i even don't know how to call module in django
--
View this message in context:http://www.nabble.com/Python-using-django-framework-tp16173503p16173503.htmlSent from the django-users mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 24, 2008 03:48:05

Mike H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Python using django framework


Hi,

Dates are a little confusing at first when you come to python from VB
or PHP. In python, a date is not a string, but an object. Here's some
example code :

import datetime

now = datetime.datetime.now()

some_date = datetime.datetime(2008,1,1,0,0)

if now == some_date:
they were the same

I'm guessing that your date in settings is a string, rather than a
datetime object.

Check out the python docs on datetime athttp://docs.python.org/lib/datetime-datetime.htmlHope that helps,

Mike


On 24 Mar 2008, at 01:52, julichrist wrote:
>
>
> hi, i'm using django framework. but now i'm facing some problem... i
> want to
> check if the system time is the same with the time that user input?
> i don't
> know how to do it in django framework... but i'm sure in VB, php or
> something just like this
>
> if date() = "07:00" then
> bootds
> end if
>
> just now i try this code
>
> {% ifequal now "H:i" settings.temptime %}
> aaa
> {% endifequal %}
>
> and one more thing, i have a module in models.py to wake on lan...
> so what
> i'm trying to do is, make some schedulling program... to auto start
> the
> client computer and auto shut down that computer... on specific
> time... so i
> need to check if the system time is the same with the time that user
> specific, then call the module in models.py..
>
> anyone can help i even don't know how to call module in django
> --
> View this message in context:
>http://www.nabble.com/Python-using-django-framework-tp16173503p16173503.html> Sent from the django-users mailing list archive at Nabble.com.
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 March 24, 2008 03:50:58

Bruno T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Python using django framework


Hi man!

I'm not sure if I understood you right, can you specify your needs a little
more?

I mean, I'm not exactly sure if Django is the besst tool for you. Probably,
Python already has everything you need.

Regards,

Tkmhttp://djangopeople.net/brunotikami/On Sun, Mar 23, 2008 at 10:52 PM, julichrist <> wrote:

>
>
> hi, i'm using django framework. but now i'm facing some problem... i want
> to
> check if the system time is the same with the time that user input? i
> don't
> know how to do it in django framework... but i'm sure in VB, php or
> something just like this
>
> if date() = "07:00" then
> bootds
> end if
>
> just now i try this code
>
> {% ifequal now "H:i" settings.temptime %}
> aaa
> {% endifequal %}
>
> and one more thing, i have a module in models.py to wake on lan... so what
> i'm trying to do is, make some schedulling program... to auto start the
> client computer and auto shut down that computer... on specific time... so
> i
> need to check if the system time is the same with the time that user
> specific, then call the module in models.py..
>
> anyone can help i even don't know how to call module in django
> --
> View this message in context:
>http://www.nabble.com/Python-using-django-framework-tp16173503p16173503.html> Sent from the django-users mailing list archive at Nabble.com.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#4 March 24, 2008 04:02:28

didia l.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Python using django framework


Hi...actually i want to do some schedulling things for my new project... I'm
newbie here... My schedulling function is.. to automatically start/wake up the
computer at 7am and automatically shut down the computer at 9pm... do you have
any suggestion.. or is there any module that i can use from django?

Now, i'm trying to do is refresh the webpage every 10seconds.. and check server
time is it 7am yet? if yes... then start the computer... (using magic packet
for wake on lan) the same with the shutdown.. but i don't know is it working or
not..

help plis :(

----- Original Message ----
From: Bruno Tikami <>
To: django-users@googlegroups.com
Sent: Sunday, March 23, 2008 7:50:44 PM
Subject: Re: Python using django framework

Hi man!

I'm not sure if I understood you right, can you specify your needs a little
more?

I mean, I'm not exactly sure if Django is the besst tool for you. Probably,
Python already has everything you need.

Regards,

Tkmhttp://djangopeople.net/brunotikami/On Sun, Mar 23, 2008 at 10:52 PM, julichrist <> wrote:


hi, i'm using django framework. but now i'm facing some problem... i want to
check if the system time is the same with the time that user input? i don't
know how to do it in django framework... but i'm sure in VB, php or
something just like this

if date() = "07:00" then
bootds
end if

just now i try this code

{% ifequal now "H:i" settings.temptime %}
aaa
{% endifequal %}

and one more thing, i have a module in models.py to wake on lan... so what
i'm trying to do is, make some schedulling program... to auto start the
client computer and auto shut down that computer... on specific time... so i
need to check if the system time is the same with the time that user
specific, then call the module in models.py..

anyone can help i even don't know how to call module in django
--
View this message in context:http://www.nabble.com/Python-using-django-framework-tp16173503p16173503.htmlSent from the django-users mailing list archive at Nabble.com.
















____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.http://tools.search.yahoo.com/newsearch/category.php?category=shopping--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support