[web2py] Re: Advice on Architecture/Design

2013-08-17 Thread Carlos Zenteno
the team is the tenant and the groups are the positions of the players.

a player can be assigned to more than one group.


On Thursday, August 15, 2013 9:18:22 PM UTC-7, Alex Glaros wrote:
>
> develop for multi-tenant from the beginning or else you will waste time 
> re-entering corrected designed data
>
> is a "group" equivalent to a "team"?
>
> will team membership stay permanent for each season?
>
>
>
> On Thursday, August 15, 2013 2:40:28 PM UTC-7, Carlos Zenteno wrote:
>>
>> Hi all,
>>
>> Very new to web2py and I like it so far...
>>
>> I am going to develop an app where a 'team' representative will sign up 
>> for an account
>> and this will create a team environment where the team players list can 
>> be entered.
>> Each account will have 5 groups on it and the players will be 
>> moved/assigned to one
>> or more groups.
>>
>> So far I think that each team will have an account of the type: 
>> my_team.domain.com.
>>
>> I think this can be achieved with multi-tenants.  Please tell me if I am 
>> in the right track or
>> if there is a better way to do this.
>>
>> Some questions:
>>
>> - what is the best way to approach this? 
>>   do I develop the application as if it was going to be for a single 
>> account and then transform it to multi-tenants? 
>>   or do I develop it for multi-tenants from the beginning?
>>
>> - I want to use postgresql.  Do I start with sqlite and then migrate to 
>> postgresql 
>>   or is it better to start with postgresql from the beginning?
>>
>> - Is there a place where I can read what are the best practices on 
>> developing with
>> web2py or what are the best ways to do it?
>>
>> Thanks in advance for your advice 
>>
>

-- 

--- 
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 streaming videos in OS X

2013-08-17 Thread Steve Chalmer
When I upload a video file (in MPEG4 format) to the static area, only the 
first several seconds will play in the video control appearing on the page.

This happens whether I use an auth.wiki() provisioned page, or if I simply 
embed a ... tag on the Welcome index page.

I've tried both video files I've created, as well as some simply downloaded 
from YouTube and uploaded into the static area from the "designing" admin 
page.

On the wiki generated page, I can put in a URL for an external site and it 
streams perfectly. However, when I looked at the page source, that link was 
using an  tag rather than a  tag.

The same behavior is exhibited whether I use Chrome or Safari (since 
Firefox has known issues with MPEG4 files), and whether or not I'm using 
the server only on "localhost" or within my lan from another machine.

This is the only problem I'm having - and it's a rather serious one, since 
the project I'm working on uses many, many videos. It's a deep-dive 
self-guided technical presentation that will be used by a large development 
team.

At this point, I've made no mods to any code at all, with the exception of 
putting the URL into the wiki page (as: 
http://HOSTNAME/MyTest/static/testFile.mp4 ) or embedding the same filename 
as the src file in a  tag in the default_index.html page for the 
Welcome app.

I'm running web2py Version 2.5.1-stable+timestamp.2013.06.06.15.39.19 on an 
iMac with OS X 10.8.4. The installation was simply to unzip the download 
into the Applications folder. I'm starting it from a shell using the 
command line "python web2py.py" so I can see any possible output. I'm using 
python 2.7.2.

Thanks in advance for any help.

-- 

--- 
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] diffrence between web2py and django framework...

2013-08-17 Thread Udeme Samuel
hello developers please i am new  to web2py and django but i want to know 
what is the diffrence between the two of them and which of the framework is 
more productive...

-- 

--- 
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: Load content from a text file

2013-08-17 Thread Massimo Di Pierro
Now many clients need to access this at one time? The issue is the workload 
on the pi. 

On Friday, 16 August 2013 17:40:29 UTC-5, Kenneth wrote:
>
> Hello everyone,
>
> I'm planing on running web2py on an Raspberry Pi. On the computer there 
> will also be an app that listens on the serial port and writes the results 
> into an text file.
>
> I'd like to create an extremly simple page where only the content of the 
> file is shown and having the page to reload like once every second. This 
> page will be shown from mobile ones or tablets over GPRS or 3G. 
>
> Is it possible to create an page so every reload doesn't re-execute the 
> controller and models just re-reads the text file and shows it. 
>
> To controll that app I'd like to sends commands by writing them into an 
> text file that the app reads. This shouldn't be too hard?
>
>
> 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] How to identify the active .table files

2013-08-17 Thread at
Hi,

In databases folder of a running web2py application, there are four .table 
files for the same table. How can be identified that which of these files 
are currently being used by the application?

103902c891e80b37c5ca0f9d021b98e8_option.table
13012917802f9750f7e6aec22cf2fb30_option.table
c5f365ce982338d5733d61d0ac11ded3_option.table
eee02c492ba9ed34049a9ff8dc72b10c_option.table

Thanks & Regards,
AT

-- 

--- 
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: Load content from a text file

2013-08-17 Thread Jim Gregory
Do you need to use a text file as an intermediary? I created a similar app for 
my pedal-powered laptop (described at www.pedalpc.com) where a function is 
called in the controller that reads/writes the serial port and returns the data 
as JSON which just updates the necessary data in the page in the browser. 

This method assumes the client has the processing power to handle updating the 
page via JSON...

On Friday, August 16, 2013 5:40:29 PM UTC-5, Kenneth wrote:
> Hello everyone,
> 
> I'm planing on running web2py on an Raspberry Pi. On the computer there will 
> also be an app that listens on the serial port and writes the results into an 
> text file.
> 
> I'd like to create an extremly simple page where only the content of the file 
> is shown and having the page to reload like once every second. This page will 
> be shown from mobile ones or tablets over GPRS or 3G. 
> 
> Is it possible to create an page so every reload doesn't re-execute the 
> controller and models just re-reads the text file and shows it. 
> 
> To controll that app I'd like to sends commands by writing them into an text 
> file that the app reads. This shouldn't be too hard?
> 
> 
> 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: An architectural strategy for a website - I'd like comments

2013-08-17 Thread Ykä Marjanen
Thanks guys!

So for next level strategy I will:

1) Determine and cache all queries and calculations that are non user 
spefic (e.g. ranking of all participants)
- This can be done either with cached select(), or using 
cache.ram/memcache/redis directly
- These could be done in a model level to make sure that they are updated 
regularly or use a cron/scheduler to do that in a background

2) Make session specific calculations and queries lazy and cache those that 
are required to be done multiple times in a session
- This can be done with @cache_property and/or storing results in a session 
variable (e.g. participant ranking in different competitions)

3) Use iterator/generator with those methods/functions that require only 
end result and most likely only once
- These could be also stored in a session for reuse if necessary

And of course it's a good idea to analyze code and decide the indexing of 
the database tables based on what is used heaviest.

I think it's easier to get the right strategy now when the code is simple, 
than later. Although I find Python flexible to change architecture also 
later.

Ykä

On Saturday, August 17, 2013 12:59:13 AM UTC+3, Massimo Di Pierro wrote:
>
>
>
> On Friday, 16 August 2013 06:58:49 UTC-5, Ykä Marjanen wrote:
>>
>> I read about cached select a bit more. So basically I could cache 
>> especially  the queries that are non user dependent (e.g. when calculating 
>> all participant rankings) and the query would be cached to all session. 
>> Right?
>>
>
> yes
>  
>
>>
>> I'm yet a bit early in the process to worry about too much optimization, 
>> but it's good to get a right understanding from the beginning, as I will 
>> soon have zillions of users :)
>>
>> Ykä
>>
>> On Friday, August 16, 2013 12:39:20 PM UTC+3, Niphlod wrote:
>>>
>>> That's a good way to eat up memory in the python process. I would have 
>>> saved a lot of headaches and just used select() with cache, possibly 
>>> exploiting memcache or redis to do the hard job. Don't take this the wrong 
>>> way, the cached_property is a neat trick, it's just not that suitable for 
>>> storing your zillions participant when you'll grow big.
>>>
>>> On Friday, August 16, 2013 10:25:32 AM UTC+2, Ykä Marjanen wrote:

 Hi,

 After learning Python and web2py deeper, I've restructured my web2py 
 application so that all functions and data are now in classes with lazy 
 methods in my own module. The lazy property class turns any method into a 
 "cached attribute", thus I can make a db query that returns rows and if it 
 is called again it uses the previous result.

 What this has allowed me to do, is to clean practically all code in my 
 controller as the logic and variables are in a class. Now I just pass the 
 class to the view and the view prints the "attributes" directly without 
 separate call and saving to dict. I've read that some don't like any logic 
 in the view, but that's unavoidable as in the view you need to print stuff 
 depending who the user is and is he logged in or not.

 I'd like your opinions and comments on my strategy. Here are few 
 simplified examples from my code:

 Module:

 class MyClass(object):
 def __init__(self):
 self.db = current.db

 @cached_property
 def all_participants(self):
 return self.db(self.db.participant.id>0).select()

 class MyClassParticipant(MyClass):
  "Inherits base class"
 def __init__(self, auth_user_id=None):
 self.auth_user_id = auth_user_id

 super(MyClassParticipant, self).__init__()

 @cached_property
 def participant_stats(self):
 return 
 self.db(self.db.participant.auth_user_id==self.auth_user_id).select()

 Controller:

 def index():
 if auth.user:
 xclassinstance = 
 module.MyClassParticipant(auth_user_id=auth.user_id)
 else:
 xclassinstance = module.MyClass()

 return dict(xclassinstance=xclassinstance)

 View:

 {{if auth.user:}}
 Your ranking is {{=xclassinstance.participant_stats.ranking}}

 Rankings of all participants
 
 {{for participant in xclassinstance.all_participants:}}
 {{=participant.name}} ranking is {{=participant.ranking}}
 

 Ykä
 



-- 

--- 
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 identify the active .table files

2013-08-17 Thread Niphlod
the part preceding the _options is the md5 of the connection string. If you 
want a quick and dirty method, backup those files to another dir, set 
fake_migrate=True and let web2py recreate the "current" file.

On Saturday, August 17, 2013 12:08:10 PM UTC+2, at wrote:
>
> Hi,
>
> In databases folder of a running web2py application, there are four .table 
> files for the same table. How can be identified that which of these files 
> are currently being used by the application?
>
> 103902c891e80b37c5ca0f9d021b98e8_option.table
> 13012917802f9750f7e6aec22cf2fb30_option.table
> c5f365ce982338d5733d61d0ac11ded3_option.table
> eee02c492ba9ed34049a9ff8dc72b10c_option.table
>
> Thanks & Regards,
> AT
>

-- 

--- 
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: Use cases of many to many reference

2013-08-17 Thread Niphlod
there has to be some place in your logic that has both of them: if this 
isn't the case, you'll never reach the part where you insert those values 
in your table

On Saturday, August 17, 2013 4:39:18 AM UTC+2, Chun-Hung Chen wrote:
>
> Thanks.
> I have tried the custom validator but it does not work as magic. :)
> One of the problems is that B.id and C.id are provided individually to the 
> validator. Thus validator could not get the both  ids at the same time, 
> validator could not validate if B.A_id and C.A_id are identical.
>
> Niphlod於 2013年8月17日星期六UTC+8上午3時42分36秒寫道:
>>
>> _before_insert, _after_insert, etc etc are database triggers, not 
>> validators if you want something that tells the user what is wrong, you 
>> need to code your own validator (or a custom onvalidation in your forms).
>>
>> On Friday, August 16, 2013 8:56:13 PM UTC+2, Chun-Hung Chen wrote:
>>>
>>> Or if you have implementations other than my proposal, I would like to 
>>> have another viewpoint to solve the problem. Thanks.
>>>
>>> Chun-Hung Chen於 2013年8月17日星期六UTC+8上午2時46分05秒寫道:

 Hi,

 I have a design issue and would like to have discuss with whom is 
 interested.

 I have 3 tables, A, B, and C, B and C both have a column reference to 
 A. However, B and C is a many to many relation based on the same reference 
 to A.
 I have created a mapping table D to map B and C. However, in this case, 
 I could not guarantee that any B and C mapping in D would have the same 
 reference to A.
 I use _before_insert to check and it works but it could not return 
 useful information to the user. It is just skipped the insertion if B and 
 C 
 do not have the same reference to A. I know that I could insert some code 
 in controller or so to warn or return messages to the user. I am just 
 curious if it is possible to accomplish such scenario in model definition. 

 Thanks.

 Regards,
 Chun-Hung

>>>

-- 

--- 
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] Send and save as draft email forms

2013-08-17 Thread Alan Etkin
This is a question from a web2py user that was sent to my mail. Has anybody 
solved this?
 

*Q: How do we create a Compose Form in web2py to compose, save and send an 
Email?*

*Do you have any examples or references that we can look at?*


 

*Also how to do the Send versus Save as Draft form creation – because Save 
will have to access the IMAP server, whereas the Send will have to use the 
SMTP server?*

We have been trying to do this for a long time, and the FORM or SQLFORM or 
CRUD form are not helping us to build a compose window. Any help, guidance 
or reference would be very helpful.

Thank you, once again.

*
*
*With Gratitude,*

*Prachi*

-- 

--- 
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] making true copy of HTML helpers

2013-08-17 Thread step
I discovered one way to make a true copy of some list of HTML helpers. I 
would like to know if there are other more, web2py / pythonic ways to do 
it. So for instance:

form = SQLFORM.factory()
trs = form.elements('')
trs_true_copy = map(lambda x: TAG(x.xml()),trs)

which works just fine, though it seems a bit overkill having to serialize 
and deserialize to make a true copy.
TIA

-- 

--- 
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: making true copy of HTML helpers

2013-08-17 Thread step
And in fact it isn't a true copy because after the mapping the so called 
trs_true_copy has lost all the SQLFORM specific data, like links to 
form.vars, etc. So I don't know of a way to make a true copy, and I'm 
asking for one. Thanks.

On Saturday, August 17, 2013 2:19:39 PM UTC+2, step wrote:

> I discovered one way to make a true copy of some list of HTML helpers. I 
> would like to know if there are other more, web2py / pythonic ways to do 
> it. So for instance:
>
> form = SQLFORM.factory()
> trs = form.elements('')
> trs_true_copy = map(lambda x: TAG(x.xml()),trs)
>
> which works just fine, though it seems a bit overkill having to serialize 
> and deserialize to make a true copy.
> TIA
>
>

-- 

--- 
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: Send and save as draft email forms

2013-08-17 Thread Alan Etkin


> *Q: How do we create a Compose Form in web2py to compose, save and send 
> an Email?*
>
>
I'd use SQLFORM.factory to collect the mail data and, after the form 
submission, use the welcome app's mail object to send the message with smtp 
(passing the user's smtp connection parameters maybe stored in the app's 
database).
 

> *Do you have any examples or references that we can look at?*
>
>
No, but the book's forms, DAL and email chapters should be enough reference 
to implement the feature.
 

> *Also how to do the Send versus Save as Draft form creation – because 
> Save will have to access the IMAP server, whereas the Send will have to use 
> the SMTP server?*
>
>
There's no draft support in the imap adapter (but I will open an 
enhancement issue about it). However, you could implement your own draft 
service storing email drafts in the application's database.

-- 

--- 
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: making true copy of HTML helpers

2013-08-17 Thread Niphlod
there's a conceptual problem with your question either you want to save 
a list of HTML helpers or you need to save a full-blown form. Of course you 
serializing only the HTML part of the form won't get you form.vars, 
form.accepts(), etc etc.
I'm curious though, what and why do you need it?

On Saturday, August 17, 2013 2:33:09 PM UTC+2, step wrote:
>
> And in fact it isn't a true copy because after the mapping the so called 
> trs_true_copy has lost all the SQLFORM specific data, like links to 
> form.vars, etc. So I don't know of a way to make a true copy, and I'm 
> asking for one. Thanks.
>
> On Saturday, August 17, 2013 2:19:39 PM UTC+2, step wrote:
>
>> I discovered one way to make a true copy of some list of HTML helpers. I 
>> would like to know if there are other more, web2py / pythonic ways to do 
>> it. So for instance:
>>
>> form = SQLFORM.factory()
>> trs = form.elements('')
>> trs_true_copy = map(lambda x: TAG(x.xml()),trs)
>>
>> which works just fine, though it seems a bit overkill having to serialize 
>> and deserialize to make a true copy.
>> TIA
>>
>>

-- 

--- 
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: Send and save as draft email forms

2013-08-17 Thread Alan Etkin
I have opened an issue requesting the mail storage feature.

https://groups.google.com/d/msg/web2py/WrFGJhGI8ds/q8SvGEuZwZUJ

-- 

--- 
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] IS_IN_DB zero= solution

2013-08-17 Thread Richard Vézina
jQuery!!

When the select is focused popup something like tooltip in bootstrap...

Richard


On Fri, Aug 16, 2013 at 2:59 AM, Niphlod  wrote:

>
>
>> In my table definitions I do use comments to give directives, however,
>> this is a custom form on a landing page, and I think labels and comments in
>> this case make the form look ugly, so I use placeholders to replace the
>> labels and comments. For a select this doesn't work:
>>
>> form.element('select[name=**navID]').update(_placeholder='**Select 4
>> functions')
>>
>
> Guess so... placeholder isn't something you can use on a select.only
> on a input.
>
>
>>
>> Therefore, I was looking for a way to achieve the same using the zero
>> option. This doesn't work:
>>
>> form.element('select[name=**navID]').append(0,"Select 4 functions")
>>
>> TypeError: append() takes exactly 2 arguments (3 given)
>>
>>
>
>> But the solution Richard first provided (which for whatever reason,  I
>> did not give a try first, sorry)
>> does work.
>>
>> Why doesn't append work and why does insert?
>>
>>
>> That's how lists work in python. Either you append(something) meaning you
> want "something" at the end of the list or you insert(in_what_position,
> something) .
>
>
>
> --
>
> ---
> 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: Send and save as draft email forms

2013-08-17 Thread PRACHI VAKHARIA

Below are the main features that are required for Email »

   1. *Reading (IMAP-POP)
   *
   2. *Writing (composing)
   *
   3. *Saving (drafts)
   *
   4. *Sending (SMTP)
   *
   5. *Managing Attachments
   *
   6. *Fetching Email Headers only*
   
Features 1 and 4 do exist in w2p, and is very well executed.
When the rest of the features are also implemented in the same simple and 
structured manner, that would make w2p extremely powerful in handling 
Emails. But it is important to make it *simple, structured and seamless so 
that it is consistent with the rest of w2p*.

Thank you.
— Prachi


.

-- 

--- 
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] Date search on sqlform.grid not working

2013-08-17 Thread Leonardo Pires Felix
Hi, I'm trying to do a search by date with sqlform.grid. But it is not 
returning the right date.
There is a picture on attachment of the issue.

-- 

--- 
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: Send and save as draft email forms

2013-08-17 Thread Alan Etkin

>
> *6. Fetching Email Headers only*
>
*
*AFAIK, that is implemented already*. *The adapter only fetches the whole 
message if the fields selected do not belong to the header. For example:

>>> imap(...).select(imap.inbox.sender, imap.inbox.created, 
imap.inbox.subject)

would only fetch the header.

-- 

--- 
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: Load content from a text file

2013-08-17 Thread Kenneth Lundström

Hello,

only one max two clients at a time will access this page. I don't even 
see why two clients would be accesing this page if not a supervisor 
wants to check on the progress of an worker.


Jim, not quite sure how to do what you suggest. The serial communication 
is using an special protocol that the app reads and creates an text file 
from.


The app stores also everything in the database but I thought it would be 
more efficient for this page to get the info from an text file. There 
will be many other pages that will be using mobile jquery with an normal 
menu that reads data from the database, but this one special page will 
be just a blank page showing the content of the file if I can't find out 
how to reload just the part of the page that shows the text file. Was 
thinking using PHP to show that page.



Kenneth


Now many clients need to access this at one time? The issue is the 
workload on the pi.


On Friday, 16 August 2013 17:40:29 UTC-5, Kenneth wrote:

Hello everyone,

I'm planing on running web2py on an Raspberry Pi. On the computer
there will also be an app that listens on the serial port and
writes the results into an text file.

I'd like to create an extremly simple page where only the content
of the file is shown and having the page to reload like once every
second. This page will be shown from mobile ones or tablets over
GPRS or 3G.

Is it possible to create an page so every reload doesn't
re-execute the controller and models just re-reads the text file
and shows it.

To controll that app I'd like to sends commands by writing them
into an text file that the app reads. This shouldn't be too hard?


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.


--

--- 
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: Send and save as draft email forms

2013-08-17 Thread PRACHI VAKHARIA


On Saturday, August 17, 2013 12:37:54 PM UTC-4, Alan Etkin wrote:
>
> *6. Fetching Email Headers only*
>>
> *
> *AFAIK, that is implemented already*. *The adapter only fetches the whole 
> message if the fields selected do not belong to the header. For example:
>
> >>> imap(...).select(imap.inbox.sender, imap.inbox.created, 
> imap.inbox.subject)
>
> would only fetch the header.
>



Thanks for the clarification. It was my assumption and misunderstanding 
that the adapter fetched the full email with MIME parts, and that it was 
parsed later to return only header information.

It would be great and neat to have the *Compose + Draft + Send* features 
also implemented in a simple format.

Thank you.
— Prachi


.

-- 

--- 
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: Date search on sqlform.grid not working

2013-08-17 Thread Leonardo Pires Felix
I've found something, when i do the search using the date picker, it 
returns me in the format of the translation file("%d/%m/%Y"), but when use 
like this to do the search, it returns nothing or something not expected. 
But if i mannually change the format from the search on the sqlform.grid to 
"%Y/%m/%d" it works out. How do to the sqlform.grid recognize the format 
that i want to use on the search("%d/%m/%Y") ?

-- 

--- 
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: urlify - no char mapping

2013-08-17 Thread lesssugar
It works great, but I'm not getting "ł" character mapped using 
IS_SLUG.urlify(string). How do I make sure all special characters (e.g. 
latin ones) get mapped? Do I need to use a custom mapping dictionary or 
there's maybe an easier, built-in way?

On Saturday, August 17, 2013 12:48:17 AM UTC+2, lesssugar wrote:
>
> Oh, I wasn't aware that IS_SLUG.urlify() is a part of our great framework 
> :) I thought urlify is an external Python module.
>
> Anyway, found docs here: 
> http://www.web2py.com.ar/examples/global/vars/IS_SLUG/urlify
>
> Thanks!
>
> On Saturday, August 17, 2013 12:00:52 AM UTC+2, Massimo Di Pierro wrote:
>>
>> There is a  IS_SLUG.urlify() which is probably better than Django's. 
>> ;-)
>>
>> On Friday, 16 August 2013 07:39:50 UTC-5, lesssugar wrote:
>>>
>>> I'm using the following module to convert my urls:
>>>
>>>
>>> http://pydoc.net/Python/redsolutioncms.django-hex-storage/0.1.1/pinyin.urlify/
>>>
>>> I have urlify.py (main function) and maps.py (chars mapping) in my 
>>> /modules. I test it in one of my views, simply trying to print the 
>>> urlify-ed value in the console:
>>>
>>> {{from urlify import urlify}}
>>> {{print urlify(u"łźć ęćm")}}
>>>
>>> I get "aaa-aaa", so basically there's no mapping done and I have no idea 
>>> why.
>>>
>>>
>>>

-- 

--- 
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 is converting Integers to Longs and len() breaks

2013-08-17 Thread davedigerati
My app is working locally fine with a field defined as
Field('Q2V','integer'),

then in the controller I have been able to 
len(Q2V)

but after upload to Google App Engine I am tripping with
object of type 'long' has no len()

I've been abel to discover that apparently GAE will map Integers to Longs 
for python- um, ok, so how can I measure the length then? Has anyone run 
into this and solved it?

-- 

--- 
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] GAE is converting Integers to Longs and len() breaks

2013-08-17 Thread Jonathan Lundell
On 17 Aug 2013, at 1:06 PM, davedigerati  wrote:
> My app is working locally fine with a field defined as
> Field('Q2V','integer'),
> 
> then in the controller I have been able to 
> len(Q2V)
> 
> but after upload to Google App Engine I am tripping with
> object of type 'long' has no len()
> 
> I've been abel to discover that apparently GAE will map Integers to Longs for 
> python- um, ok, so how can I measure the length then? Has anyone run into 
> this and solved it?
> 
> 

Python integers don't have len either. What are you trying to 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.


Re: [web2py] GAE is converting Integers to Longs and len() breaks

2013-08-17 Thread David Gawlowski
Shoot, thanks, you're right, that field was a string and I changed it to do
math on elsewhere...

Do you know how to take the far right number of a two digit number?  Will
something like field[-1] work like it does on strings?
On Aug 17, 2013 4:14 PM, "Jonathan Lundell"  wrote:

> On 17 Aug 2013, at 1:06 PM, davedigerati  wrote:
>
> My app is working locally fine with a field defined as
> Field('Q2V','integer'),
>
> then in the controller I have been able to
> len(Q2V)
>
> but after upload to Google App Engine I am tripping with
> object of type 'long' has no len()
>
> I've been abel to discover that apparently GAE will map Integers to Longs
> for python- um, ok, so how can I measure the length then? Has anyone run
> into this and solved it?
>
>
>
> Python integers don't have len either. What are you trying to do?
>
> --
>
> ---
> 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/yw40xBWIQQA/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/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] diffrence between web2py and django framework...

2013-08-17 Thread Carlos Correia
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Em 16-08-2013 19:09, Udeme Samuel escreveu:
> hello developers please i am new  to web2py and django but i want to know what
> is the diffrence between the two of them and which of the framework is more
> productive...
> 
> -- 
>  
> ---
> 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.

If you had googled first for "Web2py vs django"
(https://www.google.com/search?channel=fs&q=web2py+vs+django), you might have
noticed the first result:
http://stackoverflow.com/questions/4352428/django-vs-web2py-for-a-beginner-developer
("Django vs web2py for a beginner developer").

Have fun,
- -- 
Com os melhores cumprimentos,

Carlos Correia
=
MEMÓRIA PERSISTENTE
Tel.: 219 291 591 - GSM:  917 157 146 / 967 511 762
e-mail: ge...@memoriapersistente.pt - URL: http://www.memoriapersistente.pt
Jabber: m...@jabber.org
GnuPG: wwwkeys.eu.pgp.net
URL Suporte: https://t5.m16e.com/gps
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlIP5bMACgkQ90uzwjA1SJUi2QCdG3xJinTBU0Cpf3NbtlV4/tDf
ybMAnAgzwE+Jvm9TYxeUq+5hHPk6H5ES
=omLS
-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] GAE is converting Integers to Longs and len() breaks

2013-08-17 Thread Jonathan Lundell
On 17 Aug 2013, at 1:40 PM, David Gawlowski  wrote:
> Shoot, thanks, you're right, that field was a string and I changed it to do 
> math on elsewhere...
> 
> Do you know how to take the far right number of a two digit number?  Will 
> something like field[-1] work like it does on strings?
> 
You can always do len(str(thing)), or str(thing)[-1] (though thing % 10 might 
be closer to what you want).


> On Aug 17, 2013 4:14 PM, "Jonathan Lundell"  wrote:
> On 17 Aug 2013, at 1:06 PM, davedigerati  wrote:
>> My app is working locally fine with a field defined as
>> Field('Q2V','integer'),
>> 
>> then in the controller I have been able to 
>> len(Q2V)
>> 
>> but after upload to Google App Engine I am tripping with
>> object of type 'long' has no len()
>> 
>> I've been abel to discover that apparently GAE will map Integers to Longs 
>> for python- um, ok, so how can I measure the length then? Has anyone run 
>> into this and solved it?
>> 
>> 
> 
> Python integers don't have len either. What are you trying to 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] Re: Send and save as draft email forms

2013-08-17 Thread Alan Etkin

>
> It would be great and neat to have the *Compose + Draft + Send* features 
> also implemented in a simple format.
>

Here's a simple project I started some time ago for a web2py mail client 
app that you can use as example.

http://code.google.com/p/gpo2py/

-- 

--- 
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: MOD_WSGI and web2py doesn't allow url below root

2013-08-17 Thread jonten
Hi Massimo,

I am just curious to know if it is better to modify BASE in routes.py than 
using the config below in Apache vhost config instead of WSGIScriptAlias? Or if 
it is equvivalent:

WSGIScriptAliasMatch ^/myapp.* /var/www/web2py/wsgihandler.py

Best regards,
//Jon

-- 

--- 
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.mytable.myfield.contains() gives an error Query Not Supported: parser stack overflow

2013-08-17 Thread dave
I guess nobody encountered this issue before?

On Thursday, August 15, 2013 11:59:31 AM UTC-7, dave wrote:
>
> .
> .
> .
> x = ['a', 'b', 'c', ...]
> queries.append(db.mytable.myfield.contains(x))
> query = reduce(lambda a,b:(a&b),queries)
> grid = SQLFORM.grid(query, ...)
>
> return (grid=grid)
>
> gives an error of "Query Not Supported: parser stack overflow", if the 
> list x has too many values, like around 100 or a 1000, I suspect its an 
> sqlite limitation? can anyone suggest another succinct way of passing a 
> list to a contain like operator or method. 
>

-- 

--- 
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: Advice on Architecture/Design

2013-08-17 Thread Alex Glaros
by positions of the players do you mean like all of the forwards and 
goalkeepers?

can you provide a use case for your app? 
http://en.wikipedia.org/wiki/Use_case



On Friday, August 16, 2013 9:47:36 AM UTC-7, Carlos Zenteno wrote:
>
> the team is the tenant and the groups are the positions of the players.
>
> a player can be assigned to more than one group.
>
>
> On Thursday, August 15, 2013 9:18:22 PM UTC-7, Alex Glaros wrote:
>>
>> develop for multi-tenant from the beginning or else you will waste time 
>> re-entering corrected designed data
>>
>> is a "group" equivalent to a "team"?
>>
>> will team membership stay permanent for each season?
>>
>>
>>
>> On Thursday, August 15, 2013 2:40:28 PM UTC-7, Carlos Zenteno wrote:
>>>
>>> Hi all,
>>>
>>> Very new to web2py and I like it so far...
>>>
>>> I am going to develop an app where a 'team' representative will sign up 
>>> for an account
>>> and this will create a team environment where the team players list can 
>>> be entered.
>>> Each account will have 5 groups on it and the players will be 
>>> moved/assigned to one
>>> or more groups.
>>>
>>> So far I think that each team will have an account of the type: 
>>> my_team.domain.com.
>>>
>>> I think this can be achieved with multi-tenants.  Please tell me if I am 
>>> in the right track or
>>> if there is a better way to do this.
>>>
>>> Some questions:
>>>
>>> - what is the best way to approach this? 
>>>   do I develop the application as if it was going to be for a single 
>>> account and then transform it to multi-tenants? 
>>>   or do I develop it for multi-tenants from the beginning?
>>>
>>> - I want to use postgresql.  Do I start with sqlite and then migrate to 
>>> postgresql 
>>>   or is it better to start with postgresql from the beginning?
>>>
>>> - Is there a place where I can read what are the best practices on 
>>> developing with
>>> web2py or what are the best ways to do it?
>>>
>>> Thanks in advance for your advice 
>>>
>>

-- 

--- 
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: sharing my d3.js experiments with web2py community

2013-08-17 Thread greaneym

Dave,

I put an updated set of d3.js examples on my github page. Try 
the web2py-1.app.d3anim.w2p  which contains more examples, including 
"overlayed on a page".

You can change these examples by adding your own html files  by "extending" 
or "including" html files, and you can read more about this in the web2py 
manual.

Also, this should help you with svg placement,
http://alistapart.com/article/using-svg-for-flexible-scalable-and-fun-backgrounds-part-i
 
  (and part-2)

Margaret
On Friday, August 16, 2013 11:07:33 AM UTC-5, dlypka wrote:
>
> Hi Margaret:
>
> OK I played with your samples.
> Great technology.
> I would like to see such effects overlayed onto an existing page.
>
> - Dave Lypka.
>
> On Saturday, August 10, 2013 7:47:00 PM UTC-5, greaneym wrote:
>>
>>
>> Hi there,
>>
>> I am sharing my experiments with D3.js this week. It's Geek Week, 
>> according to Google and I tried some animations with svg and images.
>>
>>
>> These are at 
>> htttps://github.com/greaneym/d3anim
>>
>>
>> I tried adding them to the slices page but it didn't look like that 
>> worked.  Also, please add a female avatar (generic) picture in the 
>> registration page (that would be nice).
>>
>>
>> Margaret
>>
>>
>>

-- 

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