[web2py] Re: Keeping track of changes

2013-03-04 Thread Niphlod
http://web2py.com/books/default/chapter/29/06#Record-versioning

On Tuesday, March 5, 2013 2:55:03 AM UTC+1, rh wrote:
>
> On Mon, 4 Mar 2013 06:47:55 -0800 (PST) 
> Kenneth > 
> wrote: 
>
> > Hi, 
> > 
> > more questions on my book application. 
> > 
> > There is let's say 20 books, all containing about 10 chapters and 
> > then maybe 5 articels per chapter. 
> > 
> > Every article is its own item in a table. When everything is ready 
> > all articles are looked and published. When it is time to upgrade the 
> > articles I'm planing on making new copies of them articles in the 
> > database and use that one when the upgraded book is released. How 
> > would you do keep track of changes in the edited article? All changes 
> > needs to be moved into the printed version. 
>
> Revision control is a large topic.  Is your goal to create a revision 
> control 
> system in a database? There are already many revision control systems 
> available. You might save yourself much time/effort to use one that 
> is already in wide use. Mercurial, git, bazaar, etc. are three examples 
> that are popular and allow distributed development/contribution. 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Problem with smartgrid no GUI Bread Crums or missing buttons for links

2013-03-04 Thread Niphlod
a) missing css files
b) you're probably using the generic view and returning dict(grid=grid, 
)

On Tuesday, March 5, 2013 4:06:17 AM UTC+1, Dan Kozlowski wrote:
>
> Does anyone have this same problem with a smart grid ? Running on Linux.  
> Thanks
>
> 1.) the word grid is show to the right of the grid
> 2.) No boxes for Bread Crums
> 3.) No buttons for external links just text to the link
>
>
>
> Daily Count View 
> grid:
>
>- Daily 
> countses
>>
>- 
> 8
>>
>- Histories for Add Date 
> Dc
>
> 1 records found
> Add 
> DateEncrypt
>  
> CountDecrypt
>  
> CountError
>  
> CountCycle
>  
> CountDirectory
>  
> Create 
> CountClient
>  
> Add 
> Count
> Id
> View
> Export:CSVCSV
>  
> (hidden 
> cols)
> HTML
> JSONTSV
>  
> (Excel 
> compatible)TSV
>  
> (Excel compatible, hidden 
> cols)
> XML
>  

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: GAE Hosting Issue

2013-03-04 Thread Philip Kilner

Hi Christian,

On 05/03/13 06:12, Christian Foster Howes wrote:

hrmmaybe it's time for GAE's next code update.  i frequently notice
a degradation in performance just before they announce a new SDK version.



Interesting observation - will look out for that.


i'm not seeing anything out of the ordinary on my GAE apps right now,
but i do agree that the GAE team is not as transparent as i would like.

i would suggest that you read the logs very carefully - there are lots
of different deadlineexceeded exceptions (literally the same class names
with different paths) and try adding extra logging to see where things
are getting stuck.



Actually, I'm not getting past a db connection so there is nothing in my 
application code to log, and the logged errors accessible in the console 
are very, very varied [1].



i don't know if web2py does automatic migrations on cloudsql, and in
production i always do my SQL by handbut i'm old school and pessimistic.



It does - I did have a failed migration (how I wish their CloudSQL 
offering was based on Postgres!), but the app was buzzing away happily 
with the help of "fake_migrate_all" for a good while after that.


The migration issues is messier than I'd like it to be on the this 
platform (CloudSQL being as fragile as MySQL in that regard, and the 
problem being compounded for me by the lack of tickets and my 
uncertainty as to the fix given that the pickles are in the problem db).


I think perhaps that I too need to take an "old school and pessimistic" 
approach on this platform (and MySQL in general for that matter).


BTW, in case anyone wonders why I'm using "fake_migrate_all" rather than 
a per-table approach, it's because the error I was responding to 
refereed to my (unmodified) auth_user table - I've simply not been able 
to get in to revert that since this happened.



[1] https://code.google.com/p/googleappengine/issues/detail?id=8918

--

Regards,

PhilK


e: p...@xfr.co.uk - m: 07775 796 747

'work as if you lived in the early days of a better nation'
- alasdair gray

--

--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: GAE - Datastore and CloudSQL together

2013-03-04 Thread Philip Kilner

Hi Christian,

On 05/03/13 06:07, Christian Foster Howes wrote:

ahh, the connection stuff is in the book:

 #store sessions in the DB
 session.connect(request,response,db = db)

http://web2py.com/books/default/chapter/29/13#Avoid-the-filesystem



D'Oh!

Thanks for the pointer - will go and look again, and see if I can 
resolve how to point the the ticket and web2py_filesystem tables to the 
datastore.



--

Regards,

PhilK


'a bell is a cup...until it is struck'

--

--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: GAE Hosting Issue

2013-03-04 Thread Christian Foster Howes
hrmmaybe it's time for GAE's next code update.  i frequently notice a 
degradation in performance just before they announce a new SDK version.

i'm not seeing anything out of the ordinary on my GAE apps right now, but i 
do agree that the GAE team is not as transparent as i would like.

i would suggest that you read the logs very carefully - there are lots of 
different deadlineexceeded exceptions (literally the same class names with 
different paths) and try adding extra logging to see where things are 
getting stuck.

i don't know if web2py does automatic migrations on cloudsql, and in 
production i always do my SQL by handbut i'm old school and pessimistic.

cfh

On Monday, March 4, 2013 10:00:02 PM UTC-8, Philip Kilner wrote:
>
> Hi, 
>
> On 05/03/13 02:05, howesc wrote: 
> > i'm no longer using cloudSQL as i don't need it anymorebut several 
> > months ago when i was using it i got weird and varied problems on GAE 
> > when i had exceeded my billing quota on could SQL.  have you checked 
> > that those SQL instances are running and billing up to date? 
> > 
>
> I do have billing enabled, but am currently on a (temporarily) free D0 
> instance. Interesting that the problem kicked in less than an hour after 
> the start of the month though... 
>
> Having said that, I'm able to access the db perfectly via dbVisualiser 
> to work with it directly. 
>
> The majority of the errors suggest it is running out of time or 
> resources before it ever makes a db connection. 
>
> However, tinkering with a 2nd (empty) db against the same app it did 
> briefly burst into life, which made me wonder whether a failed migration 
> earlier in the day was involved. I can't see it really, because it never 
> seems to get as far as a connection with the production db. 
>
> This is in part the reason for my other question about using the 
> datastore form web2py's "system" stuff - I found myself wondering how 
> e.g. "fake_migrate_all" could work if the pickles were in the affected db. 
>
> I have to say, Google seem to be in denial about some of the issues on 
> GAE - some people (mostly but not exclusively on Java) have recently 
> suffered non-trivia performance / latency / timeout issues, and the 
> silence from the App Engine team is deafening... 
>
>
> -- 
>
> Regards, 
>
> PhilK 
>
>
> e: ph...@xfr.co.uk  - m: 07775 796 747 
>
> 'work as if you lived in the early days of a better nation' 
> - alasdair gray 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: GAE - Datastore and CloudSQL together

2013-03-04 Thread Christian Foster Howes
ahh, the connection stuff is in the book:

#store sessions in the DB
session.connect(request,response,db = db) 

http://web2py.com/books/default/chapter/29/13#Avoid-the-filesystem

On Monday, March 4, 2013 9:50:02 PM UTC-8, Philip Kilner wrote:
>
> Hi, 
>
> On 05/03/13 02:02, howesc wrote: 
> > at one point i was running both together.  i did something like: 
> > 
> > db =  
> > sqldb =  
> > 
>
> Got it - had tied that, but... 
>
> > and then connected tickets and such to db. 
> > 
>
> ...could not work out how to point these "system" tables at the 
> alternate DB, given that they are not explicitly defined in the model. 
>
>
> -- 
>
> Regards, 
>
> PhilK 
>
>
> 'a bell is a cup...until it is struck' 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: GAE Hosting Issue

2013-03-04 Thread Philip Kilner

Hi,

On 05/03/13 02:05, howesc wrote:

i'm no longer using cloudSQL as i don't need it anymorebut several
months ago when i was using it i got weird and varied problems on GAE
when i had exceeded my billing quota on could SQL.  have you checked
that those SQL instances are running and billing up to date?



I do have billing enabled, but am currently on a (temporarily) free D0 
instance. Interesting that the problem kicked in less than an hour after 
the start of the month though...


Having said that, I'm able to access the db perfectly via dbVisualiser 
to work with it directly.


The majority of the errors suggest it is running out of time or 
resources before it ever makes a db connection.


However, tinkering with a 2nd (empty) db against the same app it did 
briefly burst into life, which made me wonder whether a failed migration 
earlier in the day was involved. I can't see it really, because it never 
seems to get as far as a connection with the production db.


This is in part the reason for my other question about using the 
datastore form web2py's "system" stuff - I found myself wondering how 
e.g. "fake_migrate_all" could work if the pickles were in the affected db.


I have to say, Google seem to be in denial about some of the issues on 
GAE - some people (mostly but not exclusively on Java) have recently 
suffered non-trivia performance / latency / timeout issues, and the 
silence from the App Engine team is deafening...



--

Regards,

PhilK


e: p...@xfr.co.uk - m: 07775 796 747

'work as if you lived in the early days of a better nation'
- alasdair gray

--

--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: GAE - Datastore and CloudSQL together

2013-03-04 Thread Philip Kilner

Hi,

On 05/03/13 02:02, howesc wrote:

at one point i was running both together.  i did something like:

db = 
sqldb = 



Got it - had tied that, but...


and then connected tickets and such to db.



...could not work out how to point these "system" tables at the 
alternate DB, given that they are not explicitly defined in the model.



--

Regards,

PhilK


'a bell is a cup...until it is struck'

--

--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: SQLFORM.widgets.autocomplete on a field in a keyed table. MSSQL

2013-03-04 Thread Dmitry Mosin
вторник, 5 марта 2013 г., 4:34:44 UTC+6 пользователь Massimo Di Pierro 
написал:
>
> Problem is that you are passing db.m_dsc_cards_copy as second argument and 
> it is a Table. It expects a Field.
>
>  
Oh, I was not attentive
(However, it works for non-keyed tables)


Thank you Massimo!
 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Problem with smartgrid no GUI Bread Crums or missing buttons for links

2013-03-04 Thread Dan Kozlowski
Does anyone have this same problem with a smart grid ? Running on Linux.  
Thanks

1.) the word grid is show to the right of the grid
2.) No boxes for Bread Crums
3.) No buttons for external links just text to the link



Daily Count View 
grid:

   - Daily 
countses
   >
   - 
8
   >
   - Histories for Add Date 
Dc

1 records found
Add 
DateEncrypt
 
CountDecrypt
 
CountError
 
CountCycle
 
CountDirectory
 
Create 
CountClient
 
Add 
Count
Id
View
Export:CSVCSV
 
(hidden 
cols)
HTML
JSONTSV
 
(Excel 
compatible)TSV
 
(Excel compatible, hidden 
cols)
XML
 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: GAE Hosting Issue

2013-03-04 Thread howesc
i'm no longer using cloudSQL as i don't need it anymorebut several 
months ago when i was using it i got weird and varied problems on GAE when 
i had exceeded my billing quota on could SQL.  have you checked that those 
SQL instances are running and billing up to date?

On Monday, March 4, 2013 3:31:22 AM UTC-8, Philip Kilner wrote:
>
> Hi All, 
>
> I'm developing an app on GAE which has suddenly stopped serving, and 
> just wanted to sanity check that other web2py users were not seeing the 
> same thing. 
>
> The app uses Python 2.7, HRD and CloudSQL. It's a relatively simple 
> transactional CRUD app - nothing clever at all from the GAE PoV. 
>
> It stopped serving out of the blue (overnight), twelve hours after the 
> last deploy, and the error messages it's throwing are very varied - 
> "soft memory limit exceeded" (bumped instances from F1 to F2, same 
> error, bigger numbers), "deadline exceeded" (setting up loggers or db 
> connections) etc. never get as far as my code. 
>
> The lack of changes in the app prior to the outage, the essentially 
> random nature of the error messages (all of which suggest GAE is running 
> out of time or resources in a variety of interesting ways), suggest to 
> me that this is a GAE infrastructure problem, but I've yet to find 
> anyone else definitively bitten by the same thing (although there is a 
> lot of grumbling in the GAE forums about high latency). 
>
> I've raised a production issue [1], so far with no response, and have 
> moved the app off GAE so that I can carry on working, so the pressure is 
> off. 
>
> Has anyone else using this combination of GAE facilities (and especially 
> CloudSQL) experienced anything similar? 
>
> FWIW, my (relatively trivial) apps running purely on the normal HRD 
> data-store are running fine. 
>
>
> [1] https://code.google.com/p/googleappengine/issues/detail?id=8918 
>
> -- 
>
> Regards, 
>
> PhilK 
>
>
> e: ph...@xfr.co.uk  - m: 07775 796 747 
>
> 'work as if you lived in the early days of a better nation' 
> - alasdair gray 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: GAE - Datastore and CloudSQL together

2013-03-04 Thread howesc
at one point i was running both together.  i did something like:

db = 
sqldb = 

and then connected tickets and such to db.

cfh

On Monday, March 4, 2013 8:24:44 AM UTC-8, Philip Kilner wrote:
>
> Hi, 
>
> Is there a way to use the datastore for the session, filesystem and 
> ticket tables, whilst using CloudSQL for the actual db? 
>
> Also, having migrated from the datastore to CloudSQL, I am no longer 
> getting tickets saved in either - is there anything obvious I can look 
> into there? (In the absence of tickets, I have no idea what to look for!) 
>
>
> -- 
>
> Regards, 
>
> PhilK 
>
>
> 'a bell is a cup...until it is struck' 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: datetime - compare dates while ignoring time Part 2: Time Zones!

2013-03-04 Thread jjg0
Thanks Andrew, I was able to get this working for my current timezone using 
datetime and timedelta.  I'm still new at this so if anyone has a better 
way or can get this working for all users anywhere instead of just people 
in my time zone that would be awesome.  

On Monday, March 4, 2013 3:06:43 PM UTC-5, Andrew Evans wrote:
>
> Hi I did something I think which is similar
>
> you can get the current time based on time zone like this
>
> import datetime
> import pytz
> import time
>
> current_time = 
> datetime.datetime.now(pytz.timezone('US/Eastern')).replace(tzinfo=None)
>
> This allowed me to schedule videos to play at a given time
>
> Not sure this is what you need but maybe it helps :-)
>
> *cheers
>
> Andrew
>
> On Mon, Mar 4, 2013 at 11:57 AM, Niphlod  >wrote:
>
>> no, it's not possible. request.now is always calculated on the server, 
>> not on the client. That being said, the "today" on the server may not be 
>> the same today on the clients accessing your page from all the timezones in 
>> the world
>> e.g. if you're providing some kind of function based on THEIR timezone 
>> (i.e. "press this button to delete all your appointments today") you really 
>> need to start fiddling with UTC and timezone differences.
>>
>>
>> On Monday, March 4, 2013 7:08:23 PM UTC+1, jjg0 wrote:
>>>
>>> I had asked a question about comparing datetimes here: 
>>> https://groups.google.com/**forum/?fromgroups=#!topic/**
>>> web2py/2euU80vV2WE
>>> The question was answered but I ran into another problem closely 
>>> related, so I made a sequel.  Let's hope we don't have to suffer through a 
>>> trilogy!
>>>
>>> Here is what I am doing:
>>>
>>> I have a model of appointments with a field for the date:
>>>
>>> .
>>> .
>>> Field('appointment_date', 'date') 
>>> .
>>> .
>>>
>>> and a controller that should grab all of today's appointments to be 
>>> printed out:
>>>
>>> appointment_dates = db(db.appointments.**appointment_date==request.now.*
>>> *date()).select()
>>>
>>> Here is the problem:
>>>
>>> request.now.date() appears to get the time based on the server.  So If 
>>> the server is say 5 hours ahead, once 7:00pm my time hits I'm going to be 
>>> looking at tomorrows appointments.  (server hits midnight, day cycles but 
>>> I'm still 7:00pm yesterday)
>>>
>>> When the controller goes to grab the day's appontments, is it possible 
>>> to somehow replace request.now.date() with the date of the users pc?  
>>> Otherwise I'm not really sure how else to go about this problem.  
>>>
>>> Thanks
>>>
>>>
>>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I avoid 2 different users to run the same function at the same time?

2013-03-04 Thread Tito Garrido
Hi Ron,

Thanks for you response, I need this because I have a function that clear a
table, read a bunch of local files and import it into the database. I just
want to avoid 2 people cleaning the table or maybe people querying the
table while it is being updated...


On Mon, Mar 4, 2013 at 10:10 PM, Ron McOuat  wrote:

> One possibility is to use a lock file. Look for portalocker.py in the
> gluon directory and the Session class which uses portalocker.py for use.
> Needing this functionality should be rare, multiple requests run on
> different threads so no collisions in the controller should occur. The
> database should keep multiple requests separated. If I could ask what
> requires this maybe there is a better way than a lock file or a way to
> avoid the problem. Using a lock file can lead to serious contention
> depending on how many users and the duration of the lock.
>
> Ron
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How can I avoid 2 different users to run the same function at the same time?

2013-03-04 Thread Ron McOuat
One possibility is to use a lock file. Look for portalocker.py in the gluon 
directory and the Session class which uses portalocker.py for use. Needing this 
functionality should be rare, multiple requests run on different threads so no 
collisions in the controller should occur. The database should keep multiple 
requests separated. If I could ask what requires this maybe there is a better 
way than a lock file or a way to avoid the problem. Using a lock file can lead 
to serious contention depending on how many users and the duration of the lock.

Ron

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: datetime - compare dates while ignoring time Part 2: Time Zones!

2013-03-04 Thread jjg0
"That being said, the "today" on the server may not be the same today on 
the clients accessing your page from all the timezones in the world"

Maybe I wasn't clear in my question, but this is exactly the problem I am 
trying to solve.  I am trying to provide some kind of function based on 
their timezone..

So how can I use UTC and timezones to solve this problem?  Anytime I have a 
table full of stuff with a date field, how do I show a user, "here is 
today's stuff" without having to worry about the server showing the user 
tomorrow's stuff because of a few hours time difference?  I noticed 
request.now and request.utcnow by default both return the universal time, 
not my local time.  What are people doing to solve this problem, surely it 
has come up before?

On Monday, March 4, 2013 2:57:46 PM UTC-5, Niphlod wrote:
>
> no, it's not possible. request.now is always calculated on the server, not 
> on the client. That being said, the "today" on the server may not be the 
> same today on the clients accessing your page from all the timezones in the 
> world
> e.g. if you're providing some kind of function based on THEIR timezone 
> (i.e. "press this button to delete all your appointments today") you really 
> need to start fiddling with UTC and timezone differences.
>
>
> On Monday, March 4, 2013 7:08:23 PM UTC+1, jjg0 wrote:
>>
>> I had asked a question about comparing datetimes here: 
>> https://groups.google.com/forum/?fromgroups=#!topic/web2py/2euU80vV2WE
>> The question was answered but I ran into another problem closely related, 
>> so I made a sequel.  Let's hope we don't have to suffer through a trilogy!
>>
>> Here is what I am doing:
>>
>> I have a model of appointments with a field for the date:
>>
>> .
>> .
>> Field('appointment_date', 'date') 
>> .
>> .
>>
>> and a controller that should grab all of today's appointments to be 
>> printed out:
>>
>> appointment_dates = 
>> db(db.appointments.appointment_date==request.now.date()).select()
>>
>> Here is the problem:
>>
>> request.now.date() appears to get the time based on the server.  So If 
>> the server is say 5 hours ahead, once 7:00pm my time hits I'm going to be 
>> looking at tomorrows appointments.  (server hits midnight, day cycles but 
>> I'm still 7:00pm yesterday)
>>
>> When the controller goes to grab the day's appontments, is it possible to 
>> somehow replace request.now.date() with the date of the users pc?  
>> Otherwise I'm not really sure how else to go about this problem.  
>>
>> Thanks
>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How can I avoid 2 different users to run the same function at the same time?

2013-03-04 Thread Tito Garrido
Hi Folks,

I would like to avoid 2 different users to run the same function while the
it is already running.

Example:
User 1 is running my_function, while it is running, if User 2 tries to run
it the application should warn that it is already in execution

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Tito Garrido
Is SQLFORM.grid translatable now? :)

Thanks!

Tito


On Mon, Mar 4, 2013 at 5:07 PM, Niphlod  wrote:

> ps: version check fails because it expects
>
> version (date) stable/dev
>
> instead of the current format
>
> Version 2.4.2 (stable) 2013-03-04 03:26:21
>
>
> On Monday, March 4, 2013 5:13:34 PM UTC+1, Niphlod wrote:
>>
>> git tags are not published 
>> https://github.com/web2py/**web2py/tags.
>>  did you issue git push --tags ?
>>
>> On Monday, March 4, 2013 5:11:27 PM UTC+1, Massimo Di Pierro wrote:
>>>
>>> we are using hg tags, git tags, and semantic versioning.
>>>
>>> On Monday, 4 March 2013 01:50:31 UTC-6, Paolo valleri wrote:

 Good works, I will try it later today.
 I don't know if you have already discussed about that, just in case, I
 would suggest to start the use of git tags so it will be easier to update
 web2py and keep track of the different releases.

 Paolo

 On Monday, March 4, 2013 7:58:19 AM UTC+1, Massimo Di Pierro wrote:
>
> That is not the expected behavior.
> I will check what is going on but the more info you can provide the
> better.
>
>
> On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:
>>
>> So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I
>> click the 'Check for Upgrades' button in the admin dashboard, I get a
>> message 'Unable to check for upgrades' that replaces the button, and is a
>> link to web2py.com.
>>
>> Is that the expected behavior?
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Cannot label id field

2013-03-04 Thread François Delpierre
Thanks Derek and Richard.
I got it to work by using:
db.t_bsc.id.label=T('Service Code')

After the the table definition, instead of inside of it.
Thanks also for the id type. I was not aware of that type.

Thanks,

On Monday, 11 February 2013 20:43:24 UTC+1, Richard wrote:
>
>
>
> I just look again at the model of François and I think there is a mistake, 
> because id field should not be of type integer when you explicitly define 
> them in your model
>
> type='id' is the proper type, so maybe he has 2 differents columns named 
> id or his model doesn't really works.
>
> Ref.: http://web2py.com/books/default/chapter/29/06#DAL,-Table,-Field
>
> Richard
>
>
> On Mon, Feb 11, 2013 at 1:55 PM, Derek >wrote:
>
>> Seems to work for me.
>>
>> db.define_table('customers',
>> Field('name', 'string',length=50, requires=IS_NOT_EMPTY()),
>>...
>> Field('country','string',length=3),
>> Field('active','boolean'),format='%(name)s', singular='customer', 
>> plural='customers')
>> db.customers.id.label=T('TEST ID')
>>
>> On web2py 2.3.2
>>
>> On Saturday, February 9, 2013 3:42:50 AM UTC-7, François Delpierre wrote:
>>>
>>> Hi,
>>>
>>> Let's see the definition:
>>>
>>> db.define_table('t_bsc',
>>> Field('id', type='integer', label=T('Service Code')),
>>> Field('f_name', type='string',
>>>   label=T('Service name'),
>>>   comment=T('The name of the customer facing service as known to 
>>> your customer.')),
>>>
>>> But in my smartgrid, I still see the label Id instead of 'Service Code' 
>>> for the id field...
>>> Is this a bug?
>>>
>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How can I disable the delete confirmation in SQLFORM.grid ?

2013-03-04 Thread François Delpierre
Yes Anthony, I think such an option is missing, as usually you just want to 
disable that for few grids...

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to order by IP address? Or how to write an orderby function?

2013-03-04 Thread François Delpierre
Hi,

How can I orderby IP address?
Can I write my own sort function?
How?

The following code:
db.t_device2ip.f_ip_id.requires = IS_IN_DB(db,'t_ip.id','%(f_ip_addr)s: 
%(f_dns_name)s',multiple=False, orderby = 't_ip.f_ip_addr')

Sort as if IP was a string. (well in fact it is.. but that's not the result 
I want to see..)

Thanks,

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: SQLFORM.widgets.autocomplete on a field in a keyed table. MSSQL

2013-03-04 Thread Massimo Di Pierro
Problem is that you are passing db.m_dsc_cards_copy as second argument and 
it is a Table. It expects a Field.

On Monday, 4 March 2013 06:46:21 UTC-6, Dmitry Mosin wrote:
>
> Hello friends!
>
>
> When I try something like this
>
> ---
>
> db.define_table('m_dsc_cards_copy',
> Field('cardid','string',length=20,notnull=True,unique=True),
> migrate=False,
> fake_migrate=True,
> primarykey=['cardid']
> )
>
> db.define_table('m_dsc_clients',
> Field('cn','string'),
> Field('cardid','reference m_dsc_cards_copy.cardid',
>   widget = SQLFORM.widgets.autocomplete(request, 
> db.m_dsc_cards_copy, id_field=db.m_dsc_cards_copy.cardid, limitby=(0,20), 
> min_length=2, keyword='_autocomplete_cardid'),
>   ondelete="no action"),
> primarykey=['cn']
> )
>
>
>
> I've got an exception, 
>
> ---
>
>  'Table' object has no attribute 
> 'tablename'
>
> Frames
> File /var/www/py/web2py/gluon/restricted.py in restricted at line 212 
> File /var/www/py/web2py/applications/discount/models/db.py in  
> at line 57
> File /var/www/py/web2py/gluon/sqlhtml.py in __init__ at line 624 
> File /var/www/py/web2py/gluon/dal.py in __getitem__ at line 8256 
>
> Function argument list
> (self=, key='tablename')
>
>
> Code listing 
>
> 8251.
> 8252.
> 8253.
> 8254.
> 8255.
> 8256.
>
> 8257.
> 8258.
> 8259.
> 8260.
>
> return rows[0]
> return None
> elif str(key).isdigit() or 'google' in DRIVERS and isinstance(key, 
> Key):
> return self._db(self._id == key).select(limitby=(0,1)).first()
> elif key:
> return ogetattr(self, str(key))
>
>
> def __call__(self, key=DEFAULT, **kwargs):
> for_update = kwargs.get('_for_update',False)
> if '_for_update' in kwargs: del kwargs['_for_update']
>
>
>
>
>
>
> How can I resolve that?
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] parent child tree query logic

2013-03-04 Thread 黄祥
hi, 

i want to show parent child tree using table that have self-reference. 
actually i've tried the self-reference query, but the result is not i 
expected, is there any idea for this?

for example:
*db.py*
db.define_table('category',
Field('category', length=10, notnull=True, unique=True),
Field('parent', 'reference category'),
format='%(category)s')

db.category.parent.requires=IS_EMPTY_OR(IS_IN_DB(db, 'category.category'))

db.category.bulk_insert([{'category' : 'Monitor'}, 
 {'category' : 'Keyboard'},
 {'category' : 'Monitor LCD', 'parent' : '1'}, 
 {'category' : 'Monitor LED', 'parent' : '1'}, 
 {'category' : 'Keyboard Cable', 'parent' : '2'}, 
 {'category' : 'Keyboard Gaming', 'parent' : '2'}, 
 {'category' : 'Keyboard Wireless', 'parent' : 
'2'}])

*output i expected *
Keyboard
- Keyboard Cable
- Keyboard Gaming
- Keyboard Wireless
Monitor
- Monitor LCD
- Monitor LED

thank you so much in advance

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: self-reference not showing dropdown on form field

2013-03-04 Thread 黄祥


> db.category.parent.requires = IS_EMPTY_OR(IS_IN_DB(db, 'category.category'
> ))
>

a, the solution is so simple just to add the validator : IS_EMPTY_OR(). 
web2py is so efficient in developing time. thank you very much anthony.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DB Insert Variable Names

2013-03-04 Thread Niphlod
it's how HTML works.

On Monday, March 4, 2013 10:09:51 PM UTC+1, Anthony Bond wrote:
>
> Whoops - true sign of a neophyte.
>
> Is there a reason why web2py uses names as opposed to IDs?
>
> On Monday, March 4, 2013 3:20:15 PM UTC-5, Anthony wrote:
>>
>> Looks like you don't assign names to any of the selects, so their values 
>> are not passed via request.post_vars (and therefore don't make it into 
>> form.vars).
>>
>> On Monday, March 4, 2013 11:54:23 AM UTC-5, Anthony Bond wrote:
>>>
>>> The values shouldn't be null - it should be a int value from between 0 
>>> and 5.  Even if the user didn't select any items, the default value will 
>>> still be 0 from the drop down list.
>>>
>>> On Monday, March 4, 2013 11:51:01 AM UTC-5, Anthony wrote:

 Did you previously define that column with notnull=True? If so, you may 
 need to alter that column directly in MySQL so it allows null values.

 Anthony

 On Monday, March 4, 2013 11:41:05 AM UTC-5, Anthony Bond wrote:
>
> I've fixed the issue with the variable names by prefixing a letter to 
> the variable.  However, the insert still does not function.  Here's the 
> error:
>
> 127.0.0.1.2013-03-04.11-38-23.96eaf75d-0524-4eb8-8848-6000d1993dcd
>  (1048, u"Column 
> 'Q4_3A' cannot be null")
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 212, in restricted
>   File 
> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>  
> ,
>  line 84, in 
>   File "gluon/globals.py", line 193, in 
>   File "gluon/tools.py", line 2929, in f
>   File 
> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>  
> ,
>  line 28, in Take_Eval
>   File "gluon/dal.py", line 7918, in insert
>   File "gluon/dal.py", line 1176, in insert
> InternalError: (1048, u"Column 'Q4_3A' cannot be null")
>
>
> line 28, in Take_Eval refers to the insert method.  Just a thought - do I 
> need to append something extra to "form.vars.Q4_3A" to get the value of 
> that particular drop down list?
>
>
> On Sunday, March 3, 2013 2:34:29 PM UTC-5, Alan Etkin wrote:
>>
>> > My attempts at resolving this issue have made the implementation of 
>> the form much simpler, but I'm still unable to get the code to 
>> > compile after I put the insert in.  I would appreciate and 
>> assistance you could provide in enlightening me as to why that insert 
>> > statement would not compile.
>>
>> Could you post the relevant part of the error ticket?
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DB Insert Variable Names

2013-03-04 Thread Anthony Bond
Whoops - true sign of a neophyte.

Is there a reason why web2py uses names as opposed to IDs?

On Monday, March 4, 2013 3:20:15 PM UTC-5, Anthony wrote:
>
> Looks like you don't assign names to any of the selects, so their values 
> are not passed via request.post_vars (and therefore don't make it into 
> form.vars).
>
> On Monday, March 4, 2013 11:54:23 AM UTC-5, Anthony Bond wrote:
>>
>> The values shouldn't be null - it should be a int value from between 0 
>> and 5.  Even if the user didn't select any items, the default value will 
>> still be 0 from the drop down list.
>>
>> On Monday, March 4, 2013 11:51:01 AM UTC-5, Anthony wrote:
>>>
>>> Did you previously define that column with notnull=True? If so, you may 
>>> need to alter that column directly in MySQL so it allows null values.
>>>
>>> Anthony
>>>
>>> On Monday, March 4, 2013 11:41:05 AM UTC-5, Anthony Bond wrote:

 I've fixed the issue with the variable names by prefixing a letter to 
 the variable.  However, the insert still does not function.  Here's the 
 error:

 127.0.0.1.2013-03-04.11-38-23.96eaf75d-0524-4eb8-8848-6000d1993dcd
  (1048, u"Column 
 'Q4_3A' cannot be null")

 Traceback (most recent call last):
   File "gluon/restricted.py", line 212, in restricted
   File 
 "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
  
 ,
  line 84, in 
   File "gluon/globals.py", line 193, in 
   File "gluon/tools.py", line 2929, in f
   File 
 "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
  
 ,
  line 28, in Take_Eval
   File "gluon/dal.py", line 7918, in insert
   File "gluon/dal.py", line 1176, in insert
 InternalError: (1048, u"Column 'Q4_3A' cannot be null")


 line 28, in Take_Eval refers to the insert method.  Just a thought - do I 
 need to append something extra to "form.vars.Q4_3A" to get the value of 
 that particular drop down list?


 On Sunday, March 3, 2013 2:34:29 PM UTC-5, Alan Etkin wrote:
>
> > My attempts at resolving this issue have made the implementation of 
> the form much simpler, but I'm still unable to get the code to 
> > compile after I put the insert in.  I would appreciate and 
> assistance you could provide in enlightening me as to why that insert 
> > statement would not compile.
>
> Could you post the relevant part of the error ticket?
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Bootstrap btn class in ajax components

2013-03-04 Thread RHC
Thanks Anthony, that's very useful to know. 

I'll have a look and try the simplest option :-). I'll have to update 
web2py first so I'm not tinkering with old code to start with. I'll post my 
code in one of those places if it works as expected.

On Saturday, March 2, 2013 12:59:45 AM UTC, Anthony wrote:
>
> I have had a little look through the web2py source on github and it seems 
>> to me it would be more consistent for components if a function was called 
>> here: 
>> https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L120that
>>  re-ran the same code found in web2py_bootstrap.js. Possibly this 
>> function could act just on the loaded/reloaded content.
>
>
> web2py_bootstrap.js is specific to the scaffolding app, whereas web2py.js 
> is more general, so I don't think we should include 
> Bootstrap/scaffold-specific code in web2py.js. However, something like this 
> in web2py_bootstrap.js might do the trick:
>
> jQuery(document).ajaxSuccess(function() {
>   jQuery('button, form input[type="submit"], form input[type="button"]').
> addClass('btn');
> });
>
> That will add the 'btn' class every time an Ajax request completes (so it 
> will work even work for Ajax requests that are not for components).
>
> If for some reason we want to be more targeted and only run this for 
> components, we could have web2py_ajax_page() use .trigger() to trigger a 
> custom event, and web2py_bootstrap.js could define a handler for that event 
> using .on(). I suppose it could be useful more generally to have a custom 
> event fire every time a component loads/re-loads.
>  
>
>> Incidentally how would I go about submitting or requesting a change like 
>> this if I did give it a go?
>
>
> You can always post on the developers list. Another option is to submit 
> an issue  along with your 
> proposed change.
>
> Anthony
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DB Insert Variable Names

2013-03-04 Thread Anthony
Looks like you don't assign names to any of the selects, so their values 
are not passed via request.post_vars (and therefore don't make it into 
form.vars).

On Monday, March 4, 2013 11:54:23 AM UTC-5, Anthony Bond wrote:
>
> The values shouldn't be null - it should be a int value from between 0 and 
> 5.  Even if the user didn't select any items, the default value will still 
> be 0 from the drop down list.
>
> On Monday, March 4, 2013 11:51:01 AM UTC-5, Anthony wrote:
>>
>> Did you previously define that column with notnull=True? If so, you may 
>> need to alter that column directly in MySQL so it allows null values.
>>
>> Anthony
>>
>> On Monday, March 4, 2013 11:41:05 AM UTC-5, Anthony Bond wrote:
>>>
>>> I've fixed the issue with the variable names by prefixing a letter to 
>>> the variable.  However, the insert still does not function.  Here's the 
>>> error:
>>>
>>> 127.0.0.1.2013-03-04.11-38-23.96eaf75d-0524-4eb8-8848-6000d1993dcd
>>>  (1048, u"Column 
>>> 'Q4_3A' cannot be null")
>>>
>>> Traceback (most recent call last):
>>>   File "gluon/restricted.py", line 212, in restricted
>>>   File 
>>> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>>>  
>>> ,
>>>  line 84, in 
>>>   File "gluon/globals.py", line 193, in 
>>>   File "gluon/tools.py", line 2929, in f
>>>   File 
>>> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>>>  
>>> ,
>>>  line 28, in Take_Eval
>>>   File "gluon/dal.py", line 7918, in insert
>>>   File "gluon/dal.py", line 1176, in insert
>>> InternalError: (1048, u"Column 'Q4_3A' cannot be null")
>>>
>>>
>>> line 28, in Take_Eval refers to the insert method.  Just a thought - do I 
>>> need to append something extra to "form.vars.Q4_3A" to get the value of 
>>> that particular drop down list?
>>>
>>>
>>> On Sunday, March 3, 2013 2:34:29 PM UTC-5, Alan Etkin wrote:

 > My attempts at resolving this issue have made the implementation of 
 the form much simpler, but I'm still unable to get the code to 
 > compile after I put the insert in.  I would appreciate and assistance 
 you could provide in enlightening me as to why that insert 
 > statement would not compile.

 Could you post the relevant part of the error ticket?



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Niphlod
ps: version check fails because it expects

version (date) stable/dev

instead of the current format

Version 2.4.2 (stable) 2013-03-04 03:26:21

On Monday, March 4, 2013 5:13:34 PM UTC+1, Niphlod wrote:
>
> git tags are not published https://github.com/web2py/web2py/tags . 
> did you issue git push --tags ?
>
> On Monday, March 4, 2013 5:11:27 PM UTC+1, Massimo Di Pierro wrote:
>>
>> we are using hg tags, git tags, and semantic versioning.
>>
>> On Monday, 4 March 2013 01:50:31 UTC-6, Paolo valleri wrote:
>>>
>>> Good works, I will try it later today.
>>> I don't know if you have already discussed about that, just in case, I 
>>> would suggest to start the use of git tags so it will be easier to update 
>>> web2py and keep track of the different releases.
>>>
>>> Paolo
>>>
>>> On Monday, March 4, 2013 7:58:19 AM UTC+1, Massimo Di Pierro wrote:

 That is not the expected behavior.
 I will check what is going on but the more info you can provide the 
 better.


 On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:
>
> So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I 
> click the 'Check for Upgrades' button in the admin dashboard, I get a 
> message 'Unable to check for upgrades' that replaces the button, and is a 
> link to web2py.com.
>
> Is that the expected behavior?
>


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: datetime - compare dates while ignoring time Part 2: Time Zones!

2013-03-04 Thread Andrew Evans
Hi I did something I think which is similar

you can get the current time based on time zone like this

import datetime
import pytz
import time

current_time =
datetime.datetime.now(pytz.timezone('US/Eastern')).replace(tzinfo=None)

This allowed me to schedule videos to play at a given time

Not sure this is what you need but maybe it helps :-)

*cheers

Andrew

On Mon, Mar 4, 2013 at 11:57 AM, Niphlod  wrote:

> no, it's not possible. request.now is always calculated on the server, not
> on the client. That being said, the "today" on the server may not be the
> same today on the clients accessing your page from all the timezones in the
> world
> e.g. if you're providing some kind of function based on THEIR timezone
> (i.e. "press this button to delete all your appointments today") you really
> need to start fiddling with UTC and timezone differences.
>
>
> On Monday, March 4, 2013 7:08:23 PM UTC+1, jjg0 wrote:
>>
>> I had asked a question about comparing datetimes here:
>> https://groups.google.com/**forum/?fromgroups=#!topic/**
>> web2py/2euU80vV2WE
>> The question was answered but I ran into another problem closely related,
>> so I made a sequel.  Let's hope we don't have to suffer through a trilogy!
>>
>> Here is what I am doing:
>>
>> I have a model of appointments with a field for the date:
>>
>> .
>> .
>> Field('appointment_date', 'date')
>> .
>> .
>>
>> and a controller that should grab all of today's appointments to be
>> printed out:
>>
>> appointment_dates = db(db.appointments.**appointment_date==request.now.**
>> date()).select()
>>
>> Here is the problem:
>>
>> request.now.date() appears to get the time based on the server.  So If
>> the server is say 5 hours ahead, once 7:00pm my time hits I'm going to be
>> looking at tomorrows appointments.  (server hits midnight, day cycles but
>> I'm still 7:00pm yesterday)
>>
>> When the controller goes to grab the day's appontments, is it possible to
>> somehow replace request.now.date() with the date of the users pc?
>> Otherwise I'm not really sure how else to go about this problem.
>>
>> Thanks
>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] qrcode

2013-03-04 Thread Mariano Reingart
To generate qr, I've used qrcode:

https://pypi.python.org/pypi/qrcode/2.4.1

You can see a working example here:

https://code.google.com/p/web2conf/source/browse/modules/image_utils.py

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com


On Mon, Mar 4, 2013 at 11:26 AM, Niphlod  wrote:
> multiple options:
> - someone will make available a service
> - you make your own QRs (plenty of libs out there)
>
>
> On Monday, March 4, 2013 2:10:17 PM UTC+1, Alan Etkin wrote:
>>
>> > using google for QR codes (although Graph API will be deprecated in
>> > 2015)
>>
>> What to do then? Is there any other core feature that relies in Graph API?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: The Great Web Framework Shootout

2013-03-04 Thread OJ
I will, 

I'm currently figuring out how to arrange my EC2 instance. After that I'm 
looking for advice with web2py / Apache setup :) One problem at the time.

On Sunday, March 3, 2013 3:37:32 PM UTC+2, wwwgong wrote:
>
> Please share the benchmark results when avail

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: datetime - compare dates while ignoring time Part 2: Time Zones!

2013-03-04 Thread Niphlod
no, it's not possible. request.now is always calculated on the server, not 
on the client. That being said, the "today" on the server may not be the 
same today on the clients accessing your page from all the timezones in the 
world
e.g. if you're providing some kind of function based on THEIR timezone 
(i.e. "press this button to delete all your appointments today") you really 
need to start fiddling with UTC and timezone differences.


On Monday, March 4, 2013 7:08:23 PM UTC+1, jjg0 wrote:
>
> I had asked a question about comparing datetimes here: 
> https://groups.google.com/forum/?fromgroups=#!topic/web2py/2euU80vV2WE
> The question was answered but I ran into another problem closely related, 
> so I made a sequel.  Let's hope we don't have to suffer through a trilogy!
>
> Here is what I am doing:
>
> I have a model of appointments with a field for the date:
>
> .
> .
> Field('appointment_date', 'date') 
> .
> .
>
> and a controller that should grab all of today's appointments to be 
> printed out:
>
> appointment_dates = 
> db(db.appointments.appointment_date==request.now.date()).select()
>
> Here is the problem:
>
> request.now.date() appears to get the time based on the server.  So If the 
> server is say 5 hours ahead, once 7:00pm my time hits I'm going to be 
> looking at tomorrows appointments.  (server hits midnight, day cycles but 
> I'm still 7:00pm yesterday)
>
> When the controller goes to grab the day's appontments, is it possible to 
> somehow replace request.now.date() with the date of the users pc?  
> Otherwise I'm not really sure how else to go about this problem.  
>
> Thanks
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to search by region then category

2013-03-04 Thread leapingidiots
Hello I am trying to figure out how to do a query where given the region of 
an entry in a database show entries from categories where people have 
chosen that region.

I have atm this database code

db.define_table('listing',
Field('userinfo',db.auth_user,default=auth.user_id, 
writable=False,readable=False),
Field('main_category', 'list:reference main_category', label="Main 
Category", comment='Main Category to Appear in'),
Field('sub_category', 'list:reference sub_category', label="Sub 
Category", comment='Sub Category to Appear in'),
Field('region', 'list:reference region', comment='Region to appear in'),
...

then in the view I have 

{{=region.title}}

Then in my controller I have this

def region():
region = request.args(0)
query = (db.listing.region.contains(region)) & (db.listing.confirmed == 
True)
orderby = db.listing.title
pcache = (cache.ram, 15)
paginate = Pagination(db, query, orderby, display_count=10, 
cache=pcache, r=request, res=response)
region_query = paginate.get_set(set_links=True)
return dict(region_query = region_query)

What I would like to do is choose the region then the categories and 
sub_categories based on the entries that have those values.

If some one can provide some assistance that would be great

*cheers

and thank you


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Web2py 2.4.2 - Wizard, trouble

2013-03-04 Thread Fernando Lucas
Web2py 242 wizard,

The buttons [+] and [-] don't work.
I test: Firefox 18, Chrome and IE8;  Ubuntu 12.04 and Win7.

Thanks
Fernando Lucas

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: SQLFORM.widgets.autocomplete on a field in a keyed table. MSSQL

2013-03-04 Thread Dmitry Mosin
web2py(tm) (2, 4, 2, 'stable', datetime.datetime(2013, 3, 3, 21, 22, 42))


Traceback (most recent call last):
  File "/var/www/py/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/var/www/py/web2py/applications/discount/models/db.py" 
, line 57, in 

widget = SQLFORM.widgets.autocomplete(request, db.m_dsc_cards_copy, 
id_field=db.m_dsc_cards_copy.cardid, limitby=(0,20), min_length=2),
  File "/var/www/py/web2py/gluon/sqlhtml.py", line 624, in __init__
self.keyword = keyword % dict(tablename=field.tablename,
  File "/var/www/py/web2py/gluon/dal.py", line 8258, in __getitem__
return ogetattr(self, str(key))
AttributeError: 'Table' object has no attribute 'tablename'




вторник, 5 марта 2013 г., 0:02:40 UTC+6 пользователь Dmitry Mosin написал:
>
> web2py(tm) (2, 4, 1, 'alpha.2', datetime.datetime(2013, 3, 2, 9, 17, 16))
>
> понедельник, 4 марта 2013 г., 22:09:59 UTC+6 пользователь Massimo Di 
> Pierro написал:
>>
>> which web2py version?
>>
>>
>  
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] datetime - compare dates while ignoring time Part 2: Time Zones!

2013-03-04 Thread jjg0
I had asked a question about comparing datetimes here: 
https://groups.google.com/forum/?fromgroups=#!topic/web2py/2euU80vV2WE
The question was answered but I ran into another problem closely related, 
so I made a sequel.  Let's hope we don't have to suffer through a trilogy!

Here is what I am doing:

I have a model of appointments with a field for the date:

.
.
Field('appointment_date', 'date') 
.
.

and a controller that should grab all of today's appointments to be printed 
out:

appointment_dates = 
db(db.appointments.appointment_date==request.now.date()).select()

Here is the problem:

request.now.date() appears to get the time based on the server.  So If the 
server is say 5 hours ahead, once 7:00pm my time hits I'm going to be 
looking at tomorrows appointments.  (server hits midnight, day cycles but 
I'm still 7:00pm yesterday)

When the controller goes to grab the day's appontments, is it possible to 
somehow replace request.now.date() with the date of the users pc?  
Otherwise I'm not really sure how else to go about this problem.  

Thanks


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: SQLFORM.widgets.autocomplete on a field in a keyed table. MSSQL

2013-03-04 Thread Dmitry Mosin
web2py(tm) (2, 4, 1, 'alpha.2', datetime.datetime(2013, 3, 2, 9, 17, 16))

понедельник, 4 марта 2013 г., 22:09:59 UTC+6 пользователь Massimo Di Pierro 
написал:
>
> which web2py version?
>
>
 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: on social auth

2013-03-04 Thread Alec Taylor
On Tue, Mar 5, 2013 at 1:24 AM, Niphlod  wrote:
> On Monday, March 4, 2013 3:10:33 PM UTC+1, Michele Comitini wrote:
>>
>> First of al I like a library that claims web2py compatibility that's a
>> very good sign!
>
>
> ? web2py is "out" (part of the reason why I asked if someone was
> interested). There's webpy, flask and django.
>
>>
>> Does social-auth support a common API (aka janrain) to access social
>> info or it is just the auth part?
>
>
> seems also extra data
>
>>
>> For the auth part  we already cover already much of it, the dying
>> OAuth1.0a  and the now stable OAuth2.0,we have also backward
>> compatibility with the broken facebook implementation.   Maintenance
>> is a relative issue, since these protocols should be rather stable.
>
>
> That was more or less the big point: what if someone like you leaves the
> module the way it is and some changes are introduced in the APIs ? Did
> anyone tested the contrib module against something that was not facebook,
> google or linkedin ? There are 44 backends already tested with that module.
>
> We have 6 contrib modules for managing various oauth implementations and
> most of it remains probably untested (there are no unittest available for
> all of them)...
>
> 
> At the end of the day. why should web2py reinvent the wheel every time
> (this is only an example) instead of relying on battle-tested libraries ?
> Less code to include in the distribution, less code to maintain, more users
> to test the features (testers for web2py modules and contribs are REALLY
> lacking), less probability that if the maintainer has something else to do
> the code would be updated anyway.
> 

Agreed.

E.g.: I tested the LinkedIn many many months ago; reported a bug; and
didn't get it fixed >.<

If we can just tie in libraries which have the functionality we want;
we'll be much better off :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] [book typo] simplesjson (sic)

2013-03-04 Thread Richard
gluon.contrib.simplesjson.dumps(a)

At : 
http://web2py.com/books/default/chapter/29/10?search=simplejson#simplejson

Richard

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DB Insert Variable Names

2013-03-04 Thread Anthony Bond
The values shouldn't be null - it should be a int value from between 0 and 
5.  Even if the user didn't select any items, the default value will still 
be 0 from the drop down list.

On Monday, March 4, 2013 11:51:01 AM UTC-5, Anthony wrote:
>
> Did you previously define that column with notnull=True? If so, you may 
> need to alter that column directly in MySQL so it allows null values.
>
> Anthony
>
> On Monday, March 4, 2013 11:41:05 AM UTC-5, Anthony Bond wrote:
>>
>> I've fixed the issue with the variable names by prefixing a letter to the 
>> variable.  However, the insert still does not function.  Here's the error:
>>
>> 127.0.0.1.2013-03-04.11-38-23.96eaf75d-0524-4eb8-8848-6000d1993dcd
>>  (1048, u"Column 'Q4_3A' 
>> cannot be null")
>>
>> Traceback (most recent call last):
>>   File "gluon/restricted.py", line 212, in restricted
>>   File 
>> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>>  
>> ,
>>  line 84, in 
>>   File "gluon/globals.py", line 193, in 
>>   File "gluon/tools.py", line 2929, in f
>>   File 
>> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>>  
>> ,
>>  line 28, in Take_Eval
>>   File "gluon/dal.py", line 7918, in insert
>>   File "gluon/dal.py", line 1176, in insert
>> InternalError: (1048, u"Column 'Q4_3A' cannot be null")
>>
>>
>> line 28, in Take_Eval refers to the insert method.  Just a thought - do I 
>> need to append something extra to "form.vars.Q4_3A" to get the value of that 
>> particular drop down list?
>>
>>
>> On Sunday, March 3, 2013 2:34:29 PM UTC-5, Alan Etkin wrote:
>>>
>>> > My attempts at resolving this issue have made the implementation of 
>>> the form much simpler, but I'm still unable to get the code to 
>>> > compile after I put the insert in.  I would appreciate and assistance 
>>> you could provide in enlightening me as to why that insert 
>>> > statement would not compile.
>>>
>>> Could you post the relevant part of the error ticket?
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DB Insert Variable Names

2013-03-04 Thread Anthony
Did you previously define that column with notnull=True? If so, you may 
need to alter that column directly in MySQL so it allows null values.

Anthony

On Monday, March 4, 2013 11:41:05 AM UTC-5, Anthony Bond wrote:
>
> I've fixed the issue with the variable names by prefixing a letter to the 
> variable.  However, the insert still does not function.  Here's the error:
>
> 127.0.0.1.2013-03-04.11-38-23.96eaf75d-0524-4eb8-8848-6000d1993dcd
>  (1048, u"Column 'Q4_3A' 
> cannot be null")
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 212, in restricted
>   File 
> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>  
> ,
>  line 84, in 
>   File "gluon/globals.py", line 193, in 
>   File "gluon/tools.py", line 2929, in f
>   File 
> "C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
>  
> ,
>  line 28, in Take_Eval
>   File "gluon/dal.py", line 7918, in insert
>   File "gluon/dal.py", line 1176, in insert
> InternalError: (1048, u"Column 'Q4_3A' cannot be null")
>
>
> line 28, in Take_Eval refers to the insert method.  Just a thought - do I 
> need to append something extra to "form.vars.Q4_3A" to get the value of that 
> particular drop down list?
>
>
> On Sunday, March 3, 2013 2:34:29 PM UTC-5, Alan Etkin wrote:
>>
>> > My attempts at resolving this issue have made the implementation of the 
>> form much simpler, but I'm still unable to get the code to 
>> > compile after I put the insert in.  I would appreciate and assistance 
>> you could provide in enlightening me as to why that insert 
>> > statement would not compile.
>>
>> Could you post the relevant part of the error ticket?
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Creating a form using a for loop

2013-03-04 Thread Anthony Bond
I figured this out later on - I've adjusted all the variables and field 
names to start with a Q.  Thanks.

On Saturday, March 2, 2013 5:57:30 PM UTC-5, Arglanir wrote:
>
> I think your compilation error comes from the fact that in Python you 
> cannot have a variable name starting with a number. Try changing the field 
> names of Evaluation table to _1_1A... 
>
> Then remember that only one form can be submitted in HTML, so your 
> controler will be called only for one submitted form, not all. 
>
> Le samedi 2 mars 2013 07:26:18 UTC+1, Anthony Bond a écrit : 
> > I've been working with web2py for about two months now.  I've figured 
> out how to do a lot of awesome things with it; however, the problem I'm 
> having now has me stumped. 
> > 
> > 
> > I'm working on an application that allows a user to submit a 
> self-evaluation, based on criteria that the user will find on a page.  I 
> have a table with 33 rows of of criteria.  The table contains a column 
> which hosts the criteria, pre-formatted in HTML.  Each HTML section 
> contains a table the gives the users the criteria for each of six levels - 
> these individual tables are almost large enough to take up the entire 
> content section of the webpage, so I've placed them all in a jQuery 
> accordion.  Below each table, I've placed a drop down list, where the user 
> can select what criteria they feel as though they've met.  I've added a 
> small screenshot to show the look and feel I'm trying to achieve (and 
> currently have). 
> > 
> > 
> > The problem I'm having is getting the values of those drop down lists 
> back from the database.  Currently, I iterate through the table containing 
> the HTML using a for loop, tacking a drop down list at the end of each. 
>  Right now, I'm unable to get the data back from the page.  Here is my 
> code: 
> > 
> > 
> > 
> > def Take_Eval():  
> > 
> > user = db(db.Person.auth_userUserId == 
> > auth.user.id).select().first().PersonId 
>
> > 
> > table = db(db.PageContent.ContentId > 0).select() 
> > 
> > submit = INPUT(_name='submit', _type='submit') 
> > 
> > formlist = [] 
> > 
> >  
> > 
> > for row in table: 
> > 
> > newForm = FORM(H2(row['ContentDescription'], 
> _style="padding-left: 10px;"), 
> > 
> > DIV(XML(row.ContentHTML), BR(), P(SELECT(OPTGROUP(OPTION('Does 
> not Attempt', _value=0), OPTION('Developing', _value=1), 
> OPTION('Progressing', _value=2), OPTION('Established', _value=3), 
> OPTION('Advanced', _value=4), OPTION('Master', _value=5)), 
> _id=row['QuestionNumber']), _style='text-align: center;'))) 
> > 
> > formlist.append(newForm) 
> > 
> >  
> > 
> > for form in formlist: 
> > 
> > if form.accepts(request, session): 
> > 
> >response.flash = 'Profile Saved Successfully on  ' + 
> str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) 
> > 
> >#db.Evaluation.insert(PersonBeingEvaluated, PersonEvaluating, 
> EvalDate ,1_1A ,1_1B ,1_2 ,1_3 ,1_4 , 1_5, 1_6, 2_1, 2_2A , 2_2B, 2_3A 
> ,2_3B ,2_4 ,2_5 ,3_1 , 3_2 , 3_3, 3_4, 3_5A, 3_5B, 3_6, 3_7, 3_8, 3_9A, 
> 3_9B, 3_9C, 4_1, 4_2, 4_3A, 4_3B, 4_4, BeliefsScore, CharacterScore) 
> > 
> > 
> > 
> >redirect(URL('default', 'index')) 
> > 
> > elif form.errors: 
> > 
> >response.flash = 'Profile could not be submitted.  Please try 
> again later. ' 
> > 
> >  
> > 
> > db.Evaluation.insert(PersonBeingEvaluated=user, PersonEvaluating=0, 
> EvalDate=datetime.now(), 1_1A = formlist[0].vars.1_1A, 1_1B = 
> formlist[1].vars.1_1B, 1_2 = formlist[2].vars.1_2, 1_3 = 
> formlist[3].vars.1_3, 1_4 = formlist[4].vars.1_4, 1_5 = 
> formlist[5].vars.1_5, 1_6 = formlist[6].vars.1_6, 2_1 = 
> formlist[7].vars.2_1, 2_2A = formlist[8].vars.2_2A, 2_2B = 
> formlist[9].vars.2_2B, 2_3A = formlist[10].vars.2_3A, 2_3B = 
> formlist[11].vars.2_3B, 2_4 = formlist[12].vars.2_4, 2_5 = 
> formlist[13].vars.2_5, 3_1 = formlist[14].vars.3_1, 3_2 = 
> formlist[15].vars.3_2, 3_3 = formlist[16].vars.3_3, 3_4 = 
> formlist[17].vars.3_4, 3_5A = formlist[18].vars.3_5A, 3_5B = 
> formlist[19].vars.3_5B, 3_6 = formlist[20].vars.3_6, 3_7 = 
> formlist[21].vars.3_7, 3_8 = formlist[22].vars.3_8, 3_9A = 
> formlist[23].vars.3_9A, 3_9B = formlist[24].vars.3_9B, 3_9C = 
> formlist[25].vars.3_9C, 4_1 = formlist[26].vars.4_1, 4_2 = 
> formlist[27].vars.4_2, 4_3A = formlist[28].vars.4_3A, 4_3B = 
> formlist[29].vars.4_3B, 4_4 = formlist[30].vars.4_4, BeliefsScore = 
> formlist[31].vars.BeliefsScore, CharacterScore = 
> formlist[32].vars.CharacterScore) 
> > 
> >
> > 
> > return locals() 
> > 
> > 
> > The code is not letting me compile due to a syntax error on the area 
> I've highlighted above.  I'm okay with not using a form, or a bunch of 
> forms, as long as I can get the values from the drop down list back to the 
> controller when the submit button is clicked.  I originally looped through 
> the table in the view to make the display.  

[web2py] Re: DB Insert Variable Names

2013-03-04 Thread Anthony Bond
I've fixed the issue with the variable names by prefixing a letter to the 
variable.  However, the insert still does not function.  Here's the error:

127.0.0.1.2013-03-04.11-38-23.96eaf75d-0524-4eb8-8848-6000d1993dcd
 (1048, u"Column 'Q4_3A' 
cannot be null")

Traceback (most recent call last):
  File "gluon/restricted.py", line 212, in restricted
  File 
"C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
 
,
 line 84, in 
  File "gluon/globals.py", line 193, in 
  File "gluon/tools.py", line 2929, in f
  File 
"C:/Users/abond2/Desktop/web2py/web2py/web2py/applications/Teacher_Evaluation_System/controllers/evaluation.py"
 
,
 line 28, in Take_Eval
  File "gluon/dal.py", line 7918, in insert
  File "gluon/dal.py", line 1176, in insert
InternalError: (1048, u"Column 'Q4_3A' cannot be null")


line 28, in Take_Eval refers to the insert method.  Just a thought - do I need 
to append something extra to "form.vars.Q4_3A" to get the value of that 
particular drop down list?


On Sunday, March 3, 2013 2:34:29 PM UTC-5, Alan Etkin wrote:
>
> > My attempts at resolving this issue have made the implementation of the 
> form much simpler, but I'm still unable to get the code to 
> > compile after I put the insert in.  I would appreciate and assistance 
> you could provide in enlightening me as to why that insert 
> > statement would not compile.
>
> Could you post the relevant part of the error ticket?
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: self-reference not showing dropdown on form field

2013-03-04 Thread Richard Vézina
Yeah I just read the code, I read self-reference in his question and you
answer first word was Self-reference :)

Richard


On Mon, Mar 4, 2013 at 11:30 AM, Anthony  wrote:

> This is not a list:reference field, just a regular reference.
>
>
> On Monday, March 4, 2013 9:07:35 AM UTC-5, Richard wrote:
>
>> There is a issue open for this by me and Massimo try a couple of time to
>> solve it, but it seems it still there...
>>
>> Richard
>>
>>
>> On Mon, Mar 4, 2013 at 8:34 AM, Anthony  wrote:
>>
>>> db.category.parent.requires = IS_EMPTY_OR(IS_IN_DB(db,
>>> 'category.category'))
>>>
>>> On Sunday, March 3, 2013 9:34:59 PM UTC-5, 黄祥 wrote:

 a, thank you so much for your detail explaination anthony. it's work
 fine now by add :

 db.category.parent.requires=**IS**_IN_DB(db, 'category.category')

 btw, with this, i still have a problem for input the parent category.
 because in form there is not allowed to put an empty value. i have 2 ideas
 for this problem :
 1. put the parent category directly to database via database input
 command
 2. create the root category above parent category :
 for example
 root category
 |
 parent category
 |
 child category

 do you have better idea or suggestion about this?

 thanks a lot before

>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: self-reference not showing dropdown on form field

2013-03-04 Thread Anthony
This is not a list:reference field, just a regular reference.

On Monday, March 4, 2013 9:07:35 AM UTC-5, Richard wrote:
>
> There is a issue open for this by me and Massimo try a couple of time to 
> solve it, but it seems it still there...
>
> Richard
>
>
> On Mon, Mar 4, 2013 at 8:34 AM, Anthony  >wrote:
>
>> db.category.parent.requires = IS_EMPTY_OR(IS_IN_DB(db, 
>> 'category.category'))
>>
>> On Sunday, March 3, 2013 9:34:59 PM UTC-5, 黄祥 wrote:
>>>
>>> a, thank you so much for your detail explaination anthony. it's work 
>>> fine now by add :
>>>
>>> db.category.parent.requires=**IS_IN_DB(db, 'category.category')
>>>
>>> btw, with this, i still have a problem for input the parent category. 
>>> because in form there is not allowed to put an empty value. i have 2 ideas 
>>> for this problem :
>>> 1. put the parent category directly to database via database input 
>>> command
>>> 2. create the root category above parent category :
>>> for example
>>> root category
>>> |
>>> parent category
>>> | 
>>> child category
>>>
>>> do you have better idea or suggestion about this?
>>>
>>> thanks a lot before
>>>
>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] GAE - Datastore and CloudSQL together

2013-03-04 Thread Philip Kilner

Hi,

Is there a way to use the datastore for the session, filesystem and 
ticket tables, whilst using CloudSQL for the actual db?


Also, having migrated from the datastore to CloudSQL, I am no longer 
getting tickets saved in either - is there anything obvious I can look 
into there? (In the absence of tickets, I have no idea what to look for!)



--

Regards,

PhilK


'a bell is a cup...until it is struck'

--

--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Niphlod
git tags are not published https://github.com/web2py/web2py/tags . did 
you issue git push --tags ?

On Monday, March 4, 2013 5:11:27 PM UTC+1, Massimo Di Pierro wrote:
>
> we are using hg tags, git tags, and semantic versioning.
>
> On Monday, 4 March 2013 01:50:31 UTC-6, Paolo valleri wrote:
>>
>> Good works, I will try it later today.
>> I don't know if you have already discussed about that, just in case, I 
>> would suggest to start the use of git tags so it will be easier to update 
>> web2py and keep track of the different releases.
>>
>> Paolo
>>
>> On Monday, March 4, 2013 7:58:19 AM UTC+1, Massimo Di Pierro wrote:
>>>
>>> That is not the expected behavior.
>>> I will check what is going on but the more info you can provide the 
>>> better.
>>>
>>>
>>> On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:

 So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I 
 click the 'Check for Upgrades' button in the admin dashboard, I get a 
 message 'Unable to check for upgrades' that replaces the button, and is a 
 link to web2py.com.

 Is that the expected behavior?

>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Massimo Di Pierro
we are using hg tags, git tags, and semantic versioning.

On Monday, 4 March 2013 01:50:31 UTC-6, Paolo valleri wrote:
>
> Good works, I will try it later today.
> I don't know if you have already discussed about that, just in case, I 
> would suggest to start the use of git tags so it will be easier to update 
> web2py and keep track of the different releases.
>
> Paolo
>
> On Monday, March 4, 2013 7:58:19 AM UTC+1, Massimo Di Pierro wrote:
>>
>> That is not the expected behavior.
>> I will check what is going on but the more info you can provide the 
>> better.
>>
>>
>> On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:
>>>
>>> So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I 
>>> click the 'Check for Upgrades' button in the admin dashboard, I get a 
>>> message 'Unable to check for upgrades' that replaces the button, and is a 
>>> link to web2py.com.
>>>
>>> Is that the expected behavior?
>>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: SQLFORM.widgets.autocomplete on a field in a keyed table. MSSQL

2013-03-04 Thread Massimo Di Pierro
which web2py version?

On Monday, 4 March 2013 06:46:21 UTC-6, Dmitry Mosin wrote:
>
> Hello friends!
>
>
> When I try something like this
>
> ---
>
> db.define_table('m_dsc_cards_copy',
> Field('cardid','string',length=20,notnull=True,unique=True),
> migrate=False,
> fake_migrate=True,
> primarykey=['cardid']
> )
>
> db.define_table('m_dsc_clients',
> Field('cn','string'),
> Field('cardid','reference m_dsc_cards_copy.cardid',
>   widget = SQLFORM.widgets.autocomplete(request, 
> db.m_dsc_cards_copy, id_field=db.m_dsc_cards_copy.cardid, limitby=(0,20), 
> min_length=2, keyword='_autocomplete_cardid'),
>   ondelete="no action"),
> primarykey=['cn']
> )
>
>
>
> I've got an exception, 
>
> ---
>
>  'Table' object has no attribute 
> 'tablename'
>
> Frames
> File /var/www/py/web2py/gluon/restricted.py in restricted at line 212 
> File /var/www/py/web2py/applications/discount/models/db.py in  
> at line 57
> File /var/www/py/web2py/gluon/sqlhtml.py in __init__ at line 624 
> File /var/www/py/web2py/gluon/dal.py in __getitem__ at line 8256 
>
> Function argument list
> (self=, key='tablename')
>
>
> Code listing 
>
> 8251.
> 8252.
> 8253.
> 8254.
> 8255.
> 8256.
>
> 8257.
> 8258.
> 8259.
> 8260.
>
> return rows[0]
> return None
> elif str(key).isdigit() or 'google' in DRIVERS and isinstance(key, 
> Key):
> return self._db(self._id == key).select(limitby=(0,1)).first()
> elif key:
> return ogetattr(self, str(key))
>
>
> def __call__(self, key=DEFAULT, **kwargs):
> for_update = kwargs.get('_for_update',False)
> if '_for_update' in kwargs: del kwargs['_for_update']
>
>
>
>
>
>
> How can I resolve that?
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DAL/SQL question number 2

2013-03-04 Thread Niphlod

http://web2py.com/books/default/chapter/29/06#orderby,-groupby,-limitby,-distinct,-having

order=field1|field2

On Monday, March 4, 2013 3:50:54 PM UTC+1, Kenneth wrote:
>
> Hi,
>
> how do you orderby and groupby with two fields?
>
> I have a table with these fields: chapter, page and version. I'd like to 
> find all items that are unique based on chapter and page and has the 
> highest version number.
>
>
> Kenneth
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: DAL/SQL question

2013-03-04 Thread Niphlod
I'm just guessing cause your model isn't entirely clear

book_set = db(db.book.editor == auth.user_id)

articles = db(db.article.writer == 
auth.user_id)(~db.article.book.belongs(book_set._select(db.book.id)))

books = book_set.select()

http://web2py.com/books/default/chapter/29/06?search=belongs#belongs

On Monday, March 4, 2013 3:42:38 PM UTC+1, Kenneth wrote:
>
> Hi,
>
> I have a feeling this is quite easy to do but can't find an elegant way of 
> doing it. 
>
> I'm building a book application for an client, the book has chapters and 
> articels in it. Every book has an editor and every articel has a writer and 
> cowriter. There will be maybe 20 books. Every editor and writer will be 
> inserted into auth_user and will have permission to edit their own 
> articels, so that the editor can edit all articels in his/hers book. 
>
> Now I'd like to find all articels "belonging" to a person either via 
> direct "ownership" of articels or via bookownership.
>
> I can find all books belonging to the person and then all articels that 
> way. But finding all other articels will also contain all articels in 
> bookownership.
>
> books = db(t.book.f_editor = auth.user['id']).select()
>
> articels = db(t.article.f_writer = auth.user['id']) & (t.articel.f_book == 
> not in books).select()
>
> How is this written in DAL?
>
>
> Kenneth
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] DAL/SQL question number 2

2013-03-04 Thread Kenneth
Hi,

how do you orderby and groupby with two fields?

I have a table with these fields: chapter, page and version. I'd like to 
find all items that are unique based on chapter and page and has the 
highest version number.


Kenneth

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Keeping track of changes

2013-03-04 Thread Kenneth
Hi,

more questions on my book application. 

There is let's say 20 books, all containing about 10 chapters and then 
maybe 5 articels per chapter. 

Every article is its own item in a table. When everything is ready all 
articles are looked and published. When it is time to upgrade the articles 
I'm planing on making new copies of them articles in the database and use 
that one when the upgraded book is released. How would you do keep track of 
changes in the edited article? All changes needs to be moved into the 
printed version.



Kenneth

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Monte Milanuk
Well, I get the same thing as the other poster:

Version 2.3.2 (2012-12-17 15:03:30) stable

Unable to check for upgrades 


only I don't have 2.4.2.  Same laptop, dual-booting Windows 7 Pro and 
Ubuntu 12.10 desktop, python 2.7.3 on both... running web2py from a folder 
in the user's home directory via the built-in web server (rocket 1.2.6) on 
the localhost (127.0.0.1) interface.  Not sure what else would be common 
between the two besides my router/firewall and ISP... never been a problem 
before.

On Sunday, March 3, 2013 10:58:19 PM UTC-8, Massimo Di Pierro wrote:
>
> That is not the expected behavior.
> I will check what is going on but the more info you can provide the better.
>
>
> On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:
>>
>> So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I click 
>> the 'Check for Upgrades' button in the admin dashboard, I get a message 
>> 'Unable to check for upgrades' that replaces the button, and is a link to 
>> web2py.com.
>>
>> Is that the expected behavior?
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] DAL/SQL question

2013-03-04 Thread Kenneth
Hi,

I have a feeling this is quite easy to do but can't find an elegant way of 
doing it. 

I'm building a book application for an client, the book has chapters and 
articels in it. Every book has an editor and every articel has a writer and 
cowriter. There will be maybe 20 books. Every editor and writer will be 
inserted into auth_user and will have permission to edit their own 
articels, so that the editor can edit all articels in his/hers book. 

Now I'd like to find all articels "belonging" to a person either via direct 
"ownership" of articels or via bookownership.

I can find all books belonging to the person and then all articels that 
way. But finding all other articels will also contain all articels in 
bookownership.

books = db(t.book.f_editor = auth.user['id']).select()

articels = db(t.article.f_writer = auth.user['id']) & (t.articel.f_book == 
not in books).select()

How is this written in DAL?


Kenneth

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread samuel bonilla
+10

good job.

El domingo, 3 de marzo de 2013 22:38:19 UTC-5, Massimo Di Pierro escribió:
>
> The book will be out shortly describing this version.
> I am sure there are some corners to iron but I could not wait any longer.
>
> Changelog:
>
> - 2D GEO API: geoPoint, getLine, geoPolygon
> - support for 'json' field type in DAL
> - schema export with db.as_json/as_xml, thanks Alan
> - graph representation of models
> - admin based on bootstrap, thanks Paolo
> - support for semantic versioning
> - new bootstrap based admin, thanks Paolo
> - improved scheduler (and change in scheduler field names), thanks Niphlod
> - graphiz support added to adm, thanks Jose
> - on_failure in grid
> - db.table.field.abs()
> - better wiki
> - geoPoint, getLine, geoPolygon
> - better reporting of 500 ajax errors
> - better grid
> - improved/fixed mongodb support
> - improved parse_as_rest(patterns=...), thanks Denes
> - improved IMAP DAL support, thanks Alan
> - improved security when cookies in sessions
> - Row.as_xml, as_json, as_dict, as_yaml thanks Alan
> - smarted custom_import
> - setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh
> - added support for motor and pulsar servers, thanks Niphlod
> - added json-rpc2 support
> - added pypyodbc.py driver
> - allow auth.settings.ondelete='CASCADE'
> - new syntax IS_EXPR(lambda value: ...
> - using google for QR codes (although Graph API will be deprecated in 2015)
> - upgraded fpdf to 1.7.1
> - bug fixes (including issues with calendar.js and archive tables)
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Niphlod
multiple options: 
- someone will make available a service 
- you make your own QRs (plenty of libs out there)

On Monday, March 4, 2013 2:10:17 PM UTC+1, Alan Etkin wrote:
>
> > using google for QR codes (although Graph API will be deprecated in 2015)
>
> What to do then? Is there any other core feature that relies in Graph API?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: on social auth

2013-03-04 Thread Niphlod
On Monday, March 4, 2013 3:10:33 PM UTC+1, Michele Comitini wrote:
>
> First of al I like a library that claims web2py compatibility that's a 
> very good sign! 
>

? web2py is "out" (part of the reason why I asked if someone was 
interested). There's webpy, flask and django.
 

> Does social-auth support a common API (aka janrain) to access social 
> info or it is just the auth part? 
>

seems also extra data
 

> For the auth part  we already cover already much of it, the dying 
> OAuth1.0a  and the now stable OAuth2.0,we have also backward 
> compatibility with the broken facebook implementation.   Maintenance 
> is a relative issue, since these protocols should be rather stable. 
>

That was more or less the big point: what if someone like you leaves the 
module the way it is and some changes are introduced in the APIs ? Did 
anyone tested the contrib module against something that was not facebook, 
google or linkedin ? There are 44 backends already tested with that module.

We have 6 contrib modules for managing various oauth implementations and 
most of it remains probably untested (there are no unittest available for 
all of them)...


At the end of the day. why should web2py reinvent the wheel every time 
(this is only an example) instead of relying on battle-tested libraries ? 
Less code to include in the distribution, less code to maintain, more users 
to test the features (testers for web2py modules and contribs are 
REALLY lacking), less probability that if the maintainer has something 
else to do the code would be updated anyway. 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: on social auth

2013-03-04 Thread Alec Taylor
It doesn't claim *web2py* compatibility it claims *webpy* compatibility

I'm guessing it means web.py

On Tue, Mar 5, 2013 at 1:10 AM, Michele Comitini
 wrote:
> First of al I like a library that claims web2py compatibility that's a
> very good sign!
> Does social-auth support a common API (aka janrain) to access social
> info or it is just the auth part?
> For the auth part  we already cover already much of it, the dying
> OAuth1.0a  and the now stable OAuth2.0,we have also backward
> compatibility with the broken facebook implementation.   Maintenance
> is a relative issue, since these protocols should be rather stable.
>
> mic
>
>
> 2013/3/4 Niphlod :
>> that it is pure-python indeed, and frankly reinventing the wheel with a
>> contrib module for every oauth service out there starts to be kinda hard to
>> maintain (talking about dropbox, linkedin, openid, etc in gluon/contrib).
>>
>>
>> On Sunday, March 3, 2013 9:52:57 PM UTC+1, Alan Etkin wrote:

 https://github.com/omab/python-social-auth
>>>
>>>
>>> Is it pure-python?
>>> What are the improvements compared to Janrain or any other built-in
>>> authentication mechanism?
>>>
>>>
>>>
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: on social auth

2013-03-04 Thread Michele Comitini
First of al I like a library that claims web2py compatibility that's a
very good sign!
Does social-auth support a common API (aka janrain) to access social
info or it is just the auth part?
For the auth part  we already cover already much of it, the dying
OAuth1.0a  and the now stable OAuth2.0,we have also backward
compatibility with the broken facebook implementation.   Maintenance
is a relative issue, since these protocols should be rather stable.

mic


2013/3/4 Niphlod :
> that it is pure-python indeed, and frankly reinventing the wheel with a
> contrib module for every oauth service out there starts to be kinda hard to
> maintain (talking about dropbox, linkedin, openid, etc in gluon/contrib).
>
>
> On Sunday, March 3, 2013 9:52:57 PM UTC+1, Alan Etkin wrote:
>>>
>>> https://github.com/omab/python-social-auth
>>
>>
>> Is it pure-python?
>> What are the improvements compared to Janrain or any other built-in
>> authentication mechanism?
>>
>>
>>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: self-reference not showing dropdown on form field

2013-03-04 Thread Richard Vézina
http://code.google.com/p/web2py/issues/detail?id=382&q=self%20reference


On Mon, Mar 4, 2013 at 9:07 AM, Richard Vézina
wrote:

> There is a issue open for this by me and Massimo try a couple of time to
> solve it, but it seems it still there...
>
> Richard
>
>
> On Mon, Mar 4, 2013 at 8:34 AM, Anthony  wrote:
>
>> db.category.parent.requires = IS_EMPTY_OR(IS_IN_DB(db,
>> 'category.category'))
>>
>> On Sunday, March 3, 2013 9:34:59 PM UTC-5, 黄祥 wrote:
>>>
>>> a, thank you so much for your detail explaination anthony. it's work
>>> fine now by add :
>>>
>>> db.category.parent.requires=**IS_IN_DB(db, 'category.category')
>>>
>>> btw, with this, i still have a problem for input the parent category.
>>> because in form there is not allowed to put an empty value. i have 2 ideas
>>> for this problem :
>>> 1. put the parent category directly to database via database input
>>> command
>>> 2. create the root category above parent category :
>>> for example
>>> root category
>>> |
>>> parent category
>>> |
>>> child category
>>>
>>> do you have better idea or suggestion about this?
>>>
>>> thanks a lot before
>>>
>>  --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: self-reference not showing dropdown on form field

2013-03-04 Thread Richard Vézina
There is a issue open for this by me and Massimo try a couple of time to
solve it, but it seems it still there...

Richard


On Mon, Mar 4, 2013 at 8:34 AM, Anthony  wrote:

> db.category.parent.requires = IS_EMPTY_OR(IS_IN_DB(db, 'category.category'
> ))
>
> On Sunday, March 3, 2013 9:34:59 PM UTC-5, 黄祥 wrote:
>>
>> a, thank you so much for your detail explaination anthony. it's work fine
>> now by add :
>>
>> db.category.parent.requires=**IS_IN_DB(db, 'category.category')
>>
>> btw, with this, i still have a problem for input the parent category.
>> because in form there is not allowed to put an empty value. i have 2 ideas
>> for this problem :
>> 1. put the parent category directly to database via database input command
>> 2. create the root category above parent category :
>> for example
>> root category
>> |
>> parent category
>> |
>> child category
>>
>> do you have better idea or suggestion about this?
>>
>> thanks a lot before
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: self-reference not showing dropdown on form field

2013-03-04 Thread Anthony
db.category.parent.requires = IS_EMPTY_OR(IS_IN_DB(db, 'category.category'))

On Sunday, March 3, 2013 9:34:59 PM UTC-5, 黄祥 wrote:
>
> a, thank you so much for your detail explaination anthony. it's work fine 
> now by add :
>
> db.category.parent.requires=IS_IN_DB(db, 'category.category')
>
> btw, with this, i still have a problem for input the parent category. 
> because in form there is not allowed to put an empty value. i have 2 ideas 
> for this problem :
> 1. put the parent category directly to database via database input command
> 2. create the root category above parent category :
> for example
> root category
> |
> parent category
> | 
> child category
>
> do you have better idea or suggestion about this?
>
> thanks a lot before
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Alan Etkin
> using google for QR codes (although Graph API will be deprecated in 2015)

What to do then? Is there any other core feature that relies in Graph API?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] SQLFORM.widgets.autocomplete on a field in a keyed table. MSSQL

2013-03-04 Thread Dmitry Mosin
Hello friends!


When I try something like this
---

db.define_table('m_dsc_cards_copy',
Field('cardid','string',length=20,notnull=True,unique=True),
migrate=False,
fake_migrate=True,
primarykey=['cardid']
)

db.define_table('m_dsc_clients',
Field('cn','string'),
Field('cardid','reference m_dsc_cards_copy.cardid',
  widget = SQLFORM.widgets.autocomplete(request, 
db.m_dsc_cards_copy, id_field=db.m_dsc_cards_copy.cardid, limitby=(0,20), 
min_length=2, keyword='_autocomplete_cardid'),
  ondelete="no action"),
primarykey=['cn']
)



I've got an exception, 
---

 'Table' object has no attribute 
'tablename'

Frames
File /var/www/py/web2py/gluon/restricted.py in restricted at line 212 
File /var/www/py/web2py/applications/discount/models/db.py in  
at line 57
File /var/www/py/web2py/gluon/sqlhtml.py in __init__ at line 624 
File /var/www/py/web2py/gluon/dal.py in __getitem__ at line 8256 

Function argument list
(self=, key='tablename')


Code listing 

8251.
8252.
8253.
8254.
8255.
8256.

8257.
8258.
8259.
8260.

return rows[0]
return None
elif str(key).isdigit() or 'google' in DRIVERS and isinstance(key, Key):
return self._db(self._id == key).select(limitby=(0,1)).first()
elif key:
return ogetattr(self, str(key))


def __call__(self, key=DEFAULT, **kwargs):
for_update = kwargs.get('_for_update',False)
if '_for_update' in kwargs: del kwargs['_for_update']






How can I resolve that?


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Problem with uploading large file web2py version 2.3.2

2013-03-04 Thread Phyo Arkar
How much Ram it takes.

Wont take alot more than 400mb i believe.

On Monday, March 4, 2013 2:40:12 PM UTC+6:30, Mạnh Trần Đức wrote:
>
> Dear everyone,
> I uploaded file about <100mb successfully but it got 
> "Exceptions.MemoryError" when I uploaded a file ~400mb.
> I tried upload to ftp with pyfilesystem but got that error too
>
> I saw  in Windows Task Manager, the Python progress  takes  too much ram 
> and makes system be frozen. 
>
> This is my system that I running web2py:
> Windows 7 pro 64bit 4gb ram
> python 2.7.3 64bit
> Web2py: 2.3.2
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] web2py 2.4.2 is OUT

2013-03-04 Thread Phyo Arkar
Never update to new version , ever , before you are about to show something 
to your client, or Boss.

I had learnt several lessons , in hard ways..

Make sure everything is safe before you do.


On Monday, March 4, 2013 10:43:00 AM UTC+6:30, Alfonso de la Guarda Reyes 
wrote:
>
> Hi! 
>
> Great job! 
>
> Looks faster, tomorrow I have to show a project based on web2py and 
> take the opportunity to do so with this new version... i will give 
> some datails later... 
>
>
> Saludos, 
>
>  
> Alfonso de la Guarda 
> Twitter: @alfonsodg 
> Redes sociales: alfonsodg 
>Telef. 991935157 
> 1024D/B23B24A4 
> 5469 ED92 75A3 BBDB FD6B  58A5 54A1 851D B23B 24A4 
>
>
> On Sun, Mar 3, 2013 at 10:38 PM, Massimo Di Pierro 
> > wrote: 
> > The book will be out shortly describing this version. 
> > I am sure there are some corners to iron but I could not wait any 
> longer. 
> > 
> > Changelog: 
> > 
> > - 2D GEO API: geoPoint, getLine, geoPolygon 
> > - support for 'json' field type in DAL 
> > - schema export with db.as_json/as_xml, thanks Alan 
> > - graph representation of models 
> > - admin based on bootstrap, thanks Paolo 
> > - support for semantic versioning 
> > - new bootstrap based admin, thanks Paolo 
> > - improved scheduler (and change in scheduler field names), thanks 
> Niphlod 
> > - graphiz support added to adm, thanks Jose 
> > - on_failure in grid 
> > - db.table.field.abs() 
> > - better wiki 
> > - geoPoint, getLine, geoPolygon 
> > - better reporting of 500 ajax errors 
> > - better grid 
> > - improved/fixed mongodb support 
> > - improved parse_as_rest(patterns=...), thanks Denes 
> > - improved IMAP DAL support, thanks Alan 
> > - improved security when cookies in sessions 
> > - Row.as_xml, as_json, as_dict, as_yaml thanks Alan 
> > - smarted custom_import 
> > - setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh 
> > - added support for motor and pulsar servers, thanks Niphlod 
> > - added json-rpc2 support 
> > - added pypyodbc.py driver 
> > - allow auth.settings.ondelete='CASCADE' 
> > - new syntax IS_EXPR(lambda value: ... 
> > - using google for QR codes (although Graph API will be deprecated in 
> 2015) 
> > - upgraded fpdf to 1.7.1 
> > - bug fixes (including issues with calendar.js and archive tables) 
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "web2py-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to web2py+un...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Problem with uploading large file web2py version 2.3.2

2013-03-04 Thread Mạnh Trần Đức
Dear everyone,
I uploaded file about <100mb successfully but it got 
"Exceptions.MemoryError" when I uploaded a file ~400mb.
I tried upload to ftp with pyfilesystem but got that error too

I saw  in Windows Task Manager, the Python progress  takes  too much ram 
and makes system be frozen. 

This is my system that I running web2py:
Windows 7 pro 64bit 4gb ram
python 2.7.3 64bit
Web2py: 2.3.2

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] GAE Hosting Issue

2013-03-04 Thread Philip Kilner

Hi All,

I'm developing an app on GAE which has suddenly stopped serving, and 
just wanted to sanity check that other web2py users were not seeing the 
same thing.


The app uses Python 2.7, HRD and CloudSQL. It's a relatively simple 
transactional CRUD app - nothing clever at all from the GAE PoV.


It stopped serving out of the blue (overnight), twelve hours after the 
last deploy, and the error messages it's throwing are very varied - 
"soft memory limit exceeded" (bumped instances from F1 to F2, same 
error, bigger numbers), "deadline exceeded" (setting up loggers or db 
connections) etc. never get as far as my code.


The lack of changes in the app prior to the outage, the essentially 
random nature of the error messages (all of which suggest GAE is running 
out of time or resources in a variety of interesting ways), suggest to 
me that this is a GAE infrastructure problem, but I've yet to find 
anyone else definitively bitten by the same thing (although there is a 
lot of grumbling in the GAE forums about high latency).


I've raised a production issue [1], so far with no response, and have 
moved the app off GAE so that I can carry on working, so the pressure is 
off.


Has anyone else using this combination of GAE facilities (and especially 
CloudSQL) experienced anything similar?


FWIW, my (relatively trivial) apps running purely on the normal HRD 
data-store are running fine.



[1] https://code.google.com/p/googleappengine/issues/detail?id=8918

--

Regards,

PhilK


e: p...@xfr.co.uk - m: 07775 796 747

'work as if you lived in the early days of a better nation'
- alasdair gray

--

--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Reference field to string field in a keyed table. MSSQL

2013-03-04 Thread Dmitry Mosin
It works!
Thank you, Denes! 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: on social auth

2013-03-04 Thread Niphlod
that it is pure-python indeed, and frankly reinventing the wheel with a 
contrib module for every oauth service out there starts to be kinda hard to 
maintain (talking about dropbox, linkedin, openid, etc in gluon/contrib).

On Sunday, March 3, 2013 9:52:57 PM UTC+1, Alan Etkin wrote:
>
> https://github.com/omab/python-social-auth
>>
>
> Is it pure-python?
> What are the improvements compared to Janrain or any other built-in 
> authentication mechanism?
>  
>
>  
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Niphlod
until tags are pushed to the main repo, tags are 
here... in the evening I'll add the 
2.4.2 tag.

On Monday, March 4, 2013 8:50:31 AM UTC+1, Paolo valleri wrote:
>
> Good works, I will try it later today.
> I don't know if you have already discussed about that, just in case, I 
> would suggest to start the use of git tags so it will be easier to update 
> web2py and keep track of the different releases.
>
> Paolo
>
> On Monday, March 4, 2013 7:58:19 AM UTC+1, Massimo Di Pierro wrote:
>>
>> That is not the expected behavior.
>> I will check what is going on but the more info you can provide the 
>> better.
>>
>>
>> On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:
>>>
>>> So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I 
>>> click the 'Check for Upgrades' button in the admin dashboard, I get a 
>>> message 'Unable to check for upgrades' that replaces the button, and is a 
>>> link to web2py.com.
>>>
>>> Is that the expected behavior?
>>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.