limit the application for client user

60 views
Skip to first unread message

黄祥

unread,
Dec 31, 2013, 12:55:01 PM12/31/13
to web...@googlegroups.com
hi,

is it possible to limit the application for client user? something identical with trial version for client user, so the user can try the application, test and use it for several time (1 month for example) or base on table record (limit to 10/100 record per table).
if possible what is the best way to achieve it using web2py way?

thanks and best regards,
stifan

Alan Etkin

unread,
Jan 1, 2014, 9:29:38 AM1/1/14
to web...@googlegroups.com
hi,

is it possible to limit the application for client user? something identical with trial version for client user, so the user can try the application, test and use it for several time (1 month for example) or base on table record (limit to 10/100 record per table).
if possible what is the best way to achieve it using web2py way?

How about a demo table like

db.define_table("demo", Field("user_id", "reference auth_user", default=auth.user_id),
                                    Field("expires", "date"),
                                    Field("usage", "json"),
                                    Field("status", requires=IS_IN_SET(("expired", "active"))))

Then upon registration, compute a predefined expiration date and set a JSON object for storing table usage and other metrics. On each request, you'd need to

- retrieve or create the user demo record
- compute any db i/o, check for usage limits and store as json
- check if deadline was reached

Not sure if this is the most efficient way, specially abuout the usage storage as json, but that way you can dinamically modify your usage metrics more easily. I think that storing usage as yaml/json files can improve performance.

黄祥

unread,
Jan 1, 2014, 6:40:01 PM1/1/14
to web...@googlegroups.com
- compute any db i/o, check for usage limits and store as json

i still don't get it in this part, btw, thank you for your suggestions.

best regards,
stifan

黄祥

unread,
Jun 30, 2015, 10:17:12 PM6/30/15
to web...@googlegroups.com
if limit base on data stored in table and using SQLFORM.grid it can be use logic
create = True if db.table.id < 100 else False
editable = True if db.table.id < 100 else False

best regards,
stifan
Reply all
Reply to author
Forward
0 new messages