diff --git a/docs/build/html/api/schema/document.html b/docs/build/html/api/schema/document.html index e3ae383..70eaac2 100644 --- a/docs/build/html/api/schema/document.html +++ b/docs/build/html/api/schema/document.html @@ -100,7 +100,9 @@

config_extra_fields

Controls the method to use when dealing with fields passed in to the -document constructor. Possible values are ‘error’ and ‘ignore’

+document constructor. Possible values are ‘error’ and ‘ignore’. Any +fields which couldn’t be mapped can be retrieved (and edited) using +get_extra_fields()

@@ -116,6 +118,13 @@

+
+get_extra_fields()
+

if Document.config_extra_fields is set to ‘ignore’, this method will return +a dictionary of the fields which couldn’t be mapped to the document.

+

+
classmethod get_fields()
diff --git a/docs/build/html/api/schema/fields.html b/docs/build/html/api/schema/fields.html index f9f7280..572f851 100644 --- a/docs/build/html/api/schema/fields.html +++ b/docs/build/html/api/schema/fields.html @@ -93,8 +93,17 @@

Navigation

Field Objects

-class mongoalchemy.fields.Field(required=True, default=UNSET, db_field=None)
-

Field class docs

+class mongoalchemy.fields.Field(required=True, default=UNSET, db_field=None, allow_none=False) +
+
Parameters:
+
    +
  • required: The field must be passed when constructing a document (optional. default: True)
  • +
  • default: Default value to use if one is not given (optional.)
  • +
  • db_field: name to use when saving or loading this field from the database (optional. default is the name the field is assigned to on a documet)
  • +
  • allow_none: allow None as a value (optional. default: False)
  • +
+
+
db_field
@@ -135,7 +144,7 @@

Field Objects
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Called before wrapping. Calls is_valid_wrap() and raises a BadValueException if validation fails

@@ -149,7 +158,7 @@

Field Objects
-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Called before unwrapping. Calls is_valid_unwrap() and raises a BadValueException if validation fails

@@ -232,7 +241,7 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Validates the type and length of value

@@ -244,7 +253,7 @@

Primitive FieldsTrue or False.

-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

@@ -264,7 +273,7 @@

Primitive Fields
-validate_wrap(value, type)
+validate_wrap(value, *args, **kwds)

Validates the type and value of value

@@ -285,7 +294,7 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Validates the type and value of value

@@ -306,7 +315,7 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Validates the type and value of value

@@ -327,7 +336,7 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Validates the value’s type as well as it being in the valid date range

@@ -351,14 +360,14 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Checks that the correct number of elements are in value and that each element validates agains the associated Field class

-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Checks that the correct number of elements are in value and that each element validates agains the associated Field class

@@ -406,7 +415,7 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Checks that value is valid for EnumField.item_type and that value is one of the values specified when the EnumField was constructed

@@ -414,7 +423,7 @@

Primitive Fields
-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Checks that value is valid for EnumField.item_type.

Note

@@ -446,7 +455,7 @@

Primitive Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Checks that value is a pymongo ObjectId

@@ -466,9 +475,19 @@

Primitive Fields
-class mongoalchemy.fields.AnythingField(required=True, default=UNSET, db_field=None)
+class mongoalchemy.fields.AnythingField(required=True, default=UNSET, db_field=None, allow_none=False)

A field that passes through whatever is set with no validation. Useful for free-form objects

+
+
Parameters:
+
    +
  • required: The field must be passed when constructing a document (optional. default: True)
  • +
  • default: Default value to use if one is not given (optional.)
  • +
  • db_field: name to use when saving or loading this field from the database (optional. default is the name the field is assigned to on a documet)
  • +
  • allow_none: allow None as a value (optional. default: False)
  • +
+
+
wrap(value)
@@ -483,13 +502,13 @@

Primitive Fields
-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Always passes

-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Always passes

@@ -520,14 +539,14 @@

Sequence Type Fields
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Checks that the type of value is correct as well as validating the elements of value

-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Checks that the type of value is correct as well as validating the elements of value

@@ -618,14 +637,14 @@

Mapping Type Fields
-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Checks that value is a dict, that every key is a valid MongoDB key, and that every value validates based on DictField.value_type

-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Checks that value is a dict, that every key is a valid MongoDB key, and that every value validates based on DictField.value_type

@@ -662,7 +681,7 @@

Mapping Type Fields
-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Expects a list of dictionaries with k and v set to the keys and values that will be unwrapped into the output python dictionary should have

@@ -726,7 +745,7 @@

Document Field Objects
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Checks that value is an instance of DocumentField.document_class. if it is, then validation on its fields has already been done and no further validation is needed.

@@ -734,7 +753,7 @@

Document Field Objects
-validate_unwrap(value, fields=None)
+validate_unwrap(value, *args, **kwds)

Validates every field in the underlying document type. If fields is not None, only the fields in fields will be checked.

@@ -769,13 +788,13 @@

Computed Field Objects
-validate_wrap(value)
+validate_wrap(value, *args, **kwds)

Check that value is valid for unwrapping with ComputedField.computed_type

-validate_unwrap(value)
+validate_unwrap(value, *args, **kwds)

Check that value is valid for unwrapping with ComputedField.computed_type

diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 60c69e9..0ad238e 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -167,13 +167,14 @@

G

ge_() (mongoalchemy.query_expression.QueryField method)
get_collection_name() (mongoalchemy.document.Document class method)
+
get_extra_fields() (mongoalchemy.document.Document method)
get_fields() (mongoalchemy.document.Document class method)
+
+
get_indexes() (mongoalchemy.document.Document class method)
(mongoalchemy.session.Session method)
-
-
get_name() (mongoalchemy.query_expression.QueryField method)
get_type() (mongoalchemy.query_expression.QueryField method)
gt_() (mongoalchemy.query_expression.QueryField method)
diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 412603d..f342794 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index af7b9cc..c9e6623 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{"":{mongoalchemy:[2,0,1]},"mongoalchemy.fields.SetField":{wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.query_expression.QueryField":{in_:[3,1,1],eq_:[3,1,1],f:[3,4,1],lt_:[3,1,1],ge_:[3,1,1],get_name:[3,1,1],ne_:[3,1,1],get_type:[3,1,1],gt_:[3,1,1],le_:[3,1,1]},"mongoalchemy.fields.KVField":{wrap:[5,1,1],validate_unwrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields":{DateTimeField:[5,3,1],BadFieldSpecification:[5,3,1],ListField:[5,3,1],IntField:[5,3,1],ComputedFieldValue:[5,3,1],EnumField:[5,3,1],StringField:[5,3,1],PrimitiveField:[5,3,1],TupleField:[5,3,1],BoolField:[5,3,1],DictField:[5,3,1],FloatField:[5,3,1],Field:[5,3,1],NumberField:[5,3,1],ObjectIdField:[5,3,1],AnythingField:[5,3,1],SequenceField:[5,3,1],BadValueException:[5,3,1],SetField:[5,3,1],KVField:[5,3,1],ComputedField:[5,3,1]},"mongoalchemy.fields.FloatField":{validate_wrap:[5,1,1]},"mongoalchemy.fields.TupleField":{wrap:[5,1,1],validate_unwrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.update_expression":{UpdateExpression:[9,3,1]},"mongoalchemy.query.Query":{all:[10,1,1],set:[10,1,1],skip:[10,1,1],not_:[10,1,1],one:[10,1,1],remove_all:[10,1,1],append:[10,1,1],inc:[10,1,1],in_:[10,1,1],distinct:[10,1,1],explain:[10,1,1],count:[10,1,1],hint_asc:[10,1,1],extend:[10,1,1],clone:[10,1,1],ascending:[10,1,1],add_to_set:[10,1,1],descending:[10,1,1],pop_last:[10,1,1],or_:[10,1,1],hint_desc:[10,1,1],fields:[10,1,1],remove:[10,1,1],filter:[10,1,1],limit:[10,1,1],pop_first:[10,1,1],unset:[10,1,1],first:[10,1,1]},"mongoalchemy.query_expression":{QueryField:[3,3,1],QueryExpression:[3,3,1]},"mongoalchemy.document":{Index:[0,3,1],ExtraValueException:[0,5,1],DocumentException:[0,5,1],MissingValueException:[0,5,1],FieldNotRetrieved:[0,5,1],Document:[0,3,1],DocumentField:[5,3,1]},"mongoalchemy.fields.Field":{db_field:[5,4,1],is_valid_unwrap:[5,1,1],validate_unwrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],is_valid_wrap:[5,1,1],wrap:[5,1,1]},"mongoalchemy.session":{Session:[4,3,1]},"mongoalchemy.session.Session":{insert:[4,1,1],end:[4,1,1],get_indexes:[4,1,1],clear:[4,1,1],connect:[4,2,1],flush:[4,1,1],query:[4,1,1],clear_collection:[4,1,1]},mongoalchemy:{fields:[5,0,1],session:[4,0,1],document:[0,0,1]},"mongoalchemy.fields.IntField":{validate_wrap:[5,1,1]},"mongoalchemy.document.Document":{f:[0,4,1],get_collection_name:[0,2,1],get_indexes:[0,2,1],unwrap:[0,2,1],class_name:[0,2,1],get_fields:[0,2,1],validate_unwrap:[0,2,1],mongo_id:[0,4,1],wrap:[0,1,1],commit:[0,1,1],config_extra_fields:[0,4,1]},"mongoalchemy.fields.DateTimeField":{validate_wrap:[5,1,1]},"mongoalchemy.fields.AnythingField":{wrap:[5,1,1],validate_unwrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.BoolField":{validate_wrap:[5,1,1]},"mongoalchemy.query":{Query:[10,3,1],QueryResult:[10,3,1]},"mongoalchemy.fields.NumberField":{validate_wrap:[5,1,1]},"mongoalchemy.fields.EnumField":{wrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.update_expression.UpdateExpression":{pop_last:[9,1,1],execute:[9,1,1],set:[9,1,1],extend:[9,1,1],remove:[9,1,1],add_to_set:[9,1,1],unset:[9,1,1],remove_all:[9,1,1],pop_first:[9,1,1],append:[9,1,1],inc:[9,1,1]},"mongoalchemy.fields.ComputedFieldValue":{compute_value:[5,1,1]},"mongoalchemy.document.Index":{ensure:[0,1,1],unique:[0,1,1],descending:[0,1,1],ascending:[0,1,1]},"mongoalchemy.fields.SequenceField":{child_type:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.query_expression.QueryExpression":{or_:[3,1,1],not_:[3,1,1]},"mongoalchemy.document.DocumentField":{wrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1],is_valid_unwrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.fields.DictField":{wrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.fields.ComputedField":{wrap:[5,1,1],validate_unwrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.PrimitiveField":{wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.query.QueryResult":{clone:[10,1,1],rewind:[10,1,1],next:[10,1,1]},"mongoalchemy.fields.ListField":{wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.ObjectIdField":{wrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.StringField":{validate_wrap:[5,1,1]}},terms:{all:[0,10,11,4,5],code:11,partial:[0,11,5],chain:[10,11],queri:[0,1,2,3,4,8,9,10,11],increment:9,four:5,signific:4,follow:11,value_typ:5,depend:5,send:11,skip:10,introduc:11,queryfield:[10,0,3],liter:[0,5],everi:5,hint_asc:[10,11],fals:[0,10,5],updateexpress:[9,11],jack:3,affect:10,strang:5,gender:11,list:[0,10,9,5],last_nam:11,iter:[11,5],item:[9,4,5],past:3,ne_:3,pass:[0,5],further:[10,11,5],append:[10,9],index:[0,1,2,4,5,7,10,11],what:0,bdf:11,sub:[3,11],drop_dup:0,section:11,access:[10,0,3,11,4],delet:9,version:[9,5],"new":3,method:[0,10,11,4,5],whatev:5,situat:4,gener:[10,11,5],here:11,behaviour:5,becom:10,sinc:5,valu:[0,3,5,11,10,9],min_length:5,convert:5,convers:5,tuplefield:5,through:[11,5],queue:4,datetim:5,somedoc:3,implement:5,pop_first:[10,9],le_:3,via:[10,3],extra:0,appli:[10,11],modul:[1,7],prefer:[3,4],and_:3,api:[2,1,11],from:[0,4,5,11,10,9],would:[10,5],commun:11,distinct:10,mongoalchemi:[0,1,3,4,5,9,10,11],two:[0,11],next:[10,11],call:[0,3,4,5,10,11],key_typ:5,dict:[0,5],type:[0,2,3,4,5,7,10,11],until:[4,5],more:[10,11],sort:10,get_nam:3,relat:0,notic:11,warn:5,indic:1,particular:5,obj:[0,3,4,5],must:[9,5],none:[10,0,3,11,5],retriev:[0,10],dep:5,setfield:5,work:11,uniqu:[0,10],kwarg:[0,5],thin:4,ensure_index:0,someobj:10,extravalueexcept:0,male:11,def:11,control:[0,5],mongo:[0,1,2,3,5,8,10,11],objectid:5,give:5,bennett:11,accept:[0,11,5],minimum:5,caution:4,badfieldspecif:5,want:5,serial:11,string:5,delai:4,filter:[10,3,11],multipl:[10,0,3,11],first_nam:11,turn:11,programmat:[0,10,11],anoth:3,write:0,"__init__":4,rewind:10,sequencefield:5,instead:11,updat:[0,1,2,8,9,10,11],map:[2,0,7,11,5],overridden:0,alwai:5,clone:10,after:[11,5],befor:[0,11,5],wrong:[11,5],blood:11,date:5,end:4,associ:[0,10,4,5],tutori:[1,11],classmethod:[0,4],correspond:0,element:[11,5],caus:[11,5],inform:[11,4],preced:3,allow:[0,11,4,5],order:[10,11,4,5],origin:[10,5],document_class:5,becaus:[3,4],get_collection_nam:0,still:11,winger:11,paramet:[0,10,11,4,5],directli:[10,3,11],fix:5,pend:4,is_valid_wrap:5,main:0,might:11,them:5,"return":[0,3,4,5,10,11],thei:[0,3,11,5],python:[0,10,11,5],safe:[11,4],compound:0,now:[11,5],document:[0,1,2,5,7,10,11],name:[0,3,11,4,5],anyth:[4,5],drop:0,separ:11,each:[0,10,9,11,5],unicod:5,min_dat:5,intellig:4,ensur:[0,4],expect:5,britta:11,happen:[11,5],out:[11,5],content:[2,1],perri:11,suitabl:[0,5],print:11,correct:[11,5],insid:11,lt_:3,free:5,add_to_set:[10,9,11],reason:5,base:[0,10,5],dictionari:[3,5],documentexcept:0,or_:[10,3],thread:4,could:5,datetimefield:5,thing:[10,11],length:5,place:[0,11],isn:0,some_db:4,assign:[11,5],first:[10,9,11],oper:[0,3,4,5,10,9],rang:5,eq_:3,onc:11,number:[0,10,11,5],unlik:10,alreadi:5,done:[0,5],wrapper:4,wasn:0,owner:0,miss:0,primari:4,size:5,given:[10,3,11],db_field:5,start:[3,11],data:[11,5],interact:[11,5],construct:[11,5],numberfield:5,max_length:5,too:5,statement:4,conveni:11,store:5,schema:[2,1,7],is_valid_unwrap:5,option:0,especi:5,shirlei:11,specifi:[10,0,3,5],exactli:11,than:[10,11],serv:11,config_extra_field:0,whenev:5,provid:[0,3],remov:[10,9],get_index:[0,4],were:11,pre:[0,5],comput:[2,7,5],blooddonor:11,not_:[10,3],arg:4,query_express:[10,3],argument:[0,10,11,4,5],raw:10,badvalueexcept:5,have:[0,11,4,5],tabl:1,need:[3,11,4,5],notimplementederror:5,i_nam:0,mongo_id:0,self:11,somedocclass:10,note:[3,9,11,5],also:[0,3,4,5,10,11],without:[4,5],take:[11,5],which:[0,10,11,4,5],tupl:5,donor:[0,11],singl:[0,3,11,5],begin:4,though:11,object:[0,1,2,4,5,7,8,10,11],pair:[11,5],"class":[0,3,4,5,9,10,11],appear:5,doc:5,clear:[11,4],later:4,request:4,doe:[10,3,4],declar:5,databas:[0,4,5,11,10,9],"_id":[0,11,4],max_valu:5,son:0,class_nam:0,"__str__":11,session:[2,1,10,11,4],impact:4,current:[0,10,4,5],onli:[10,11,5],explicitli:0,nadir:11,intfield:[0,11,5],explain:10,should:[0,10,4,5],queu:11,get_field:0,local:11,queryexpress:[10,0,3],pop_last:[10,9],min_valu:[0,11,5],get:[3,11,4],express:[0,1,2,3,8,9,10,11],watch:5,requir:[0,9,5],mapper:[2,1,7],keyword:4,ge_:3,whether:5,contain:5,comma:11,where:[3,11,5],set:[0,10,9,11,5],see:[0,10,11,4,5],result:[10,11],respons:4,fail:5,kei:[10,11,5],hopefulli:11,jenkin:11,someth:[0,5],enough:11,between:[0,11],"import":11,gt_:3,attribut:[0,3,11],extend:[10,9],numer:5,dictfield:5,entir:5,objectidfield:5,come:11,computedfield:5,addit:0,both:[0,11,5],accident:11,last:[9,11],retrieved_field:0,etc:5,instanc:[0,3,4,5,10,11],basestr:[4,5],computed_typ:5,load:[0,11,5],simpli:10,kwd:4,can:[0,3,4,5,10,11],type_ag:0,pop:9,exst:3,fieldnotretriev:[0,10],respect:5,duplic:0,compos:5,been:[11,5],weirdli:5,interest:11,basic:11,rather:11,min_capac:5,search:1,ani:[0,11,4,5],floatfield:5,understand:[0,10,11,5],child:5,present:11,"case":11,badresultexcept:10,look:11,cursor:10,defin:[0,11,5],"while":0,abov:11,error:[0,5],fun:5,child_typ:5,non:5,usagei:3,itself:5,anythingfield:5,sever:11,parent:3,inc:[10,9,11],welcom:1,perform:[10,3,11,4],make:[0,11,4,5],get_typ:3,same:[10,3,11,4,5],shorter:11,handl:[11,4],complex:11,descend:[0,10],end_request:4,eventu:5,complet:11,validate_unwrap:[0,5],fairli:11,moment:11,rais:[0,10,11,5],user:3,remove_al:[10,9],documentfield:5,chang:11,entri:0,well:[10,11,5],inherit:5,exampl:[0,1,3,5,6,10,11],command:11,clear_collect:[11,4],thi:[0,3,4,5,10,11],queryresult:10,just:5,rest:11,max_dat:5,languag:[2,1,3,8,11],hint:[10,11],interfer:3,jeff:[3,11],had:11,except:[0,2,5,7,10,11],add:[10,0,3,9,11],valid:[11,5],versa:0,primit:[2,7,5],input:5,save:[0,11],explanatori:11,smart:4,max_capac:5,around:4,format:[4,5],outermost:11,validate_wrap:5,know:4,update_express:9,insert:[11,4,5],like:[11,5],specif:5,arbitrari:5,docutil:[0,5],negat:[10,3],missingvalueexcept:0,with_limit_and_skip:10,collect:[0,3,11,4,5],necessari:[10,11],output:5,computedfieldvalu:5,page:1,underli:[0,3,5],right:5,deal:0,kvfield:5,creation:[0,5],some:[11,4],item_typ:5,server:[9,11],outer_field:3,listfield:5,definit:[2,0,5,7,1],subclass:[0,10,11,5],cast:11,larg:5,sequenc:[2,7,5],refer:10,who:11,run:11,some_obj:4,compute_valu:5,someclass:4,stringfield:[0,11,5],usag:3,obei:5,although:4,acc:3,comparison:5,actual:[11,4,5],socket:4,constraint:[0,11],issu:3,constructor:[0,11,5],commit:0,enumfield:[11,5],produc:[3,5],own:5,qfield:[10,9],"float":5,automat:0,invers:5,wrap:[0,3,5],your:5,span:[0,5],wai:[11,4],execut:[9,0,10,11,4],transform:[0,5],fast:5,avail:11,strict:5,includ:10,primitivefield:5,paren:3,blooddon:11,"_collection_nam":0,"function":[11,4,5],form:[0,11,5],unwrap:[0,5],ascend:[0,10],boolfield:5,blood_typ:[0,10,11],atom:9,line:11,"true":[4,5],count:10,succe:[],possibl:[0,11,5],"default":[0,5],maximum:5,limit:10,otherwis:[0,5],connect:[11,4],creat:[0,3,4,5,10,11],"int":5,flush:4,repres:[3,9,5],incomplet:11,file:11,check:[10,3,11,5],probabl:5,again:5,in_:[10,3],first_q:10,when:[0,10,11,4,5],detail:11,field:[0,1,2,3,4,5,7,8,9,10,11],other:[0,10,4,5],you:5,pymongo:[0,10,11,4,5],mongodb:[3,5],femal:11,receiv:11,vice:0,hint_desc:[10,11],rule:5,ignor:[0,5],inner_field:3,unset:[10,9,5]},objtypes:{"0":"py:module","1":"py:method","2":"py:classmethod","3":"py:class","4":"py:attribute","5":"py:exception"},titles:["document","Welcome to MongoAlchemy’s documentation!","API documentation","Mongo Query Expression Language","Session","fields","Examples","Schema \u2014 Document-Object Mapper and Schema Definitions","Expression Language \u2014 Querying and Updating","Update Expressions","Query Objects","MongoAlchemy Tutorial"],objnames:{"0":"Python module","1":"Python method","2":"Python class method","3":"Python class","4":"Python attribute","5":"Python exception"},filenames:["api/schema/document","index","api/index","api/expressions/query_expressions","api/session","api/schema/fields","examples/index","api/schema/index","api/expressions/index","api/expressions/update_expressions","api/expressions/query","tutorial"]}) \ No newline at end of file +Search.setIndex({objects:{"":{mongoalchemy:[2,0,1]},"mongoalchemy.fields.SetField":{wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.query_expression.QueryField":{in_:[3,1,1],eq_:[3,1,1],f:[3,3,1],lt_:[3,1,1],ge_:[3,1,1],get_name:[3,1,1],ne_:[3,1,1],get_type:[3,1,1],gt_:[3,1,1],le_:[3,1,1]},"mongoalchemy.fields.KVField":{wrap:[5,1,1],validate_unwrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields":{DateTimeField:[5,4,1],BadFieldSpecification:[5,4,1],ListField:[5,4,1],IntField:[5,4,1],ComputedFieldValue:[5,4,1],EnumField:[5,4,1],KVField:[5,4,1],PrimitiveField:[5,4,1],TupleField:[5,4,1],BoolField:[5,4,1],DictField:[5,4,1],FloatField:[5,4,1],Field:[5,4,1],NumberField:[5,4,1],ObjectIdField:[5,4,1],AnythingField:[5,4,1],SequenceField:[5,4,1],BadValueException:[5,4,1],SetField:[5,4,1],StringField:[5,4,1],ComputedField:[5,4,1]},"mongoalchemy.fields.FloatField":{validate_wrap:[5,1,1]},"mongoalchemy.fields.TupleField":{wrap:[5,1,1],validate_unwrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.update_expression":{UpdateExpression:[11,4,1]},"mongoalchemy.query.Query":{all:[10,1,1],set:[10,1,1],skip:[10,1,1],not_:[10,1,1],one:[10,1,1],remove_all:[10,1,1],append:[10,1,1],inc:[10,1,1],in_:[10,1,1],distinct:[10,1,1],explain:[10,1,1],count:[10,1,1],hint_asc:[10,1,1],extend:[10,1,1],clone:[10,1,1],ascending:[10,1,1],add_to_set:[10,1,1],descending:[10,1,1],pop_last:[10,1,1],or_:[10,1,1],hint_desc:[10,1,1],fields:[10,1,1],remove:[10,1,1],filter:[10,1,1],limit:[10,1,1],pop_first:[10,1,1],unset:[10,1,1],first:[10,1,1]},"mongoalchemy.query_expression":{QueryField:[3,4,1],QueryExpression:[3,4,1]},"mongoalchemy.document":{Index:[0,4,1],ExtraValueException:[0,5,1],DocumentException:[0,5,1],MissingValueException:[0,5,1],FieldNotRetrieved:[0,5,1],Document:[0,4,1],DocumentField:[5,4,1]},"mongoalchemy.fields.Field":{db_field:[5,3,1],is_valid_unwrap:[5,1,1],validate_unwrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],is_valid_wrap:[5,1,1],wrap:[5,1,1]},"mongoalchemy.session":{Session:[4,4,1]},"mongoalchemy.session.Session":{insert:[4,1,1],end:[4,1,1],get_indexes:[4,1,1],clear:[4,1,1],connect:[4,2,1],flush:[4,1,1],query:[4,1,1],clear_collection:[4,1,1]},mongoalchemy:{fields:[5,0,1],session:[4,0,1],document:[0,0,1]},"mongoalchemy.fields.IntField":{validate_wrap:[5,1,1]},"mongoalchemy.document.Document":{f:[0,3,1],get_collection_name:[0,2,1],get_indexes:[0,2,1],unwrap:[0,2,1],class_name:[0,2,1],get_fields:[0,2,1],validate_unwrap:[0,2,1],mongo_id:[0,3,1],get_extra_fields:[0,1,1],wrap:[0,1,1],commit:[0,1,1],config_extra_fields:[0,3,1]},"mongoalchemy.fields.DateTimeField":{validate_wrap:[5,1,1]},"mongoalchemy.fields.ObjectIdField":{wrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.BoolField":{validate_wrap:[5,1,1]},"mongoalchemy.query":{Query:[10,4,1],QueryResult:[10,4,1]},"mongoalchemy.fields.NumberField":{validate_wrap:[5,1,1]},"mongoalchemy.fields.EnumField":{wrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.update_expression.UpdateExpression":{pop_last:[11,1,1],execute:[11,1,1],set:[11,1,1],extend:[11,1,1],remove:[11,1,1],add_to_set:[11,1,1],unset:[11,1,1],remove_all:[11,1,1],pop_first:[11,1,1],append:[11,1,1],inc:[11,1,1]},"mongoalchemy.fields.ComputedFieldValue":{compute_value:[5,1,1]},"mongoalchemy.document.Index":{descending:[0,1,1],unique:[0,1,1],ensure:[0,1,1],ascending:[0,1,1]},"mongoalchemy.fields.SequenceField":{child_type:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.query_expression.QueryExpression":{or_:[3,1,1],not_:[3,1,1]},"mongoalchemy.document.DocumentField":{wrap:[5,1,1],is_valid_unwrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.fields.DictField":{wrap:[5,1,1],unwrap:[5,1,1],validate_wrap:[5,1,1],validate_unwrap:[5,1,1]},"mongoalchemy.fields.ComputedField":{wrap:[5,1,1],validate_unwrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.PrimitiveField":{wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.query.QueryResult":{clone:[10,1,1],rewind:[10,1,1],next:[10,1,1]},"mongoalchemy.fields.ListField":{wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.AnythingField":{wrap:[5,1,1],validate_unwrap:[5,1,1],validate_wrap:[5,1,1],unwrap:[5,1,1]},"mongoalchemy.fields.StringField":{validate_wrap:[5,1,1]}},terms:{all:[0,10,9,4,5],code:9,partial:[0,9,5],chain:[10,9],queri:[0,1,2,3,4,8,9,10,11],four:5,signific:4,follow:9,value_typ:5,depend:5,send:9,documet:5,skip:10,introduc:9,queryfield:[10,0,3],liter:[0,5],everi:5,hint_asc:[10,9],fals:[0,10,5],updateexpress:[9,11],jack:3,affect:10,strang:5,gender:9,list:[0,10,11,5],last_nam:9,iter:[9,5],item:[11,4,5],past:3,ne_:3,pass:[0,5],further:[10,9,5],append:[10,11],index:[0,1,2,4,5,7,10,9],what:0,bdf:9,sub:[3,9],defin:[0,9,5],section:9,access:[10,0,3,9,4],delet:11,version:[11,5],"new":3,method:[0,10,9,4,5],whatev:5,situat:4,gener:[10,9,5],here:9,behaviour:5,becom:10,sinc:5,valu:[0,3,5,11,10,9],min_length:5,convert:5,convers:5,tuplefield:5,through:[9,5],queue:4,datetim:5,implement:5,pop_first:[10,11],le_:3,via:[10,3],extra:0,appli:[10,9],modul:[1,7],prefer:[3,4],and_:3,api:[2,1,9],child_typ:5,from:[0,4,5,11,10,9],would:[10,5],commun:9,distinct:10,mongoalchemi:[0,1,3,4,5,9,10,11],two:[0,9],next:[10,9],call:[0,3,4,5,10,9],key_typ:5,queu:9,type:[0,2,3,4,5,7,10,9],until:[4,5],more:[10,9],sort:10,get_nam:3,relat:0,notic:9,warn:5,indic:1,particular:5,actual:[9,4,5],must:[11,5],none:[10,0,3,9,5],retriev:[0,10],dep:5,local:9,work:9,uniqu:[0,10],itself:5,thin:4,ensure_index:0,someobj:10,extravalueexcept:0,male:9,def:9,control:[0,5],mongo:[0,1,2,3,5,8,10,9],objectid:5,give:5,bennett:9,accept:[0,9,5],minimum:5,caution:4,badfieldspecif:5,want:5,serial:9,string:5,delai:4,filter:[10,3,9],multipl:[10,0,3,9],first_nam:9,turn:9,programmat:[0,10,9],anoth:3,write:0,sever:9,rewind:10,sequencefield:5,instead:9,updat:[0,1,2,8,9,10,11],map:[2,0,7,9,5],overridden:0,alwai:5,clone:10,after:[9,5],befor:[0,9,5],wrong:[9,5],blood:9,date:5,end:4,data:[9,5],classmethod:[0,4],correspond:0,element:[9,5],caus:[9,5],inform:[9,4],preced:3,allow:[0,9,4,5],order:[10,9,4,5],origin:[10,5],document_class:5,becaus:[3,4],get_collection_nam:0,still:9,winger:9,paramet:[0,10,9,4,5],directli:[10,3,9],fix:5,complex:9,pend:4,is_valid_wrap:5,main:0,might:9,them:5,"return":[0,3,4,5,10,9],thei:[0,3,9,5],python:[0,10,9,5],safe:[9,4],compound:0,now:[9,5],eventu:5,name:[0,3,9,4,5],anyth:[4,5],edit:0,drop:0,separ:9,each:[0,10,9,11,5],unicod:5,intellig:4,wrap:[0,3,5],expect:5,britta:9,happen:[9,5],out:[9,5],content:[2,1],perri:9,suitabl:[0,5],print:9,correct:[9,5],insid:9,lt_:3,free:5,add_to_set:[10,9,11],reason:5,base:[0,10,5],dictionari:[0,3,5],documentexcept:0,or_:[10,3],couldn:0,thread:4,could:5,datetimefield:5,thing:[10,9],length:5,place:[0,9],isn:0,some_db:4,assign:[9,5],first:[10,9,11],oper:[0,3,4,5,10,11],rang:5,eq_:3,onc:9,number:[0,10,9,5],unlik:10,alreadi:5,done:[0,5],wrapper:4,wasn:0,owner:0,miss:0,primari:4,size:5,given:[10,3,9,5],db_field:5,strict:5,associ:[0,10,4,5],interact:[9,5],construct:[9,5],get_extra_field:0,numberfield:5,max_length:5,too:5,statement:4,conveni:9,store:5,schema:[2,1,7],is_valid_unwrap:5,option:[0,5],especi:5,shirlei:9,specifi:[10,0,3,5],exactli:9,than:[10,9],serv:9,config_extra_field:0,whenev:5,provid:[0,3],remov:[10,11],get_index:[0,4],were:9,pre:[0,5],comput:[2,7,5],blooddonor:9,not_:[10,3],arg:[4,5],query_express:[10,3],argument:[0,10,9,4,5],raw:10,badvalueexcept:5,have:[0,9,4,5],tabl:1,need:[3,9,4,5],notimplementederror:5,i_nam:0,mongo_id:0,probabl:5,self:9,somedocclass:10,note:[3,9,11,5],also:[0,3,4,5,10,9],exampl:[0,1,3,5,6,10,9],take:[9,5],which:[0,10,9,4,5],donor:[0,9],singl:[0,3,9,5],begin:4,though:9,object:[0,1,2,4,5,7,8,10,9],pair:[9,5],"class":[0,3,4,5,9,10,11],appear:5,doc:5,clear:[9,4],later:4,request:4,doe:[10,3,4],declar:5,jenkin:9,"_id":[0,9,4],max_valu:5,class_nam:0,"__str__":9,session:[2,1,10,9,4],impact:4,current:[0,10,4,5],onli:[10,9,5],explicitli:0,nadir:9,intfield:[0,9,5],explain:10,should:[0,10,4,5],dict:[0,5],get_field:0,setfield:5,count:10,min_valu:[0,9,5],get:[3,9,4],express:[0,1,2,3,8,9,10,11],watch:5,requir:[0,11,5],mapper:[2,1,7],keyword:4,ge_:3,"default":[0,5],contain:5,comma:9,where:[3,9,5],set:[0,10,9,11,5],see:[0,10,9,4,5],result:[10,9],respons:4,fail:5,kei:[10,9,5],hopefulli:9,databas:[0,4,5,11,10,9],someth:[0,5],enough:9,between:[0,9],"import":9,gt_:3,attribut:[0,3,9],extend:[10,11],numer:5,dictfield:5,entir:5,objectidfield:5,come:9,computedfield:5,addit:0,both:[0,9,5],accident:9,last:[9,11],retrieved_field:0,etc:5,instanc:[0,3,4,5,10,9],basestr:[4,5],computed_typ:5,load:[0,9,5],simpli:10,kwd:[4,5],can:[0,3,4,5,10,9],had:9,pop:11,exst:3,fieldnotretriev:[0,10],respect:5,duplic:0,compos:5,invers:5,been:[9,5],weirdli:5,interest:9,basic:9,field:[0,1,2,3,4,5,7,8,9,10,11],rather:9,min_capac:5,search:1,ani:[0,9,4,5],floatfield:5,understand:[0,10,9,5],child:5,present:9,"case":9,badresultexcept:10,look:9,cursor:10,drop_dup:0,"while":0,abov:9,error:[0,5],fun:5,increment:11,non:5,usagei:3,kwarg:[0,5],anythingfield:5,"__init__":4,parent:3,welcom:1,perform:[10,3,9,4],make:[0,9,4,5],get_typ:3,same:[10,3,9,4,5],shorter:9,handl:[9,4],tutori:[1,9],descend:[0,10],end_request:4,document:[0,1,2,5,7,10,9],complet:9,update_express:11,validate_unwrap:[0,5],fairli:9,moment:9,rais:[0,10,9,5],user:3,remove_al:[10,11],documentfield:5,chang:9,entri:0,well:[10,9,5],inherit:5,without:[4,5],command:9,clear_collect:[9,4],thi:[0,3,4,5,10,9],queryresult:10,just:5,rest:9,max_dat:5,languag:[2,1,3,8,9],hint:[10,9],interfer:3,jeff:[3,9],type_ag:0,except:[0,2,5,7,10,9],add:[10,0,3,9,11],other:[0,10,4,5],versa:0,primit:[2,7,5],input:5,save:[0,9,5],explanatori:9,smart:4,max_capac:5,around:4,format:[4,5],outermost:9,validate_wrap:5,know:4,queryexpress:[10,0,3],insert:[9,4,5],like:[9,5],specif:5,arbitrari:5,docutil:[0,5],negat:[10,3],missingvalueexcept:0,with_limit_and_skip:10,collect:[0,3,9,4,5],necessari:[10,9],output:5,computedfieldvalu:5,page:1,underli:[0,3,5],right:5,deal:0,kvfield:5,creation:[0,5],some:[9,4],item_typ:5,server:[9,11],outer_field:3,listfield:5,definit:[2,0,5,7,1],subclass:[0,10,9,5],cast:9,larg:5,mongodb:[3,5],refer:10,who:9,run:9,some_obj:4,compute_valu:5,someclass:4,stringfield:[0,9,5],usag:3,obei:5,although:4,acc:3,comparison:5,ascend:[0,10],obj:[0,3,4,5],socket:4,constraint:[0,9],issu:3,somedoc:3,constructor:[0,9,5],commit:0,enumfield:[9,5],produc:[3,5],own:5,qfield:[10,11],"float":5,automat:0,son:0,ensur:[0,4],your:5,span:[0,5],wai:[9,4],execut:[9,0,10,11,4],transform:[0,5],fast:5,avail:9,start:[3,9],includ:10,primitivefield:5,paren:3,blooddon:9,"_collection_nam":0,"function":[9,4,5],form:[0,9,5],unwrap:[0,5],tupl:5,boolfield:5,blood_typ:[0,10,9],atom:11,line:9,"true":[4,5],pop_last:[10,11],succe:[],possibl:[0,9,5],whether:5,maximum:5,limit:10,otherwis:[0,5],connect:[9,4],creat:[0,3,4,5,10,9],"int":5,flush:4,repres:[3,11,5],incomplet:9,file:9,check:[10,3,9,5],inc:[10,9,11],again:5,in_:[10,3],first_q:10,when:[0,10,9,4,5],detail:9,min_dat:5,valid:[9,5],allow_non:5,you:5,pymongo:[0,10,9,4,5],sequenc:[2,7,5],femal:9,receiv:9,vice:0,hint_desc:[10,9],rule:5,ignor:[0,5],unset:[10,11,5],inner_field:3},objtypes:{"0":"py:module","1":"py:method","2":"py:classmethod","3":"py:attribute","4":"py:class","5":"py:exception"},titles:["document","Welcome to MongoAlchemy’s documentation!","API documentation","Mongo Query Expression Language","Session","fields","Examples","Schema \u2014 Document-Object Mapper and Schema Definitions","Expression Language \u2014 Querying and Updating","MongoAlchemy Tutorial","Query Objects","Update Expressions"],objnames:{"0":"Python module","1":"Python method","2":"Python class method","3":"Python attribute","4":"Python class","5":"Python exception"},filenames:["api/schema/document","index","api/index","api/expressions/query_expressions","api/session","api/schema/fields","examples/index","api/schema/index","api/expressions/index","tutorial","api/expressions/query","api/expressions/update_expressions"]}) \ No newline at end of file diff --git a/mongoalchemy/document.py b/mongoalchemy/document.py index e8a2632..90f754f 100644 --- a/mongoalchemy/document.py +++ b/mongoalchemy/document.py @@ -94,7 +94,9 @@ class Document(object): config_extra_fields = 'error' ''' Controls the method to use when dealing with fields passed in to the - document constructor. Possible values are 'error' and 'ignore' ''' + document constructor. Possible values are 'error' and 'ignore'. Any + fields which couldn't be mapped can be retrieved (and edited) using + :func:`~Document.get_extra_fields` ''' def __init__(self, retrieved_fields=None, **kwargs): ''' @@ -177,6 +179,9 @@ def __getattribute__(self, name): ''' def get_extra_fields(self): + ''' if :attr:`Document.config_extra_fields` is set to 'ignore', this method will return + a dictionary of the fields which couldn't be mapped to the document. + ''' return self.__extra_fields @classmethod