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.