Thanks.

quarta-feira, 10 de Abril de 2019 às 18:57:11 UTC+1, Lovedie JC escreveu:
>
> ON the localhost
>
> # coding: utf8
> from gluon import current
> from pymongo import MongoClient
> from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
> from gluon.custom_import import track_changes
> track_changes(True)
> db = DAL('mongodb://localhost/"db name"')
> response.generic_patterns = ['*'] if request.is_local else []
> auth = Auth(db, hmac_key=Auth.get_or_create_key())
>
> db.define_table('post',
>                 Field('author', 'reference auth_user', 
> default=auth.user_id, readable=False, writable=False),
>                 Field('message', 'text', requires=IS_NOT_EMPTY(),),
>                 auth.signature
>                 )
>
> controller:
> row = db(db.post.author== auth.user.id).select(db.post.id, 
> db.post.message, orderby=~db.post.id, limitby=(0,1)).first()
>
> *MongoDB*
> *# I use ubuntu 18.04LTS*
> 1. Download the mongo db browser, studio 3T from  
> https://studio3t.com/download/ 
> 2. Follow instructions after download
> 3. It will save in the homepage as folder(called robo3t)
> 4. In the folder, bin folder, find the robo3t app. Click on it, then click 
> on connect to see your db. See the images attached.
>
> N/B I noted that sometimes the error of 'Null type' comes when accessing 
> the db when no value has been entered/posted. SO post some value and see it 
> in the database with the browser.
>
>
>
>
> On Wed, 10 Apr 2019 at 19:38, João Matos <[email protected] <javascript:>> 
> wrote:
>
>> Thanks, an example would be great.
>>
>>
>> quarta-feira, 10 de Abril de 2019 às 15:33:46 UTC+1, Lovedie JC escreveu:
>>>
>>> I send you an example. Yes I use through DAL. It's nice. 
>>>
>>> On Wed, 10 Apr 2019, 17:01 João Matos <[email protected]> wrote:
>>>
>>>> Thanks for the feedback. 
>>>>
>>>> Do you use it through the DAL or directly?
>>>> If you use it through the DAL, are you able to select, insert, delete 
>>>> and update records without any issue?
>>>> Do you recommend it?
>>>>
>>>>
>>>>
>>>> quarta-feira, 10 de Abril de 2019 às 04:33:32 UTC+1, Lovedie JC 
>>>> escreveu:
>>>>>
>>>>> I use mongodb. It works well. I think digital Ocean.com implements it 
>>>>> nicely
>>>>>
>>>>> On Wed, 10 Apr 2019, 02:09 João Matos <[email protected]> wrote:
>>>>>
>>>>>> Thanks Anthony. Who can confirm this? Is ti Massimo or is there 
>>>>>> another person in charge of MongoDB in web2py?
>>>>>>
>>>>>>
>>>>>> terça-feira, 9 de Abril de 2019 às 23:59:36 UTC+1, Anthony escreveu:
>>>>>>>
>>>>>>> I don't think so -- just that the book was never updated.
>>>>>>>
>>>>>>> On Tuesday, April 9, 2019 at 6:37:04 PM UTC-4, João Matos wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> The support of MongoDB is still experimental?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> JM
>>>>>>>>
>>>>>>> -- 
>>>>>> 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 [email protected].
>>>>>> 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 [email protected].
>>>> 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 [email protected] <javascript:>.
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to