[web2py] Admin on GAE

2018-08-15 Thread PRACHI VAKHARIA
How to access *full web2py Admin* in *GAE SDK*?

   - How to view Error Tickets while doing development in web2py on GAE SDK?
   - How to access the full web2py Admin features on GAE SDK?


Please Advise! I am a beginner in web2py+GAE.
Thank You!

-- 
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 get request.vars.value to controller

2018-08-15 Thread Lovedie JC
Yes that's what I am trying to get. The  current inserted text. How should
I work it out?

On Thu, 16 Aug 2018, 01:05 Dave S  wrote:

>
>
> On Wednesday, August 15, 2018 at 8:12:37 AM UTC-7, lbjc...@gmail.com
> wrote:
>>
>> Am puzzled by this, that I cant post text from request.vars value to
>> database and when refreshing, the text is there but I cant access this
>> value to controller functions.
>> This is my code:
>> def progress_view():
>> form = SQLFORM(Post, formstyle='table3cols').process()
>> if request.vars:
>> r = [request.vars.name]
>> codes.append(r[0])
>> db.post.insert(name=codes[0])
>> #db(db.post.id > 11).update(message=codes[0])
>> row = db(db.post.author== auth.user.id).select(db.post.id,
>> db.post.name, orderby=~db.post.id, limitby=(0,1)).first()
>> code = row.name if row else None
>> return dict(code=code)
>> Is there a way of accessing the CURRENT value from request.vars to
>> controller ? like append to a list without refreshing the page
>> Is there a javascript/jquery function that can do DAL refresh?
>>
>
> I think there may be some confusion, because you *are* accessing the
> current value of request.vars.name in the controller,
> which you put in a list and assign to r.  Perhaps you want to show it in
> the *view*, but you aren't returning anything but code to the view.  code
> is set to row.name, where you take the first tuple of the select()
> results (which are in reverse order).
>
> If you're trying to look at the the row you just inserted,
> db.post.insert() returns the id of the new tuple, and that should allow
> your select() to be done by id.
>
> If I misunderstood what you're trying to do, try explaining again what
> your workflow is and what you want to happen.
>
> Dave
> /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 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.
>

-- 
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: Help with an error:

2018-08-15 Thread Anthony
On Wednesday, August 15, 2018 at 4:57:29 PM UTC-4, Morganti wrote:
>
> Hi Anthony,
>
> I created a new field and migrated the values to this new one. It´s normal 
> now.
>
> The "valor" field was numeric.
>

Note, if you are using SQLite and initially created the "valor" field as 
type "string", then subsequently changing the type to a numeric type would 
have no effect, as you cannot change column types in SQLite. You must 
instead create a whole new field and migrate the data, which you have now 
done.

Anthony

-- 
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: Can start cron in 2.17.1

2018-08-15 Thread Dave S


On Tuesday, August 14, 2018 at 3:29:53 PM UTC-7, Omicron VT wrote:
>
> Trying to start the cron with -Y option gives me an error:
>
> " TypeError: argument of type 'NoneType' is not iterable "
>
> Any ideas. Thanks
>

Not direct help, but isn't web2py's cron deprecated?   If you can use the 
scheduler instead, I can answer some questions, or maybe you can use the 
OS's native cron.

You may be seeing something that is a side effect of an incomplete handling 
of the py2/py3 updates.

/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 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 get request.vars.value to controller

2018-08-15 Thread Dave S


On Wednesday, August 15, 2018 at 8:12:37 AM UTC-7, lbjc...@gmail.com wrote:
>
> Am puzzled by this, that I cant post text from request.vars value to 
> database and when refreshing, the text is there but I cant access this 
> value to controller functions.
> This is my code:
> def progress_view():
> form = SQLFORM(Post, formstyle='table3cols').process()
> if request.vars:
> r = [request.vars.name]
> codes.append(r[0])
> db.post.insert(name=codes[0])
> #db(db.post.id > 11).update(message=codes[0])
> row = db(db.post.author== auth.user.id).select(db.post.id, 
> db.post.name, orderby=~db.post.id, limitby=(0,1)).first()
> code = row.name if row else None
> return dict(code=code)
> Is there a way of accessing the CURRENT value from request.vars to 
> controller ? like append to a list without refreshing the page
> Is there a javascript/jquery function that can do DAL refresh?
>

I think there may be some confusion, because you *are* accessing the 
current value of request.vars.name in the controller,
which you put in a list and assign to r.  Perhaps you want to show it in 
the *view*, but you aren't returning anything but code to the view.  code 
is set to row.name, where you take the first tuple of the select() results 
(which are in reverse order).

If you're trying to look at the the row you just inserted, db.post.insert() 
returns the id of the new tuple, and that should allow your select() to be 
done by id.

If I misunderstood what you're trying to do, try explaining again what your 
workflow is and what you want to happen.

Dave
/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 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: Help with an error:

2018-08-15 Thread Morganti
Hi Anthony,

I created a new field and migrated the values to this new one. It´s normal 
now.

The "valor" field was numeric.

Thanks your helping
Best regards
André

Em terça-feira, 14 de agosto de 2018 21:57:53 UTC-3, Anthony escreveu:
>
> What is your model definition? Is "valor" a numeric field?
>
> On Tuesday, August 14, 2018 at 8:13:44 PM UTC-4, Morganti wrote:
>>
>> Hi guys,
>>
>> I am having the error below:
>>
>> Número do Ticket
>>
>> 187.122.40.48.2018-08-14.20-50-49.b4d5d6f0-071d-4f6b-aec3-1c662eb5ea0c
>>  function sum(character varying) does 
>> not exist LINE 1: SELECT SUM("ov_home"."valor") FROM "ov_home" WHERE 
>> ((("ov_ho... ^ HINT: No function matches the given name and argument types. 
>> You might need to add explicit type casts.Versão
>> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
>> Python Python 2.7.12: /home/www-data/py27env/bin/uwsgi (prefix: 
>> /home/www-data/py27env)Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/py27env/web2py/gluon/restricted.py", line 219, in 
>> restricted
>> exec(ccode, environment)
>>   File 
>> "/home/www-data/py27env/web2py/applications/nwproducao/compiled/controllers.relatorios.bonus_area.py",
>>  line 530, in 
>>   File "/home/www-data/py27env/web2py/gluon/globals.py", line 419, in 
>> 
>> self._caller = lambda f: f()
>>   File 
>> "/home/www-data/py27env/web2py/applications/nwproducao/compiled/controllers.relatorios.bonus_area.py",
>>  line 320, in bonus_area
>>   File 
>> "/home/www-data/py27env/web2py/applications/nwproducao/compiled/models.funcoes.py",
>>  line 1367, in gera_bonus_area
>>   File 
>> "/home/www-data/py27env/web2py/applications/nwproducao/compiled/models.funcoes.py",
>>  line 1422, in total_venda_home
>>   File "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", 
>> line 2250, in select
>> return adapter.select(self.query, fields, attributes)
>>   File 
>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 762, in select
>> return self._select_aux(sql, fields, attributes, colnames)
>>   File 
>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 718, in _select_aux
>> rows = self._select_aux_execute(sql)
>>   File 
>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 712, in _select_aux_execute
>> self.execute(sql)
>>   File 
>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>>  line 67, in wrap
>> return f(*args, **kwargs)
>>   File 
>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 412, in execute
>> rv = self.cursor.execute(command, *args[1:], **kwargs)
>> ProgrammingError: function sum(character varying) does not exist
>> LINE 1: SELECT SUM("ov_home"."valor") FROM "ov_home" WHERE ((("ov_ho...
>>^
>> HINT:  No function matches the given name and argument types. You might need 
>> to add explicit type casts.
>>
>>
>> The code that is getting this error is:
>>
>> total = db.ov_home.valor.sum()
>> total_venda = db(
>> (db.ov_home.home_id == home_id) &
>> (db.ov_home.data_ordem.year() == ano) &
>> (db.ov_home.data_ordem.month() == mes)
>> ).select(total).first()[total]
>>
>> I think I am using nothing out of normal, isn´t it?
>>
>> Thanks your helping
>> André
>>
>

-- 
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 restrict user registration to a single domain?

2018-08-15 Thread Anthony
db.auth_user.email.requires.append(IS_MATCH(r'.+@mywebsite.edu$',
error_message='Only 
@mywebsite.edu addresses allowed.'))

The db.auth_user.email field has a default set of validators, so you don't 
want to overwrite its "requires" attribute -- instead, simply append an 
additional IS_MATCH validator to confirm the address matches the desired 
regular expression pattern.

Anthony

On Wednesday, August 15, 2018 at 11:12:37 AM UTC-4, Erik wrote:
>
> I googled this extensively, but didn't find anything useful on it.
>
> I want to be able to restrict user registration to a single domain (maybe 
> even to just email addresses that end in .edu). Is there a simple way to 
> add this extra check to the current registration within an app?
>
> For example I just want users who have email address ending in 
> mywebsite.edu to be able to create an account, all other emails should be 
> rejected.
>
> Thank you!
>

-- 
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 restrict user registration to a single domain?

2018-08-15 Thread Erik
I googled this extensively, but didn't find anything useful on it.

I want to be able to restrict user registration to a single domain (maybe 
even to just email addresses that end in .edu). Is there a simple way to 
add this extra check to the current registration within an app?

For example I just want users who have email address ending in 
mywebsite.edu to be able to create an account, all other emails should be 
rejected.

Thank you!

-- 
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 get request.vars.value to controller

2018-08-15 Thread lbjc1978
Am puzzled by this, that I cant post text from request.vars value to 
database and when refreshing, the text is there but I cant access this 
value to controller functions.
This is my code:
def progress_view():
form = SQLFORM(Post, formstyle='table3cols').process()
if request.vars:
r = [request.vars.name]
codes.append(r[0])
db.post.insert(name=codes[0])
#db(db.post.id > 11).update(message=codes[0])
row = db(db.post.author== auth.user.id).select(db.post.id, 
db.post.name, orderby=~db.post.id, limitby=(0,1)).first()
code = row.name if row else None
return dict(code=code)
Is there a way of accessing the CURRENT value from request.vars to 
controller ? like append to a list without refreshing the page
Is there a javascript/jquery function that can do DAL refresh?

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