[web2py] Re: Get Date and Time from db

2015-11-07 Thread Garry Smith
On Friday, 6 November 2015 14:35:10 UTC, Garry Smith wrote: > > > Hi > Thanks for your replies, is something I'm doing at work, so will take a look Monday. G Smith > > I'm trying to something rarely simple, but I'm not getting the results > what are in

[web2py] Get Date and Time from db

2015-11-06 Thread Garry Smith
Hi I'm trying to something rarely simple, but I'm not getting the results what are in the database. I have a Date field which puts in the current time stamp eg 2015-11-06 11:58:02, but when retrived I get 2015-11-06, so its just bringing back the date and not the time and date. Confused need h

[web2py] Re: Putting time in a string

2015-11-05 Thread Garry Smith
Thanks for your reply. The problem was when I put ip = str(request.client), when I took away str(), it the gave me correct ip address. Thanks again. G Smith On Wednesday, 4 November 2015 22:38:17 UTC, Dave S wrote: > > > > On Wednesday, November 4, 2015 at 7:13:16 AM UTC-8,

[web2py] Re: Putting time in a string

2015-11-04 Thread Garry Smith
Hi Thanks for the reply, the session.time was left in my mistake, I tried it without the session and it still gave me the same error, I have tried your suggestion and is working. The only problem I am having know is the request.client is sending a ip of 127.0.0.1, which ever client pc I use. Thi

[web2py] Putting time in a string

2015-11-04 Thread Garry Smith
H i I am trying to put the current time in a email message using the following:- Enter code here...def index(): import datetime ip = str(request.client) t = str(datetime.datetime.today()) form = SQLFORM.factory( Field('name', requires=IS_NOT_EMPTY()), Fiel

Re: [web2py] Setting up database table with date.

2015-10-22 Thread Garry Smith
for your reply. On Thursday, 22 October 2015 07:40:43 UTC+1, Johann Spies wrote: > > > > On 20 October 2015 at 14:16, Garry Smith > > wrote: > >> group and stop receiving emails from it, send an email to >> web2py+un...@googlegroups.com . >> For more opt

[web2py] Setting up database table with date.

2015-10-20 Thread Garry Smith
Hi I have the following defining my DB tables:- db.define_table('school_students', Field('first_name', 'string',requires=IS_NOT_EMPTY()), Field('surname', 'string',requires=IS_NOT_EMPTY()), Field('year', 'string',requires=IS_NOT_EMPTY()), Field('form', 'string',requires=IS_NOT_EMP

[web2py] Re: returning data to web page div

2015-03-27 Thread Garry Smith
, March 27, 2015 at 2:12:29 PM UTC-5, Garry Smith wrote: >> >> Hi >> At last I have got the divs working as I wnated. >> >> The idea was to have 6 columns on a web page, 3 on the top row and three >> on the bottom. >> >> The top row add divs with art

[web2py] Re: returning data to web page div

2015-03-27 Thread Garry Smith
atabase is deleted and the new albums are inserted bringing back again. I have done this with all the divs. The next part is to get a media player to load the playlist and play the files. I would like to thank Anthony, Dave S and LoveWeb2py for pointing me in the right direction of using LO

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-26 Thread Garry Smith
Hi After testing, and getting the data to load Via {{=LOAD('default','test.load',ajax=True)}} When loading the page I get the updated results as required, but it says in the doc Web2py Doc , that "The DIV content is refr

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-24 Thread Garry Smith
Thanks for all your replies, will take a look at this and see if it will work for what I'm trying to do. Thanks again On Tuesday, 24 March 2015 01:59:09 UTC, Dave S wrote: > > > > On Monday, March 23, 2015 at 6:44:15 PM UTC-7, Dave S wrote: >> >> [...] >> > Looking again at >> > http://www.web

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Garry Smith
s-and-plugins#Components--LOAD-and-Ajax > > On Monday, March 23, 2015 at 12:19:34 PM UTC-4, LoveWeb2py wrote: >> >> Wouldn't a LOAD/Ajax combo work better in this case and then just include >> it in your page? >> >> On Monday, March 23, 2015 at 8:41:18 AM UTC-4

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Garry Smith
TABLE object and return that. > > Anthony > > On Saturday, March 21, 2015 at 8:17:06 PM UTC-4, Garry Smith wrote: >> >> Hi with your help I have manage to get the links working using the >> following code:- >> >> def artist(): >> >> row

[web2py] Retuning onclick from controller

2015-03-22 Thread Garry Smith
Hi is their a way of returning an onclick funtion to a div. This is what I'm trying to return. onclick="jQuery('#id').val('{{=row.id}}');ajax('{{=URL('default', 'album')}}', ['id'], 'playlist');"row.album. I can get it to return but only as text, I need it to work as a function This is what I

[web2py] Links dissapear when clicked

2015-03-22 Thread Garry Smith
Hi I have some links in a div which are created using the following:- *Controller* rows= sel.select(db.media.album,db.media.id, groupby= db.media.album,orderby=db.media.album) inks = map(lambda row:A(row.album, callback=URL('tracks',vars=dict(id=row.id)), target='playlist'), rows) test = UL([LI

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-21 Thread Garry Smith
get='album'), rows) test = UL([LI(link) for link in links]).xml() return test This now returns the links in a list. Would off like it in a table, but it only returns first record, not sure how I could itterate to return the table rows. Thanks again On Saturday, 21 March 2015

[web2py] Re: returning data to web page div

2015-03-21 Thread Garry Smith
links.append(f) table = TABLE(THEAD(TR(*[B(header) for link in links))) table["_class"] = "table table-striped table-bordered table-condensed" return (table) On Saturday, 21 March 2015 18:19:02 UTC, Garry Smith wrote: > > Hi > I'm trying to return the some

[web2py] returning data to web page div

2015-03-21 Thread Garry Smith
Hi I'm trying to return the some links to a div. I have made links with some information from the database and using the A htlm helper. The problem I am having is getting the data back correctly, I am getting the links back correctly, but I am being sent a full web page with the links, which is

[web2py] Re: Adding id to URL in HTML helper callback

2015-03-15 Thread Garry Smith
I've found a solution using the following:- {{ for row in rows: a =results?id= b = str(row.id) c = a + b }} {{=A('click' , callback=URL(c), target="flash")}} {{pass}} On Sunday, 15 March 2015 21:38:23 UTC, Garry Smith wrote: > Is there a way of adding a id n

[web2py] Adding id to URL in HTML helper callback

2015-03-15 Thread Garry Smith
Is there a way of adding a id number from a database in the following callback? {{=A('click me', callback=URL('results?id='))}}ing:- This is what I want to do, but cannot get it to work,not sure if its possible. I just want to add row.id to the end of the url. {{for row in rows}} {{=A('click

[web2py] Refresh page after running jquery

2015-03-14 Thread Garry Smith
Hi I 'm running the following code which inserts a user into a room for registration. Every thing works fine. I have a table on the same page which shows the results, I need the page to refresh to show updated results after the code below has run, is their a way of doing this? Controllerdef r

[web2py] Re: db query

2015-03-09 Thread Garry Smith
_type="button", _name="proms%d" % (index), > _value=addy, >_onclick='ajax("promotes.load", > ["addy","hname", "derby"], "my_promotions")', >

[web2py] Re: db query

2015-03-09 Thread Garry Smith
efault/chapter/29/06/the-database-abstraction-layer >> >> -Jim >> >> >> >> >> >> >> On Monday, March 9, 2015 at 8:31:13 AM UTC-5, Garry Smith wrote: >>> >>> I'm new to web2py, but do have a php and mysql background usin

[web2py] Re: db query

2015-03-09 Thread Garry Smith
k like? > > Also, this chapter should be helpful: > http://web2py.com/books/default/chapter/29/05/the-views > > -Jim > > On Monday, March 9, 2015 at 8:56:38 AM UTC-5, Garry Smith wrote: >> >> Hi Thanks for the reply, >> >> I have got query 2 working with

[web2py] Re: db query

2015-03-09 Thread Garry Smith
our time and > should help with most of your questions. > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer > > -Jim > > > > > > > On Monday, March 9, 2015 at 8:31:13 AM UTC-5, Garry Smith wrote: >> >> I'm new to web2py

[web2py] db query

2015-03-09 Thread Garry Smith
I'm new to web2py, but do have a php and mysql background using codeigniter. I'm trying to write a couple of queries but sure how to do them. These are the queries I'm trying to write, query1 SELECT user.s_name, user.f_name, user.year, pe.date, pe.sport, pe.id FROM user INNER JOIN pe ON user.user

[web2py] Import from MySQL

2014-02-06 Thread Garry Smith
HI I have just started using web2py, but have used MVC in other programming languages, the problem I have gaot is importing a db from MySQL. I use the script in the scripts folder for extracting from MySQL, which worked fine. When I added to web2py, most of the tables work fine, but one table