I'm not clear, the problem not persist using just PolyModel, but on
code:
class WorldRegion(search.SearchableModel, polymodel.PolyModel):
cityName = db.StringProperty()
regionName = db.StringProperty()
countryName = db.StringProperty()
latitude = db.FloatProperty()
longitude = db.FloatProperty()
locationcode = db.StringProperty()
completeName = db.TextProperty
Just polymodel.PolyModel work, but:
class WorldRegion(polymodel.PolyModel, search.SearchableModel):
cityName = db.StringProperty()
regionName = db.StringProperty()
countryName = db.StringProperty()
latitude = db.FloatProperty()
longitude = db.FloatProperty()
locationcode = db.StringProperty()
completeName = db.TextProperty
this not work correctly, the polimorphism is failed.
The problem in SearchableModel for you search and return empty is in
the index, this not execute index for properties and not clear in
bulkloader the execution is performed, i'm don't fix this :(
For others problems for you related in bulkloader, check this
http://code.google.com/p/googleappengine/issues/detail?id=1133
Plis create a issue for this.
On 18 set, 18:31, Mat <[email protected]> wrote:
> How are you doing that?
>
> I tried putting a handle_entity method in bulkloader but it doesn't
> work either. Like this:
>
> def handle_entity(self, entity):
> entity = search.SearchableEntity(entity.kind())
> return entity
>
> On Sep 18, 3:20 pm, Webysther <[email protected]> wrote:
>
> > I'm same problem, this don't exists in appengine 1.2.4.
>
> > I'm using this with PolyModel and this ok, but, SearchableModel don't
> > index the properties.
>
> > On 17 set, 17:57, Mat <[email protected]> wrote:
>
> > > I have a model class that looks like this:
>
> > > from google.appengine.ext import db, search
> > > class WorldRegion(search.SearchableModel):
> > > cityName = db.StringProperty()
> > > regionName = db.StringProperty()
> > > countryName = db.StringProperty()
> > > latitude = db.FloatProperty()
> > > longitude = db.FloatProperty()
> > > locationcode = db.StringProperty()
> > > completeName = db.TextProperty()
>
> > > When the entries are loaded manually, the searches against this entity
> > > returns the right entries. But when the same entries are loaded using
> > > thebulkloader, the results of searches are always empty. What could
> > > cause this problem?
>
> > > Here what the loader class looks like:
>
> > > import datetime
> > > from google.appengine.ext import db
> > > from google.appengine.tools importbulkloader
> > > import WorldRegion
>
> > > def handle_type(func):
> > > def wrapper(val):
> > > if val != '': return func(val)
> > > else: return None
> > > return wrapper
>
> > > def utfUnicode(s): return unicode(s, 'utf-8')
> > > def utfText(s): return db.Text(s, encoding='utf-8')
>
> > > class WorldRegionLoader(bulkloader.Loader):
> > > def __init__(self):
> > > bulkloader.Loader.__init__(self, 'WorldRegion',
> > > [('locationcode', utfUnicode),
> > > ('countryName', utfUnicode),
> > > ('countryCode', utfUnicode),
> > > ('regionName', utfUnicode),
> > > ('latitude', handle_type(float)),
> > > ('longitude', handle_type(float)),
> > > ('completeName', utfText),
> > > ])
> > > loaders = [WorldRegion]
>
> > > Thanks,
> > > Mathieu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---