Questions tagged [polymodel]

17 questions
15
votes
1 answer

how to cleanly remove ndb properties

in my app i need to remove a few of my models properties. i checked out this link but the first issue is that the properties are on a polymodel and there is no way im going to switch to an expando for the time to remove the properties, im not even…
aschmid00
  • 7,038
  • 2
  • 47
  • 66
3
votes
0 answers

Multiple inheritance mixing ndb.Model with PolyModel in AppEngine

In my application we are using a base model to hold general properties, which is a simple subclass of the ndb.Model. However, for some of the functionality it is very helpful to be able to leverage polymodel functionality. Both Model and PolyModel…
1
vote
0 answers

Upgraded emacs and polymode (poly-markdown+r-mode); now can't edit .Rmd files

I have been happily using polymode in emacs for editing Rmd files for many years. Then something broke in emacs (maybe the FastX3 config?), so the admins updated emacs from 24 to 27 for me. Now emacs works nicely but not polymode and no Rmd…
Stuart
  • 569
  • 6
  • 12
1
vote
1 answer

google app engine polymodel - overriding instance method - fail - python

Here's a simplification of what I'm trying to accomplish: class B inherits from A. Class B is supposed to override the call_me method in class A. I'm using google app engine (maybe that's why?) from google.appengine.ext import ndb from…
user2738183
1
vote
1 answer

Google App Engine : PolyModel + SelfReferenceProperty

Is a PolyModel-based class able to be used as a SelfReferenceProperty ? I have the below code : class BaseClass(polymodel.PolyModel): attribute1 = db.IntegerProperty() attribute2 = db.StringProperty() class ParentClass(BaseClass): …
rvandervort
  • 341
  • 1
  • 2
  • 11
0
votes
2 answers

is it safe to overwrite __setitem__ on an appengine polymodel?

I'm making a spam filter library for google app engine, which uses app engine hooks to modify some data right before it is put() into the datastore. To do so, I created a model that subclasses the PolyModel class, which classes wishing to be…
bigblind
  • 12,539
  • 14
  • 68
  • 123
0
votes
1 answer

Schematics PolyModelType How to choose correct model if field-condition is placed level up

I have the following models e.g How to choose correct model under PolyModel based on "code" value that placed level up into the structure? Thanks in advance class _Model1(Model): resourceId = StringType() resourceType = StringType() class…
0
votes
1 answer

Deleting a child class of polymodel in python appengine

In python appengine, I have a polymodel class (e.g. Animal). I stored in the datastore some instances of child classes (e.g. Horse). If I delete the definition of the Horse class in the python source code (or change its name), and get the stored…
Uri
  • 25,622
  • 10
  • 45
  • 72
0
votes
1 answer

NDB PolyModel Problems

I'm working on a google app engine app in which we use polymodel to express a subset of the entities. I'm having problems using it in the way that the docs claim it works though. My first problem is that I noticed that a call on an 'inherited'…
0
votes
1 answer

Turn jpeg into high poly model

I am looking for something in maybe javascript or python which can take a jpeg and turn it into a poly model based on the image? For this I will be looking at transforming an portrait image of a person and produce a semi 3D image. (I will write a…
TonyFrost
  • 1
  • 1
0
votes
1 answer

polymodel looks like not work well with KeyProperty

It looks like KeyProperty's kind validation doesn't work for subclass of PolyModel. from google.appengine.ext import ndb from google.appengine.ext.ndb import polymodel class Item(polymodel.PolyModel): parent =…
lucemia
  • 6,349
  • 5
  • 42
  • 75
0
votes
1 answer

Python extend method of parent class

I'm writing a Google Appengine app in Python. The app does receive and send data through google cloud endpoint messages. Below you'll find an example of the database model definition. Object contains all the objects, ObjectBoolean just the boolean…
decurgia
  • 111
  • 1
  • 9
0
votes
1 answer

ndb.StructuredProperty not calling ndb.PolyModel subclass methods

While storing ndb.Polymodel superclasses as an ndb.StructuredProperty, I was unable to access subclass methods; superclass methods were called instead and raising NotImplementedError's. Here is an abridged version of what I am trying to…
super
  • 181
  • 2
  • 12
0
votes
1 answer

How to get all class properties (in Python) of a GAE polymodel including those defined via @property

I am using the Google App Engine polymodel to model data that can have more than one instance of a property - e.g. a contact could have multiple phone numbers. Say this is my setup: class Foo(polymodel.PolyModel): some_prop =…
0
votes
2 answers

Google App Engine get PolyModel as child class

When I run Google App Engine likeso: from google.appengine.ext import db from google.appengine.ext.db import polymodel class Father(polymodel.PolyModel): def hello(self): print "Father says hi" class Son(Father): def…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
1
2