DB Model
--------

Hi,
Need advice on how to use cursor functions in NDB model.I am able to use with\_cursor in DB model but its not available in NDB model:

 DB Model
---------

```
       def myDBfn(self):                       
             cursor_from_url = self.request.get('cursor')            
             logging.info("Cursor in start is: {}".format(cursor_from_url))             
             process_date = util_misc.get_start_date_from_day_param(self)            
             gql_query_text = 'Select * From DummyTable' 
            #Execute query
            query_o = db.GqlQuery(gql_query_text, process_date)            

            if cursor_from_url:                
                query_o.with_cursor(cursor_from_url)                
                BATCH_SIZE = 500
                results = query_o.fetch(BATCH_SIZE)
            else:                
                BATCH_SIZE = 1                
                results = query_o.fetch(BATCH_SIZE)

            if not results:
                logging.info("pref_email_update_task: all done")
                return                     

            logging.info("Exiting myDBfn....")
        return

```

NDB Model
---------

```
        def myNDBfn(self):          
            cursor_from_url = Cursor(urlsafe=self.request.get('cursor'))                                
            logging.info("Cursor in start is: {}".format(cursor_from_url))                            

            gql_query_text = 'Select * From TestSequences' #Define query conditions here            

            #Execute query            
            query_o = ndb.gql(gql_query_text)            
            if cursor_from_url:       
                query_o.fetch_page(5,start_cursor=cursor_from_url)                
                BATCH_SIZE = 500
                results = query_o.fetch(BATCH_SIZE)
            else:                                
                BATCH_SIZE = 1             
                results = query_o.fetch(BATCH_SIZE)

            if not results:
                logging.info("feed_sequence_update_second_task: all done")
                return                     
            logging.info("result is {}".format(results))   
            logging.info("Exiting myNDBfn....")
        return 

```

But in NDB model this cursor\_from\_url is giving an error:**raise datastore\_errors.BadValueError('invalid cursor')**
 Kindly advice!!!!!