[web2py] Re: How to upload an image from React Native to Web2py?

2017-03-22 Thread Mika Sjöman
Yeah, I am back at it now. But I still dont seem to be able to save the 
object. Any ideas on how to save this object? I have tried and tried but I 
am just not able to save it :(

// Mika

On Tuesday, March 14, 2017 at 11:20:16 AM UTC+1, Leonel Câmara wrote:
>
> Mika just because you've uploaded the file it doesn't mean web2py has 
> saved it to disk. You always get that string because you are printing it 
> which calls the __str__ method in stuff which returns a string.  
>
> The file is not anywhere on disk when it comes to web2py until you 
> actually write it there. The file is in the request in a cgi.FieldStorage 
> object.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: How to upload an image from React Native to Web2py?

2017-03-13 Thread Mika Sjöman
Yes I did both but I kept getting the same output no matter what I did.

//Cheers

Den 14 mars 2017 00:18 skrev "Dave S" :

>
>
> On Monday, March 13, 2017 at 2:51:08 PM UTC-7, Mika Sjöman wrote:
>>
>> I tried that (up_file = request.vars['file[]']), but I still just get
>> the String printed out in my console:
>>
>> "FieldStorage('file[]', 'mikasworld.jpg', '\xff\...base64 representation
>> of the image.
>>
>>
> After you got that, did you print up_file.file and up_file.filename?
>
> The strange thing is that the upload seems to go all right, but it never
>> saves the file. If I remember right, uploaded files just appears in the
>> /upload folder once complete, but this doesn't happen here. Strange
>>
>
> Remember that web2py likes to munge the names of the uploaded files, both
> to avoid dangerous names and to limit
>
>
>> I am getting this ouput in my console, so for sure it upload the file and
>> given the request.vars response, it seems like the server is accepting the
>> upload but not saving the file. This is my output during the upload:
>>
>> upload progress: 19.57139819860458%
>> ImageViewer.js:75 upload progress: 39.14279639720917%
>> ImageViewer.js:75 upload progress: 58.71419310569763%
>> ImageViewer.js:75 upload progress: 78.28559279441833%
>> ImageViewer.js:75 upload progress: 97.85698652267456%
>> ImageViewer.js:75 upload progress: 100%
>>
>> Any ideas on why I get a FieldStorage object but not a saved file to disk
>> on the server? Is there any step I need to take after the file has been
>> uploaded that finally saves the file to disk?
>>
>>
>> On Mon, Mar 13, 2017 at 9:23 PM, Leonel Câmara 
>> wrote:
>>
>>> Sorry I assumed you wanted it in the DB you don't want it in the DB. You
>>> can just manipulate the file directly and save it whoever you want, you
>>> have a cgi.FieldStorage in request.vars['file[]'] you can use it to access
>>> the uploaded file.
>>>
>>> up_file = request.vars['file[]']
>>> up_file.file  # will have a file object you can use to read the data and
>>> write it to disk
>>> up_file.filename # wil have the uploaded file filename
>>> [...]
>>>
>> --
>>>
>> --
>> Mvh/Sincerely yours
>>
>> Mika Sjöman
>>
>> Homepage: http://www.omfriheten.com, Learn Chinese at our website:
>> http://www.dominochinese.com
>>
>>
>>
> [google groups doesn't understand sig delimiters.  Pity]
>
> /dps
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/7yCg0huUwXE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Signing in / register from React Native to Web2py?

2017-03-13 Thread Mika Sjöman
Hi

After extensive searching in the forum, docs and the internet, I feel that 
I can post the question here. I am building a React Native application, 
which means I don't have access to localstorage (this is not a web-app) - I 
think that I need to save some kind of login token in my React native state 
variable and re-send it for every request (being my best guess). Other 
implementations I found on the forum uses web-implementations with Angular, 
but since this is not a web-page, I need to handle this using just JS. 

I wonder if anyone here has experience of doing something similar? Is it 
possible to use a POST request using say axios to do something like this 
towards the login/register:

axios.post('myWeb2pyBackend/myapp/user', { username: 'myloginname', password
: 'test2' }) .then(function (response) { console.log(response); // if OK, 
save some token to state and resend with every GET request later }) .catch(
function (error) { console.log(error); });

Observe that this is Node.js that doesn't have access to the browser window 
variable or any other browser specific thing like localstorage. Would it be 
possible to get a JSON web token as a response from web2py that I resend to 
the server when the user asks for other resources which requires a signed 
in user? 

Cheers

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: How to upload an image from React Native to Web2py?

2017-03-13 Thread Mika Sjöman
I tried that (up_file = request.vars['file[]']), but I still just get the
String printed out in my console:

"FieldStorage('file[]', 'mikasworld.jpg', '\xff\...base64 representation of
the image.

The strange thing is that the upload seems to go all right, but it never
saves the file. If I remember right, uploaded files just appears in the
/upload folder once complete, but this doesn't happen here. Strange
I am getting this ouput in my console, so for sure it upload the file and
given the request.vars response, it seems like the server is accepting the
upload but not saving the file. This is my output during the upload:

upload progress: 19.57139819860458%
ImageViewer.js:75 upload progress: 39.14279639720917%
ImageViewer.js:75 upload progress: 58.71419310569763%
ImageViewer.js:75 upload progress: 78.28559279441833%
ImageViewer.js:75 upload progress: 97.85698652267456%
ImageViewer.js:75 upload progress: 100%

Any ideas on why I get a FieldStorage object but not a saved file to disk
on the server? Is there any step I need to take after the file has been
uploaded that finally saves the file to disk?


On Mon, Mar 13, 2017 at 9:23 PM, Leonel Câmara 
wrote:

> Sorry I assumed you wanted it in the DB you don't want it in the DB. You
> can just manipulate the file directly and save it whoever you want, you
> have a cgi.FieldStorage in request.vars['file[]'] you can use it to access
> the uploaded file.
>
> up_file = request.vars['file[]']
> up_file.file  # will have a file object you can use to read the data and
> write it to disk
> up_file.filename # wil have the uploaded file filename
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/7yCg0huUwXE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-- 
Mvh/Sincerely yours

Mika Sjöman

Homepage: http://www.omfriheten.com, Learn Chinese at our website:
http://www.dominochinese.com

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: How to upload an image from React Native to Web2py?

2017-03-13 Thread Mika Sjöman
Hi

Yes it is a React Native mobile app :)  Since it is using native iOS
components, it is not possible to right-click and look at the DOM (it
doesn't have one because it is not a web page rendered inside a web-view).
Neither can I look at the network tab, because I only get a bridge to the
console by using the React Native debugger. I guess it is using the
javascript bridge from native iOS/Andriod back to react-native to send
messages back and forth. I can't monitor network traffic by using the
Chrome Webtools.

The strange thing is that I do get a response using my code that there is a
storage object, but there isnt any file on my disk with the name shown in
the response. I also thought that since I am getting a 200 response and I
am getting a Storage object, that it would be saved to disk - but that
doesn't seem to be the case :( So it... confuses me...

On Mon, Mar 13, 2017 at 8:26 PM, Dave S  wrote:

>
>
> On Monday, March 13, 2017 at 12:10:32 PM UTC-7, Mika Sjöman wrote:
>>
>> Hi and thanks :)
>>
>> Ill try that later. But I need to keep the image outside of the db (not
>> in a blob field), and only keep a reference to the location of the image on
>> the disk. I am going to run a python script on the image I am uploading to
>> do OCR analysis triggered by the Scheduler, so I need the image on the
>> disk. How can I move the image to somewhere on the disk instead of saving
>> it in the db?
>>
>> Cheers
>>
>
>
> We may need to know more about your React Native tool.  If you were using
> the Web2Py upload support, it would (unless told otherwise) end up in a
> file, and whether you used defaults or specified a location you'd know
> where that file was.  It might help to look at the network traffic for the
> uploads, and see what URL the post is using.  (The browser's DevTools
> console should have a Network tab.  You can get to the console via
> right-click->inspect element on the page you're using.)
>
> I've had the briefest intro to React, so I don't know much about your
> component.
>
> Is this a mobile app, BTW?
>
> /dps
>
>
>
>>
>> On Monday, March 13, 2017 at 5:42:07 PM UTC+1, Leonel Câmara wrote:
>>>
>>> Something like this should work (I haven't tested it).
>>>
>>> # Model
>>> db.define_table('my_uploads',
>>> Field('upload_field', 'upload')
>>> )
>>>
>>>
>>> # Controller
>>> def upload():
>>> """ Store the upload and return an URL to see the new file """
>>> stored_name = db.my_uploads.upload_field.store(request.vars['file[]'
>>> ])  # Note that Field.store works fine with cgi.FieldStorage
>>> db.my_uploads.insert(upload_field=stored_name)
>>> return URL('default', 'download', args=stored_name, scheme=True,
>>> host=True)
>>>
>>>
>>>
>>>
>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/7yCg0huUwXE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-- 
Mvh/Sincerely yours

Mika Sjöman

Homepage: http://www.omfriheten.com, Learn Chinese at our website:
http://www.dominochinese.com

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: How to upload an image from React Native to Web2py?

2017-03-13 Thread Mika Sjöman
Hi and thanks :)

Ill try that later. But I need to keep the image outside of the db (not in 
a blob field), and only keep a reference to the location of the image on 
the disk. I am going to run a python script on the image I am uploading to 
do OCR analysis triggered by the Scheduler, so I need the image on the 
disk. How can I move the image to somewhere on the disk instead of saving 
it in the db?

Cheers

On Monday, March 13, 2017 at 5:42:07 PM UTC+1, Leonel Câmara wrote:
>
> Something like this should work (I haven't tested it).
>
> # Model
> db.define_table('my_uploads',
> Field('upload_field', 'upload')
> )
>
>
> # Controller
> def upload():
> """ Store the upload and return an URL to see the new file """
> stored_name = db.my_uploads.upload_field.store(request.vars['file[]']) 
>  # Note that Field.store works fine with cgi.FieldStorage
> db.my_uploads.insert(upload_field=stored_name)
> return URL('default', 'download', args=stored_name, scheme=True, host=
> True)
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] How to upload an image from React Native to Web2py?

2017-03-12 Thread Mika Sjöman
Hi

I am trying to upload an image from a React Native app to web2py. I am 
using a plugin called react-native-uploader, and when i upload the image I 
get a storage object when I return the request vars using the below code:

def upload:
return response.json({'vars': str(request.vars)})

When I print out the response in my Chrome dev tools, I get the following 
printout:


   1. 
  2. Object
 1. vars:""
 2. __proto__:
 3. 
 
Now I want to do two thing:
1. Move the file to a location accessible from web2py
2. send back a modified name of the file to the React Native client in a 
JSON object.

I have searched like crazy in the Google Group but also the web, but I cant 
find anything on how to do this. Any ideas?

Cheers



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Paypal Recurring Payments? Any experience? Any alternatives?

2014-03-31 Thread Mika Sjöman
Hi

I wonder if anyone here has implemented recurring payments with Paypal here 
with Web2py? Any experience with this and how to implement it?

We currently charge people for lessons with our teachers, but we would like 
to go over to a payment model where we automatically charge the customers 
every month. 

Is there a better way of doing this than Paypal? Market is mostly US and 
China based. 

Cheers

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: Proposal for big but simple improvement: [add view] in IDE view

2013-12-10 Thread Mika Sjöman

Wow that is wonderful! Web2py development will really become way smoother 
with this! I actually really enjoy the online IDE and not working with 
external apps. Fantastic to read that you took this suggestion so seriously 
and started working to implement it. I knew this was not that easy the 
second I wrote it though ;)



On Monday, December 9, 2013 6:18:20 PM UTC+1, Paolo Valleri wrote:
>
> You are right, technically speaking it is true we already have the name of 
> views and we can avoid to ask them again to the users.
> However what you proposed It's not so straightforward  with the current 
> editor structure, I don't say it is impossible. At first sight we should:
>
> 1- migrate the file list sidebar into an indipendent component (currently 
> it is part of the editor page) (backend part)
> 2- for each opened file(tab) stores in a javascript variable the current 
> available views (js)
> 3- periodically or on demand, parse the python file to find the current 
> declared endpoints (js)
> 4- remove from the declared endpoints(discovered in point3) those already 
> available (point 2). (js)
> 5- feed the dropdown menu with those discovered in point4   (js)
> 6- when a new file is created, add the new view to the available 
> views(point3) and update the file list sidebar(point 1).(backend/js)
>
> I start with 1, I can work on the other points in the coming days/week.
>
>
>  Paolo
>
>
> 2013/12/9 Mika Sjöman >
>
>> Well, I was thinking that usually you write the controller first. If you 
>> click an [Add view] button, it could check which functions are missing a 
>> view and give you two options in a popup, or pop-down? (don't know what it 
>> is called);
>>
>> -
>> Add view for function:
>>   [Link: missing_view_function1]
>>   [Link: missing_view_function2]
>>
>> OR add one with name:
>> Name: [  ] [Add View]
>> --
>>
>> Mostly you would just click on the missing view function link and you 
>> would not misspell the file name, which is a quite common error and it 
>> would reduce writing. Also you would not add one by mistake if there is one 
>> already. 
>>
>> // cheers
>>
>>
>>
>>
>> On Monday, December 9, 2013 5:10:20 PM UTC+1, Paolo Valleri wrote:
>>>
>>> It is a good idea that could speed up the initial development phase; 
>>> We could start by implementing some like that: while you edit the 
>>> controller test.py at the top you will get a button 'add view' that when 
>>> clicked creates a file (a view actually) in the directory app/views/test; 
>>> the file name could be get by a dialog. Let me think about that a bit more.
>>>
>>> For the [Add or +] in the file list, if I remember correctly Roberto (in 
>>> CC) has started something a while ago. 
>>>
>>> Paolo
>>>
>>> On Monday, December 9, 2013 4:57:25 PM UTC+1, Mika Sjöman wrote:
>>>>
>>>> Hi
>>>>
>>>> I just noticed watching Massimo's video tutorials, how often we need to 
>>>> open a second tab in Chrome when we want to create a view/controller/model 
>>>> file. It often leads us to get conflicts since we do not want to close the 
>>>> previous (having multiple tabs open we are working on). 
>>>>
>>>> If we could add a view with a button "add view" when looking at a 
>>>> controller and the list of views, we could basically stop opening multiple 
>>>> chrome tabs and also reduce the merges we need to do. 
>>>>
>>>> *Edit views:* view1, view2, [Add view]
>>>>
>>>> Clicking it would open the new text file immediately in another tab. 
>>>>
>>>> It should also reload the files toggle view on the left. An [add or +] 
>>>> button could also be added after each section in the files toggle view to 
>>>> the left, and it would feel really complete. Even though I guess we would 
>>>> still open it sometime, it would reduce the times we need to click Edit 
>>>> link at the top bar. 
>>>>
>>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/JO4PrRnDpnU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Mika Sjöman
Well, I was thinking that usually you write the controller first. If you 
click an [Add view] button, it could check which functions are missing a 
view and give you two options in a popup, or pop-down? (don't know what it 
is called);

-
Add view for function:
  [Link: missing_view_function1]
  [Link: missing_view_function2]

OR add one with name:
Name: [  ] [Add View]
--

Mostly you would just click on the missing view function link and you would 
not misspell the file name, which is a quite common error and it would 
reduce writing. Also you would not add one by mistake if there is one 
already. 

// cheers




On Monday, December 9, 2013 5:10:20 PM UTC+1, Paolo Valleri wrote:
>
> It is a good idea that could speed up the initial development phase; 
> We could start by implementing some like that: while you edit the 
> controller test.py at the top you will get a button 'add view' that when 
> clicked creates a file (a view actually) in the directory app/views/test; 
> the file name could be get by a dialog. Let me think about that a bit more.
>
> For the [Add or +] in the file list, if I remember correctly Roberto (in 
> CC) has started something a while ago. 
>
> Paolo
>
> On Monday, December 9, 2013 4:57:25 PM UTC+1, Mika Sjöman wrote:
>>
>> Hi
>>
>> I just noticed watching Massimo's video tutorials, how often we need to 
>> open a second tab in Chrome when we want to create a view/controller/model 
>> file. It often leads us to get conflicts since we do not want to close the 
>> previous (having multiple tabs open we are working on). 
>>
>> If we could add a view with a button "add view" when looking at a 
>> controller and the list of views, we could basically stop opening multiple 
>> chrome tabs and also reduce the merges we need to do. 
>>
>> *Edit views:* view1, view2, [Add view]
>>
>> Clicking it would open the new text file immediately in another tab. 
>>
>> It should also reload the files toggle view on the left. An [add or +] 
>> button could also be added after each section in the files toggle view to 
>> the left, and it would feel really complete. Even though I guess we would 
>> still open it sometime, it would reduce the times we need to click Edit 
>> link at the top bar. 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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] Proposal for big but simple improvement: [add view] in IDE view

2013-12-09 Thread Mika Sjöman
Hi

I just noticed watching Massimo's video tutorials, how often we need to 
open a second tab in Chrome when we want to create a view/controller/model 
file. It often leads us to get conflicts since we do not want to close the 
previous (having multiple tabs open we are working on). 

If we could add a view with a button "add view" when looking at a 
controller and the list of views, we could basically stop opening multiple 
chrome tabs and also reduce the merges we need to do. 

*Edit views:* view1, view2, [Add view]

Clicking it would open the new text file immediately in another tab. 

It should also reload the files toggle view on the left. An [add or +] 
button could also be added after each section in the files toggle view to 
the left, and it would feel really complete. Even though I guess we would 
still open it sometime, it would reduce the times we need to click Edit 
link at the top bar. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: Online classes

2013-12-08 Thread Mika Sjöman
Hmm... ok.

Thinking ... if it would be possible to use vimeo to integrate into a small 
"learn web2py website". Just need pause points to hide the video 
temporarily and show them again after the user has input commands into a 
text area field and has gotten them verified as correct. We actually do 
almost the same in our compnay, but with short videos at dominochinese.com 
where we teach Chinese using videos and quizzes. Or is this something you 
are planning to do yourself?

Cheers



On Sunday, December 8, 2013 3:26:40 PM UTC+1, Massimo Di Pierro wrote:
>
> It would be great if you could edit the text and cut it into smaller 
> parts. I am not recording it again. ;-)
>
> On Sunday, 8 December 2013 07:03:10 UTC-6, Mika Sjöman wrote:
>>
>> Hi
>>
>> Supper happy to see this! 
>>
>> Two questions: 
>> 1. could you cut them down a bit into smaller sections? 2.5 hour videos 
>> are a little bit too much to take in one time. 20 - 30 minutes max I would 
>> say is my personal attention span, preferably shorter.
>> 2. is it possible to make it more like coursera or udacity? Watch video 
>> (20 min), Practice with a quiz (write some short code to verify that I know 
>> the things), Answer a weekly quiz (after finishing 2.5h of video?).
>>
>> Cheers!
>>
>> On Tuesday, December 3, 2013 7:34:18 AM UTC+1, Massimo Di Pierro wrote:
>>>
>>> Hello everybody,
>>>
>>> As you know I teach a certification program about web development with 
>>> Python and I use web2py. 
>>> I posted my most recent classes online:
>>>
>>> https://vimeo.com/75499986
>>> https://vimeo.com/76047107
>>> https://vimeo.com/76608898
>>> https://vimeo.com/77179700
>>> https://vimeo.com/77654974
>>>
>>> It is about of 13 hours of web2py lessons and coding.
>>> Please join me in thanking the students who enrolled in the program and 
>>> supported these classes.
>>>
>>> Massimo
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: Online classes

2013-12-08 Thread Mika Sjöman
Hi

Supper happy to see this! 

Two questions: 
1. could you cut them down a bit into smaller sections? 2.5 hour videos are 
a little bit too much to take in one time. 20 - 30 minutes max I would say 
is my personal attention span, preferably shorter.
2. is it possible to make it more like coursera or udacity? Watch video (20 
min), Practice with a quiz (write some short code to verify that I know the 
things), Answer a weekly quiz (after finishing 2.5h of video?).

Cheers!

On Tuesday, December 3, 2013 7:34:18 AM UTC+1, Massimo Di Pierro wrote:
>
> Hello everybody,
>
> As you know I teach a certification program about web development with 
> Python and I use web2py. 
> I posted my most recent classes online:
>
> https://vimeo.com/75499986
> https://vimeo.com/76047107
> https://vimeo.com/76608898
> https://vimeo.com/77179700
> https://vimeo.com/77654974
>
> It is about of 13 hours of web2py lessons and coding.
> Please join me in thanking the students who enrolled in the program and 
> supported these classes.
>
> Massimo
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 to measure conversion rate with google analytics?

2013-12-08 Thread Mika Sjöman
I have

But I get no conversion rates at all. Apparently it needs a special goal 
URL in Google Analytics to set up a goal (Bottom left). 

What I did was to set a new column in auth_user.just_registered with 
default value of True. If they come into the system with a True value, they 
get redirected to a success page which then moves them into the normal 
command central page. Quite smooth, and it could probably not be a part of 
web2py since conversion rate is really specific to each website, because 
you will have to figure out what a success is. 

Since this is mostly a standard thing (anybody using analytics and web2py 
would like to measure conversion rate for signups), maybe web2py should 
send all people to a register success page automatically that then 
redirects people to whatever URL they set as the destination.  

Cheers :)



On Sunday, December 8, 2013 8:34:19 AM UTC+1, Christian Foster Howes wrote:
>
> can't you just add google analytics to your site.  from there you can see 
> referrers and funnels and conversions etc. with almost no extra work.
>
> On Friday, December 6, 2013 12:48:31 PM UTC-8, Mika Sjöman wrote:
>>
>> Hi
>>
>> I was wondering if it is possible to measure the conversion rate of how 
>> many people sign up to our service www.dominochinese.com with google 
>> analytics? If I understand it correct, I need to set up a goal URL with 
>> google analytics, but I then wonder how to redirect new users to that URL? 
>> Is there anything built into web2py so the stats become correct? I was just 
>> thinking that if I just redirect people who never signed in, I could 
>> possibly mess things up. 
>>
>> Maybe I could just run a ajax call to the goal URL, if they are missing a 
>> database row value with the name has_signed_in_before? But will this give 
>> me the correct stats? 
>>
>> Also any ideas on how to connect this to an Ad-words campaign?
>>
>> I use both email login and Janrain for people to sign up. 
>>
>> Cheers!
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 measure conversion rate with google analytics?

2013-12-06 Thread Mika Sjöman
Hi

I was wondering if it is possible to measure the conversion rate of how 
many people sign up to our service www.dominochinese.com with google 
analytics? If I understand it correct, I need to set up a goal URL with 
google analytics, but I then wonder how to redirect new users to that URL? 
Is there anything built into web2py so the stats become correct? I was just 
thinking that if I just redirect people who never signed in, I could 
possibly mess things up. 

Maybe I could just run a ajax call to the goal URL, if they are missing a 
database row value with the name has_signed_in_before? But will this give 
me the correct stats? 

Also any ideas on how to connect this to an Ad-words campaign?

I use both email login and Janrain for people to sign up. 

Cheers!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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:27381] Re: MySQL - OperationalError: Error on rename (errno: 150)

2013-08-19 Thread Mika Sjöman
I am still getting allot of the same problems but now in 2013. When working 
on localhost and pushing to pythonanywhere, then I get these MYSQL index 
errors with 150 message. 

The way to solve it has been to add fake_migrate_all=True to the DAL 
connection, but then I can not do any database changes. Any idea on how to 
solve this? I have had this trouble for a week now without being able to 
drop the index from my mysql (web2py auth_user) table. 

Cheers



On Thursday, September 17, 2009 5:04:39 AM UTC+8, David Zejda wrote:
>
> -BEGIN PGP SIGNED MESSAGE- 
> Hash: SHA1 
>
> Here: 
>
> http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html 
>
> they say: "To find out the symbol value when you want to drop a foreign 
> key, use the SHOW CREATE TABLE statement." 
>
> David 
>
> mdipierro napsal(a): 
> > One more reason to have mysql. 
> > 
> > How do we figure out the name of the foreign key from the name of the 
> > table/field? 
> > 
> > Massimo 
> > 
> > 
> > 
> > On Jul 22, 10:10 am, David Zejda  wrote: 
> > Yes, the problem is connected with dropping the index on interrelated 
> > field. If I try to manually 
> > 
> > DROP INDEX field2__idx ON testing4; 
> > 
> > or 
> > 
> > ALTER TABLE testing4 DROP field2; 
> > 
> > i get the error too. I examined the problem more and the result is: 
> > 
> > Field with a FOREIGN KEY can't stay without at least one index defined 
> > on it. But if you remove the relation first: 
> > 
> > ALTER TABLE testing4 DROP FOREIGN KEY testing4_ibfk_1; 
> > 
> > Either the index or the whole field may be removed without error.. 
> > 
> > David 
> > 
> > mdipierro napsal(a): 
> > 
>  OK, I see we have a problem with removing fields that have an index 
>  associated to them. 
>  Can you try remove the index manually and then attempt the migration? 
>  Massimo 
>  On Jul 21, 5:45 pm, Fran  wrote: 
> > On Jul 21, 11:42 pm, Fran  wrote: 
> >> Confirmed. MySQL-5.1.36 with MySQL-python-1.2.2.win32 on 
> Python-2.5.4 
> >> on Windows XP 
> >> OperationalError: (1025, "Error on rename of '.\\db\\#sql-198_4' to 
> '.\ 
> >> \db\\testing4' (errno: 150)") 
> > sql.log doesn't show anything interesting: 
> > timestamp: 2009-07-21T23:39:53.171000 
> > CREATE TABLE ref2( 
> > id INT AUTO_INCREMENT NOT NULL, 
> > name VARCHAR(32), 
> > PRIMARY KEY(id) 
> > ) ENGINE=InnoDB CHARACTER SET utf8; 
> > success! 
> > timestamp: 2009-07-21T23:39:53.75 
> > CREATE TABLE testing4( 
> > id INT AUTO_INCREMENT NOT NULL, 
> > field VARCHAR(32), 
> > field2 INT, INDEX field2__idx (field2), FOREIGN KEY (field2) 
> > REFERENCES ref2(id) ON DELETE CASCADE, 
> > PRIMARY KEY(id) 
> > ) ENGINE=InnoDB CHARACTER SET utf8; 
> > success! 
> > timestamp: 2009-07-21T23:40:27.906000 
> > ALTER TABLE testing4 DROP COLUMN field2; 
> > F 
> > 
> -BEGIN PGP SIGNATURE- 
> Version: GnuPG v1.4.9 (GNU/Linux) 
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org 
>
> iEYEARECAAYFAkqxUucACgkQ3oCkkciamVHUWQCggWwyEIJVBCpfIN5lIOIslQZs 
> cx8An1K/h6PKBtkRbXusmFXQJGlYE23w 
> =ukBM 
> -END PGP SIGNATURE- 
>

-- 

--- 
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: Request: Course about Web2py & TDD + pledge for cash

2013-08-15 Thread Mika Sjöman
Hi looks great.

Why don't you make it a free coursera.org course and add a hundred thousand 
students to your class? I am moving to Sweden so California is a bit far to 
go even though I would love to study in California ;) Also I see UCSC is 
already at Coursera: https://www.coursera.org/ucsc

What I would really like to see in a course is testing getting in from the 
start. This so it becomes less a programming lesson than a how to design 
applications really well. TDD should not be the last chapter, but rather 
one of the first. Otherwise we learn bad practices from start, get lazy, 
write tons of bad code, just to see it blow up in our faces later with mad 
bosses and customers. I am guessing I have written a million lines of code 
that is really that bad until today.

Mostly many of us (read the guys/girls who does not have a CS degree) start 
testing because we finally realize that we have to, or that one of those 
two categories above forces us to do so. 

I really think it is incredibly sad that programming courses mostly skip 
these subjects, when well written code requires testing and systematic 
approach/following design recipes. For me it feels a bit like being in 
highschool just to suddenly find out that my math teacher forgot to teach 
me division all the way.

Web2py is already super simple to learn, so why not teach it with a 
systematic programming recipes and testing from the start? All the way 
trough. It would make the students think like engineers instead of 
tinkers/hackers/coders just randomly writing code to get "stuff" done. 
Doing this from the start does not make it more difficult to learn. It 
makes people solve problems easier because they can use a systematic 
approach to solving the problems. Having the systematic approach removes 
hassle of the code mess blurring out the learning task. 

Cheers!


On Wednesday, August 14, 2013 1:36:45 AM UTC+8, Luca wrote:
>
> Dear Michael, 
>
> last year's class web page is here, and all is accessible mostly by 
> everybody.  There may be videos that, as they include students and did not 
> have all permissions, are accessible only from UCSC, but the rest should be 
> wide open. 
> This year will be similar, perhaps with more emphasis on angular. 
>
>
> https://sites.google.com/a/ucsc.edu/luca/classes/cmps-183-hypermedia-and-the-web/cmps-183-fall-2012
>
> Luca
>
> On Monday, August 12, 2013 7:23:08 PM UTC-7, Michael Herman wrote:
>>
>> I'd love to hear more about your curriculum that you're going to be 
>> teaching. I wrote the course Real Python for the Web @ RealPython.com. I'd 
>> love to compare notes. :)
>>  
>>
>> On Mon, Aug 12, 2013 at 6:53 PM, Luca  wrote:
>>
>>> I will be teaching a web dev class at UCSC based on web2py, and I may 
>>> make the videos available in YouTube.  
>>> Starting around September 20. 
>>> Email me if you are interested - lu...@ucsc.edu
>>>
>>> Thanks! -Luca
>>>
>>> On Sunday, August 11, 2013 10:29:46 AM UTC-7, Mika Sjöman wrote:
>>>>
>>>> Hi
>>>>
>>>> I am trying to get started with TDD and web2py, but it is really hard 
>>>> since I do not have a CS degree. I have been studying this two courses at 
>>>> Coursera, and especially the former is awesome (I did not like the Intro 
>>>> to 
>>>> Systematic program design so much)
>>>>
>>>> https://class.coursera.org/**programming2-001/<https://class.coursera.org/programming2-001/>
>>>>   # LTHP How to write quality code - awesome!
>>>> https://class.coursera.org/**programdesign-001/class/index<https://class.coursera.org/programdesign-001/class/index>
>>>>  #Systematic program design
>>>>
>>>> I just wanted to say that if anyone out there is thinking of writing a 
>>>> book or video course, I would certainly pay for it! Preferably a Udemy 
>>>> course that shows how to do functional testing, unit testing, front end 
>>>> Selenium, integration testing, proper cashing techniques for fast webites 
>>>> etc. Preferably with TDD or some other framework, building lets say 3 to 4 
>>>> small simple projects from scratch. 
>>>>
>>>> I am really sick and tired of writing code that blows up. While web2py 
>>>> gave me an awesome way to easily write code and get going, I have not made 
>>>> much progress writing better quality code with web2py. I think too much 
>>>> time has been spent on learning to program (the language / frameworks), 
>>>> while the problem for me has always been not being able to do proper 
>>>>

[web2py] Request: Course about Web2py & TDD + pledge for cash

2013-08-11 Thread Mika Sjöman
Hi

I am trying to get started with TDD and web2py, but it is really hard since 
I do not have a CS degree. I have been studying this two courses at 
Coursera, and especially the former is awesome (I did not like the Intro to 
Systematic program design so much)

https://class.coursera.org/programming2-001/   # LTHP 
How to write quality code - awesome!
https://class.coursera.org/programdesign-001/class/index  #Systematic 
program design

I just wanted to say that if anyone out there is thinking of writing a book 
or video course, I would certainly pay for it! Preferably a Udemy course 
that shows how to do functional testing, unit testing, front end Selenium, 
integration testing, proper cashing techniques for fast webites etc. 
Preferably with TDD or some other framework, building lets say 3 to 4 small 
simple projects from scratch. 

I am really sick and tired of writing code that blows up. While web2py gave 
me an awesome way to easily write code and get going, I have not made much 
progress writing better quality code with web2py. I think too much time has 
been spent on learning to program (the language / frameworks), while the 
problem for me has always been not being able to do proper software 
engineering. 

So here is a pledge. If any of you good TDD programmers do a small video 
course on writing web2py software with TDD, Selenium, version control etc, 
then Ill be happy to chip in 50 USD for such a course. How about a 
Udemy.com course? Here is the guide to get 
started: https://www.udemy.com/official-udemy-instructor-course/
For inspiration about topics I really reccomend looking at that LHTP 
Writing Quality Code at Coursera. 


Anyone else interesting in pledging cash to learn proper software design 
with Web2py? Maybe someone can make it a kickstarter?

-- 

--- 
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: accounting appliance

2013-08-08 Thread Mika Sjöman
Hi

Did you do anything about this? I really need an accounting appliance but 
it seems I have to write one myself if not convering some other project.

cheers

On Thursday, June 3, 2010 9:48:11 AM UTC+8, Jim Karsten wrote:
>
> I am considering developing a web2py small business Accounting 
> application but I thought I check to see if anyone has created 
> something already. I'm looking for General Ledger, Receivables and 
> Payables, and possibly payroll. 
>
> Anyone know of such an appliance or of someone developing one?

-- 

--- 
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: onvalidate fails with compute=lambda field

2013-08-03 Thread Mika Sjöman
Thanks!

On Friday, August 2, 2013 9:48:49 PM UTC+8, Anthony wrote:
>
> You mean you get an error when inserting duplicate data? Note, unique=True 
> is enforced by the database, not web2py, so violating it will simply result 
> in a database error (which results in a web2py ticket if you don't 
> explicitly catch the error yourself). Instead, you want to use the 
> IS_NOT_IN_DB validator on that field -- that will result in an error 
> message being displayed on the form.
>
> Anthony
>
> On Friday, August 2, 2013 4:10:15 AM UTC-4, Mika Sjöman wrote:
>>
>> hi
>>
>> Got this field, to make sure that a booking is unique. 
>>
>> Field('booking_hash', unique=True, compute=lambda r: 
>> make_secure_val(str(r['bo_teacher_id']) + str(r['bo_lesson_date']) + 
>> str(r['bo_start_lesson_time'])+ str(r['bo_student_id']) )),
>>
>> Instead of getting an error poping up saying the record is not unique, I 
>> get a web2py error page. Anyone know how to solve this? This is my form:
>>
>> form = SQLFORM(db.booking)
>> if form.accepts(request.vars, session):
>> response.flash = T('yes')
>> response(URL('booking_sent', vars={'booking':'[id]'}))
>>
>> Cheers!
>>
>

-- 

--- 
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] onvalidate fails with compute=lambda field

2013-08-02 Thread Mika Sjöman
hi

Got this field, to make sure that a booking is unique. 

Field('booking_hash', unique=True, compute=lambda r: 
make_secure_val(str(r['bo_teacher_id']) + str(r['bo_lesson_date']) + 
str(r['bo_start_lesson_time'])+ str(r['bo_student_id']) )),

Instead of getting an error poping up saying the record is not unique, I 
get a web2py error page. Anyone know how to solve this? This is my form:

form = SQLFORM(db.booking)
if form.accepts(request.vars, session):
response.flash = T('yes')
response(URL('booking_sent', vars={'booking':'[id]'}))

Cheers!

-- 

--- 
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 and WebRTC?

2013-07-27 Thread Mika Sjöman
Hi

I would like the users of my website to communicate with video without 
using Skype etc. I am currently using pythonanywhere as my host, and they 
do not permit using node.js, so I can not 
use https://github.com/henrikjoreteg/SimpleWebRTC 

Is there any other way you guys know of that I could use to easily add 
WebRTC to the webpage? Anyone wrote a plugin for that? Anything I should 
know before jumping into it?

Cheers

-- 

--- 
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] Move from VPS to Cloud? Too big to pack

2013-06-16 Thread Mika Sjöman
Hi

I want to move my website from a VPS to Pythonanywhere. The problem is that 
my webpage has some houndred megabytes of video material so packing it just 
ends up in a python error "internal error: requested number of bytes is 
more than a Python string can hold"

Is there another way I can move from my Ubuntu/MySQL/Apache server to 
Pythonanywhere? Like a commandline packing and then pushing it with git/hg 
or something? Is there any pitfalls that I should be aware of? What are the 
steps? Would this work?

1. use HG of two folders; init folder and static web2py folder. Pull to 
local machine from VPS.
2. make a db backup of databases 
3. getting the DB backups to pythonanywhere. Any ideas on how to do this?
4. pushing the files to pythonanywhere? Not much a hacker, so any proposals 
on how to do this? I just know how to first pull and then push to the 
server I pulled from. 

Would this work?

Cheers

-- 

--- 
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] dropbox integration not working for me, any ideas?

2013-05-29 Thread Mika Sjöman
Hi

Tried using the instructions from 
http://www.web2py.com/books/default/chapter/29/14#Dropbox-API

The typo there has not been fixed yet; 

use_janrain(auth,filename='private/dropbox.key') should be 
use_dropbox(auth,filename='private/dropbox.key')

But anyways, I got it working, but now when I try using it, I just get this 
error:

 'NoneType' object is unsubscriptable Version  
web2py™ Version 2.4.7-stable+timestamp.2013.05.24.17.48.47  Python Python 
2.6.5: /usr/bin/python (prefix: /usr)  Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/init/controllers/default.py" 
, 
line 267, in 
  File "/home/www-data/web2py/gluon/globals.py", line 194, in 
self._caller = lambda f: f()
  File "/home/www-data/web2py/applications/init/controllers/default.py" 
, 
line 36, in get_dropbox_file
stream = mydropbox.get('localfile.txt')
  File "/home/www-data/web2py/gluon/contrib/login_methods/dropbox_account.py", 
line 111, in get
if not hasattr(self,'client'): self.get_client()
  File "/home/www-data/web2py/gluon/contrib/login_methods/dropbox_account.py", 
line 103, in get_client
self.sess.set_token(access_token[0], access_token[1])
TypeError: 'NoneType' object is unsubscriptable


The thing is I have a file called localfile.txt in the folder i am trying to 
access. Any ideas what I am doing wrong?

Cheers

-- 

--- 
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: Error importing dropbox_account module

2013-05-29 Thread Mika Sjöman
a tip would be to include that reference into the documentation where you 
present the Dropbox API 

http://www.web2py.com/books/default/chapter/29/14#Dropbox-API

Found it with a google search, but still :)

cheers

On Sunday, October 7, 2012 10:42:22 PM UTC+8, Massimo Di Pierro wrote:
>
> You need to install:
>
> https://github.com/enginous/python-dropbox
>
> On Sunday, 7 October 2012 06:17:20 UTC-5, rogier wrote:
>>
>> L.S.
>>
>> On both my pythonanywhere and my local web2py instance I seem to be 
>> unable to import the dropbox module from gluon.
>>
>> When incorporating this code in db.py
>> from gluon.contrib.login_methods.dropbox_account import use_dropbox
>> use_janrain(auth,filename='private/dropbox.key')
>> mydropbox = auth.settings.login_form
>>
>> my application issues me a ticket stating:
>>  No module named 
>> gluon.contrib.login_methods.dropbox_account
>>
>> and trying a plain import in my local python console results in :
>> ImportError: No module named dropbox
>>
>> The dropbox_account files (py and pyc) are present in the appropriate 
>> folder, so what am I doing wrong?
>>
>> kind regards
>> Rogier
>>
>>

-- 

--- 
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: Dropboxing movies into Web2py Server?

2013-05-26 Thread Mika Sjöman
Yes but how do I import the video into a field of web2py? 

I look in my app and it does not get inside my app folder - so where does 
it go? Say for example I download the movie via the Dropbox API, how do I 
then add it to my "video"
 table?

Cheers

On Monday, May 27, 2013 4:02:55 AM UTC+8, Niphlod wrote:
>
> if I understood correctly what you need is just something that updates a 
> table whenever a new file pops up into your dropbox folder (that receives 
> yet the files).
> Just schedule something that lists all contents of a directory and update 
> your table accordingly, let's say every minute.
> Scheduler can fit the bill, cause you'll be sure to have just one running 
> process that takes care of it.
> If you want a more refined solution ubuntu has filesystem notifications, 
> so hooking up with something like 
> https://pypi.python.org/pypi/watchdogwouldn't be difficult.
>
> On Sunday, May 26, 2013 9:09:32 PM UTC+2, Alan Etkin wrote:
>>
>> We are trying to set up our production flow so that the guys making small 
>>> instructional movies will automatically upload them to our server with 
>>> dropbox. My question is how I can get those movies into a database 
>>> automatically with the filename as the description into a 
>>> Field('Description') of our videos table? Does anyone have an idea of how 
>>> we can make somthing like this a reality?
>>>
>>
>> For using dropbox services from web2py apps, there's a recipe in the 
>> manual
>>
>> http://www.web2py.com/books/default/chapter/29/14#Dropbox-API
>>
>> If you want a video database integrated with slides and subtitles, try 
>> this app:
>>
>> http://code.google.com/p/video2py
>>
>>

-- 

--- 
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: Dropboxing movies into Web2py Server?

2013-05-26 Thread Mika Sjöman
Hi thanks for that dropbox info! Really helpful!

When it comes down to showing video at one side and presentation at another 
it is actually not so smart as people think. The brain has to take the 2D 
picture of the person and convert it to a 3D picture when it sees a face. 
Presenting material at the same time, overloads the brain and reduces 
learning (so it looks great but reduces learning). The great thing with for 
example Khan academy was that he took himself out of the picture and let 
students brains only focus on the material and his presentation. So 
video2py is not really for us. But thanks for the tip!

cheers



On Monday, May 27, 2013 3:09:32 AM UTC+8, Alan Etkin wrote:
>
> We are trying to set up our production flow so that the guys making small 
>> instructional movies will automatically upload them to our server with 
>> dropbox. My question is how I can get those movies into a database 
>> automatically with the filename as the description into a 
>> Field('Description') of our videos table? Does anyone have an idea of how 
>> we can make somthing like this a reality?
>>
>
> For using dropbox services from web2py apps, there's a recipe in the manual
>
> http://www.web2py.com/books/default/chapter/29/14#Dropbox-API
>
> If you want a video database integrated with slides and subtitles, try 
> this app:
>
> http://code.google.com/p/video2py
>
>

-- 

--- 
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: Dropboxing movies into Web2py Server?

2013-05-26 Thread Mika Sjöman
forgot to add that our server is a ubuntu server...

Cheers

On Monday, May 27, 2013 1:52:59 AM UTC+8, Mika Sjöman wrote:
>
> Hi
>
> We are trying to set up our production flow so that the guys making small 
> instructional movies will automatically upload them to our server with 
> dropbox. My question is how I can get those movies into a database 
> automatically with the filename as the description into a 
> Field('Description') of our videos table? Does anyone have an idea of how 
> we can make somthing like this a reality?
>
> Cheers
>

-- 

--- 
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] Dropboxing movies into Web2py Server?

2013-05-26 Thread Mika Sjöman
Hi

We are trying to set up our production flow so that the guys making small 
instructional movies will automatically upload them to our server with 
dropbox. My question is how I can get those movies into a database 
automatically with the filename as the description into a 
Field('Description') of our videos table? Does anyone have an idea of how 
we can make somthing like this a reality?

Cheers

-- 

--- 
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.7 is Out

2013-05-26 Thread Mika Sjöman
I agree 

I think it confuses people allot who are starting with web2py since many 
try to use online themes, but they break because web2py uses an old version 
of bootstrap.

Cheers

On Sunday, May 26, 2013 7:33:59 PM UTC+8, LightDot wrote:
>
> This should fix it nicely.
>
> Btw, I see jQuery 1.10.0 has been included in the trunk. This would 
> probably be a good moment to also upgrade Bootstrap to 2.3.2. Should be a 
> drop-in replacement for 2.2.2.
>
> Regards,
> Ales
>
> On Sunday, May 26, 2013 10:58:08 AM UTC+2, Niphlod wrote:
>>
>> in hg to delete a bookmark
>>
>> hg tag --remove 
>>
>>
>> in git instead its
>>
>> git tag -d 
>> git push origin :refs/tags/
>>
>>
>>
>> PS: github doesn't hold the new tag name yet. To propagate tags you have 
>> to issue 
>> git push origin --tags
>>
>> On Saturday, May 25, 2013 10:59:36 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> I re-tagged trunk. I will post 2.4.8 asap since I am not sure how to 
>>> remove a tag.
>>>
>>> On Saturday, 25 May 2013 12:51:51 UTC-5, LightDot wrote:

 On a more serious note, release tag in mercurial and git states 
 R-2.7.4, should be R-2.4.7... Should this be fixed to prevent any future 
 confusion?

 Regards,
 Ales


 On Friday, May 24, 2013 7:56:11 PM UTC+2, Massimo Di Pierro wrote:
>
> I posted web2py 2.4.7. Includes mostly bug fixes.



-- 

--- 
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] can not migrate MySQL when deleting referenced field?

2013-05-21 Thread Mika Sjöman
Hi

Does anyone know how to delete a reference field from MySQL? I get an error 
from MySQL when I try to remove the field from the table 


 going from:

db.define_table('tecken',
Field('hsk_level',type='list:string'),
Field('streak_id', type='reference streak', writable=True))

### To:

db.define_table('tecken',
Field('hsk_level',type='list:string'))

This is the error I get:

 (1025, "Error on rename of 
'./dominochinese/#sql-7bc_b1' to './dominochinese/tecken' (errno: 150)")

-- 

--- 
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: Testing your app using py.test

2013-05-19 Thread Mika Sjöman
Hi

I really badly want to get into testing because right now I have an 
application breaking all the time because we do manual QA. Is there any 
video guide on selenium with web2py, except the one at 
killerwebdevelopment.com, because I could not get selenium working when I 
tried. 

I would really like to get started with selenium but it seems so difficult 
to get started. 

Cheers

On Saturday, May 18, 2013 6:54:21 PM UTC+8, Arnon Marcus wrote:
>
> Here is a really great talk about testing in general, ans testing web-apps 
> in particular:
>
> http://www.infoq.com/presentations/Selenium
>

-- 

--- 
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: Minify (compress) response HTML

2013-05-19 Thread Mika Sjöman
So how do I turn minify on? I can not find any info and I really need my 
pages to be as small as possible because my users like speed. 

Cheers

On Monday, February 6, 2012 11:25:17 AM UTC+8, Kernc wrote:
>
> On Feb 3, 6:07 am, Massimo Di Pierro  
> wrote: 
> > OK, let's add a minifier in contrib. 
>
> 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] hi any webchat web2py apps?

2013-05-16 Thread Mika Sjöman
Hi

We wish to add a button on our frontpage that will enable users to contact 
us via a webchat, something like this> http://mibew.org/demo.php

But we do not want a PHP solution, do you know of any web2py solution?

cheers

-- 

--- 
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: JQUERY as response in Ajax call?

2013-05-11 Thread Mika Sjöman
I was just thinking, would it not be smarter to have a FORM helper with an 
ajax option?

something like this:

FORM(ajax=True, eval=True, target='targetdiv/object')

To be honest almost half of my form posts are ajax now, so it feels wiered 
that I can not just choose if it is ajax when creating the form with the 
FORM helper. And the reason I do not do it more is because of the overhead 
and complexity of the code that increases for every form I need to write. I 
would even like to have a crud.create form that I could choose as an ajax 
form reducing ajax forms to a couple of lines of code in my controler 
instead of writing them in the view.

cheers and thanks!


On Saturday, May 11, 2013 5:18:13 PM UTC+8, Mika Sjöman wrote:
>
> that one worked like a charm. Final solution became like this, where the 
> submit buttons is kind of there just for looks since it will send onkeyUp.
>
> What I really like about it is that It reduces the JQuery to zero for my 
> part to write which means less code to manage.
>
> -SOLUTION ---
>
> 
> Mobile Phone:
>  onkeyup="ajax('{{=URL('update_phone_number')}}', ['phone'], ':eval')" />
>  onClick="ajax('{{=URL('update_phone_number')}}', ['phone'], ':eval')" 
> value="Add phone number" class="btn btn-success"/>
> 
>
>
>
> On Friday, May 10, 2013 7:26:40 PM UTC+8, Anthony wrote:
>>
>> http://web2py.com/books/default/chapter/29/11#Eval-target
>>
>> On Friday, May 10, 2013 6:13:23 AM UTC-4, Mika Sjöman wrote:
>>>
>>> Hi
>>>
>>> No I am not calling it from a component, but from a jQuery post when I 
>>> submit a phone number from a post via ajax.
>>>
>>> Any ideas?
>>>
>>> On Friday, May 10, 2013 2:49:33 PM UTC+8, Niphlod wrote:
>>>>
>>>> if you're using components, use response.js .
>>>> http://web2py.com/books/default/chapter/29/12?search=response.js
>>>>
>>>> On Friday, May 10, 2013 7:10:31 AM UTC+2, Mika Sjöman wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> I am trying to close a window title dialog with JQUERY after 
>>>>> sucessuflly updating a clients phone number. The problem is that after I 
>>>>> successfully update the data I send this as a response to the browser: 
>>>>>
>>>>> 
>>>>> message = "jQuery('#windowTitleDialog').toggle('slow');"
>>>>> return message
>>>>>
>>>>>
>>>>> But the script just loads it as text in a DIV instead of executing the 
>>>>> Jquery :( 
>>>>>
>>>>> The way I call it is like this from the webbrowser:
>>>>>
>>>>> 
>>>>> jQuery('#update_phone_number').submit(function() {
>>>>>   ajax('{{=URL('update_phone_number')}}', ['phone',], 
>>>>> 'phone_updated_div');
>>>>>   return false;
>>>>> });
>>>>>  
>>>>>
>>>>> Anyone has an idea on how to run the JQUERY instead of just loding it 
>>>>> as text inside the phone_updated_div ?
>>>>>
>>>>> cheerio
>>>>>
>>>>

-- 

--- 
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: JQUERY as response in Ajax call?

2013-05-11 Thread Mika Sjöman
that one worked like a charm. Final solution became like this, where the 
submit buttons is kind of there just for looks since it will send onkeyUp.

What I really like about it is that It reduces the JQuery to zero for my 
part to write which means less code to manage.

-SOLUTION ---


Mobile Phone:






On Friday, May 10, 2013 7:26:40 PM UTC+8, Anthony wrote:
>
> http://web2py.com/books/default/chapter/29/11#Eval-target
>
> On Friday, May 10, 2013 6:13:23 AM UTC-4, Mika Sjöman wrote:
>>
>> Hi
>>
>> No I am not calling it from a component, but from a jQuery post when I 
>> submit a phone number from a post via ajax.
>>
>> Any ideas?
>>
>> On Friday, May 10, 2013 2:49:33 PM UTC+8, Niphlod wrote:
>>>
>>> if you're using components, use response.js .
>>> http://web2py.com/books/default/chapter/29/12?search=response.js
>>>
>>> On Friday, May 10, 2013 7:10:31 AM UTC+2, Mika Sjöman wrote:
>>>>
>>>> Hi
>>>>
>>>> I am trying to close a window title dialog with JQUERY after 
>>>> sucessuflly updating a clients phone number. The problem is that after I 
>>>> successfully update the data I send this as a response to the browser: 
>>>>
>>>> 
>>>> message = "jQuery('#windowTitleDialog').toggle('slow');"
>>>> return message
>>>>
>>>>
>>>> But the script just loads it as text in a DIV instead of executing the 
>>>> Jquery :( 
>>>>
>>>> The way I call it is like this from the webbrowser:
>>>>
>>>> 
>>>> jQuery('#update_phone_number').submit(function() {
>>>>   ajax('{{=URL('update_phone_number')}}', ['phone',], 
>>>> 'phone_updated_div');
>>>>   return false;
>>>> });
>>>>  
>>>>
>>>> Anyone has an idea on how to run the JQUERY instead of just loding it 
>>>> as text inside the phone_updated_div ?
>>>>
>>>> cheerio
>>>>
>>>

-- 

--- 
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: jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Mika Sjöman
Looks like a great solution! Thanks!!

// mika

On Friday, May 10, 2013 9:42:46 PM UTC+8, Anthony wrote:
>
> It's not quite clear what your HTML looks like -- are you saying you have 
> multiple forms (i.e., ) with the same web2py formname (i.e., 
> same value in the hidden _formname field)? Or do you just have multiple 
>  elements with the same names (perhaps in separate forms, or outside 
> of forms altogether)?
>
> Anyway, I don't think it's documented, but instead of passing an array of 
> input names as the second argument to ajax(), you can instead pass any 
> jQuery selector that identifies either an entire form or any set of form 
> input elements (within a single form or across multiple forms). For 
> example, if you have:
>
> 
>   
> 
> 
>   
> 
>
> you can do:
>
> ajax('/my/url', '#myform', ...)  // all input elements in #myform
> ajax('/my/url', '#mydiv form', ...)   // all input elements in all forms 
> within #mydiv
> ajax('/my/url', '#mydiv input', ...)  // all input elements within #mydiv 
> (whether or not in a form)
> ajax('/my/url', '#mydiv [name=myinput1]', ...)  // just the myinput1 
> input within #mydiv
> ajax('/my/url', '#mydiv [name=myinput1], [name=myinput2]', ...)  // 
> multiple specific inputs
> ajax('/my/url', '[name=myinput1]', ...)  // all inputs on the page with 
> name 'myinput1'
>
> That last one is equivalent to the usual behavior when you specify just an 
> array of input names (i.e., ajax(..., ['myinput1'], ...)).
>
> Anthony
>
> On Friday, May 10, 2013 6:27:11 AM UTC-4, Mika Sjöman wrote:
>>
>> Hi
>>
>> I am having a problem because my forms are getting sent with multiple 
>> values. The issue is that on my page there are multiple places where the 
>> same formnames are used. So the post vars becomes like this:
>>
>> Parametersapplication/x-www-form-urlencoded
>> answer280lesson75lesson75lesson75player_answer
>> quiz96quiz96streak7streak7streak7
>> Source
>>
>> player_answer=&answer=280&streak=7&streak=7&streak=7&quiz=96&quiz=96&lesson=75&lesson=75&lesson=75
>> The above is created by>
>>
>> jQuery('#add_quiz_option').submit(function() {
>>   ajax('{{=URL(c='quiz',f='add_inline_answer')}}',
>>['description', 'is_correct', 'quiz', 'streak', 
>> 'lesson'], 'quiz_answers');
>>   return false;
>> });
>>
>> On the server I could do a check if they are lists and then chop them 
>> down, but that is REALLY messy. Is this a design flaw from my perspective 
>> or is there a way to solve this better than renaming the vars and them 
>> renaming them to the matching corresponding database field names when the 
>> function receives the request.vars?
>>
>> Starting to get really messy in my code now because I use ajax/jquery 
>> calls allot. I could rename the form names, but that forces me to rename 
>> them again after I receive them at the server. Is there a simple way to 
>> tell jQuery to only use the values from a specific FORM-name so it will not 
>> send the same value 5 times?
>>
>> Cheers
>>
>

-- 

--- 
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] jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Mika Sjöman
Hi

I am having a problem because my forms are getting sent with multiple 
values. The issue is that on my page there are multiple places where the 
same formnames are used. So the post vars becomes like this:

Parametersapplication/x-www-form-urlencoded
answer280lesson75lesson75lesson75player_answer
quiz96quiz96streak7streak7streak7
Source
player_answer=&answer=280&streak=7&streak=7&streak=7&quiz=96&quiz=96&lesson=75&lesson=75&lesson=75
The above is created by>

jQuery('#add_quiz_option').submit(function() {
  ajax('{{=URL(c='quiz',f='add_inline_answer')}}',
   ['description', 'is_correct', 'quiz', 'streak', 
'lesson'], 'quiz_answers');
  return false;
});

On the server I could do a check if they are lists and then chop them down, 
but that is REALLY messy. Is this a design flaw from my perspective or is 
there a way to solve this better than renaming the vars and them renaming 
them to the matching corresponding database field names when the function 
receives the request.vars?

Starting to get really messy in my code now because I use ajax/jquery calls 
allot. I could rename the form names, but that forces me to rename them 
again after I receive them at the server. Is there a simple way to tell 
jQuery to only use the values from a specific FORM-name so it will not send 
the same value 5 times?

Cheers

-- 

--- 
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: JQUERY as response in Ajax call?

2013-05-10 Thread Mika Sjöman
Hi

No I am not calling it from a component, but from a jQuery post when I 
submit a phone number from a post via ajax.

Any ideas?

On Friday, May 10, 2013 2:49:33 PM UTC+8, Niphlod wrote:
>
> if you're using components, use response.js .
> http://web2py.com/books/default/chapter/29/12?search=response.js
>
> On Friday, May 10, 2013 7:10:31 AM UTC+2, Mika Sjöman wrote:
>>
>> Hi
>>
>> I am trying to close a window title dialog with JQUERY after sucessuflly 
>> updating a clients phone number. The problem is that after I successfully 
>> update the data I send this as a response to the browser: 
>>
>> 
>> message = "jQuery('#windowTitleDialog').toggle('slow');"
>> return message
>>
>>
>> But the script just loads it as text in a DIV instead of executing the 
>> Jquery :( 
>>
>> The way I call it is like this from the webbrowser:
>>
>> 
>> jQuery('#update_phone_number').submit(function() {
>>   ajax('{{=URL('update_phone_number')}}', ['phone',], 
>> 'phone_updated_div');
>>   return false;
>> });
>>  
>>
>> Anyone has an idea on how to run the JQUERY instead of just loding it as 
>> text inside the phone_updated_div ?
>>
>> cheerio
>>
>

-- 

--- 
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] JQUERY as response in Ajax call?

2013-05-09 Thread Mika Sjöman
Hi

I am trying to close a window title dialog with JQUERY after sucessuflly 
updating a clients phone number. The problem is that after I successfully 
update the data I send this as a response to the browser: 


message = "jQuery('#windowTitleDialog').toggle('slow');"
return message


But the script just loads it as text in a DIV instead of executing the 
Jquery :( 

The way I call it is like this from the webbrowser:


jQuery('#update_phone_number').submit(function() {
  ajax('{{=URL('update_phone_number')}}', ['phone',], 
'phone_updated_div');
  return false;
});
 

Anyone has an idea on how to run the JQUERY instead of just loding it as 
text inside the phone_updated_div ?

cheerio

-- 

--- 
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: Deploy to openshift

2013-04-23 Thread Mika Sjöman
Hi

I am sitting on a Mac and I have distutils installed because it works when 
I import it with python. But Web2py still complains that it is not 
installed. Any ideas? I tried to use the ez_setup, but nothing happens. 
Tried> sudo python ez_setup distutils, but I only get this then>

error: Could not find suitable distribution for 
Requirement.parse('distutils')

Any ideas? Cheers


On Saturday, March 9, 2013 12:32:53 PM UTC+8, Massimo Di Pierro wrote:
>
> You need to install distutils. Use ez_setup.py 
> http://peak.telecommunity.com/dist/ez_setup.py
>
> On Friday, 8 March 2013 12:47:24 UTC-6, cor...@xionex.cl wrote:
>>
>> Hi. I'm trying to generate a package to deploy my web2py application on 
>> an apache server but when I use the button Deploy to openshift the system 
>> tell me "Requires Distuttils, but not installed". what can I do?
>
>

-- 

--- 
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] strange mobile behaviour when changing bootstrap theme

2013-03-26 Thread Mika Sjöman
Hi

I am trying to change the theme to the Cerulean theme at bootswatch.com. 
But changing from the default to bootstrap.min.css makes the web2py main 
menu go away when on mobile phone. Should I add / change anything else to 
make it work on mobile?

Cheers

-- 

--- 
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 about setting a standard fadeout to response.flash?

2013-03-26 Thread Mika Sjöman
Hi

Had a user pointing out how irritating it was that the response.flash never 
goes away automatically. Found this fix thou in the group, how about making 
a standard 4 second fadeout on it?

in web2py.js:

var flashBox = jQuery(".flash"), flashTimer;
  flashBox.click(function(){
  if (flashTimer) clearTimeout(flashTimer);
  flashBox.fadeOut(400, function(){jQuery(".flash").html('')});
  });
  flashTimer = setTimeout(function(){flashBox.fadeOut(400, function(){jQuery
(".flash").html('')});}, 4000); 

-- 

--- 
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: update existing project model without breaking backward compatibility...

2013-03-24 Thread Mika Sjöman
Hi

Maybe you could dump it to a phone numbers to a csv file or a python dict 
with dump_data = { phone_number : contact.id,}

Then when you created the second table, just run a for loop to populate 
that table with the dumped data with contact_id as a reference to the old 
table.

Thats what I would do

// web2py rookie

cheers


Den söndagen den 24:e mars 2013 kl. 19:29:19 UTC+8 skrev Loïc:
>
> Hello all,
>
> let's imagine I have an app with the following model : 
>
> db.define_table('contact',
> Field('name'),
> Field('phone_number')
> )
>
> I have already deployed my app, and I have several contacts with a name 
> and a phone number.
>
> Then I realise that a contact can have multiple phone numbers. So I add a 
> table :
>
> db.define_table('phone number',
> Field('type'), #mobile phone number, home phone number, business 
> phone number ,...
> Field('phone_number'),
> Field('contact', 'reference contact'),
> )
>
> The first time I launch my app with the new model, I want to move existing 
> phone numbers from *contact *table to *phone_number *table.
> Then I want to remove 'phone_number' field from contact table to avoid 
> using it in the future
>
> What is the best way to do this automatically, and without breaking 
> backward compatibility?
>
> 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] Free host for blog with domain?

2013-03-24 Thread Mika Sjöman
Hi

I wonder if anyone knows where I can put my we2py based blog up where they 
I also can use myOwnDomain.com for free? Not too much traffic, maybe a 100 
a day

And... I just build a community from scratch in two weeks from scratch with 
web2py, coming from django - I must say I LOVE web2py!

Huge 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: Can not check True/False on this field?

2013-03-08 Thread Mika Sjöman
Huge thanks! 
That worked!

Den fredagen den 8:e mars 2013 kl. 12:45:34 UTC+8 skrev weheh:
>
> What kind of error message are you getting?
>
> I assume the request.vars['lesson'] and request.vars.answer are both 
> indices into their respective tables. However, request.vars will be holding 
> these values as strings. Without knowing more, I would suggest putting an 
> int() around those two vars, as in:
>
> answer = db.answer[int(request.vars.answer)]
>
> and then do your test:
>
> if 'y' in answer.is_correct:
> # do something
> else:
># do something else
>
> Hope this  helps.
>
> On Friday, March 8, 2013 12:37:20 PM UTC+8, Mika Sjöman wrote:
>>
>> Hi trying to check true false in a string set, but does not work
>>
>> ## db.py
>>
>> db.define_table('answer',
>> Field('description'),
>> Field('is_correct', type='list:string'),
>> Field('belongs_to_quiz',type='reference quiz',writable=False),
>> )
>> db.answer.is_correct.requires=IS_IN_SET(('y','n'))
>>
>> ## controller
>>
>> def check_if_correct_answer():
>> """this function tests if the user answers correctly to a question 
>> and sends back a ajax response """
>> lesson = db.lesson(request.vars['lesson'])
>> answer = db.answer(request.vars.answer)
>> if answer.is_correct == "y":
>> #db.user_answer.insert(belongs_to_user=auth.user.id, 
>> belongs_to_lesson=lesson.id, correct='y')
>> correct_or_not='y'
>> else: 
>> correct_or_not='n'
>> return  "jQuery('.flash').html('%s').slideDown();" % (correct_or_not)
>>
>>
>> But this test with answer.is_correct does not work. Anybody has an idea 
>> on how to check? 
>>
>

-- 

--- 
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] Can not check True/False on this field?

2013-03-07 Thread Mika Sjöman
Hi trying to check true false in a string set, but does not work

## db.py

db.define_table('answer',
Field('description'),
Field('is_correct', type='list:string'),
Field('belongs_to_quiz',type='reference quiz',writable=False),
)
db.answer.is_correct.requires=IS_IN_SET(('y','n'))

## controller

def check_if_correct_answer():
"""this function tests if the user answers correctly to a question and 
sends back a ajax response """
lesson = db.lesson(request.vars['lesson'])
answer = db.answer(request.vars.answer)
if answer.is_correct == "y":
#db.user_answer.insert(belongs_to_user=auth.user.id, 
belongs_to_lesson=lesson.id, correct='y')
correct_or_not='y'
else: 
correct_or_not='n'
return  "jQuery('.flash').html('%s').slideDown();" % (correct_or_not)


But this test with answer.is_correct does not work. Anybody has an idea on 
how to check? 

-- 

--- 
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] IDE plugin what to use?

2013-02-01 Thread Mika Sjöman
Hi

I am totally new to web2py and thinking of skipping Django to get things 
done in Web2py instead. But - I really like working in an IDE if possible.

Is there any Eclipse web2py plugin - I find it quite messy to add headers 
for every controller manually. Learned about WingIDE but I dont like non 
FOSS software at all. 

Sincerely yours

Mika

-- 

--- 
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.