I'm not sure what exactly your question is but here you can see that what you think (It seems that python devserver handles empty language field as an error.) is not true.
Code snippet from that documentation
type Field struct {
// Name is the field name. A valid field name matches /[A-Z][A-Za-z0-9_]*/.
// A field name cannot be longer than 500 characters.
Name string
// Value is the field value. The valid types are:
// - string,
// - search.Atom,
// - search.HTML,
// - time.Time (stored with millisecond precision),
// - float64,
// - appengine.GeoPoint.
Value interface{}
// Language is a two-letter ISO 693-1 code for the field's language,
// defaulting to "en" if nothing is specified. It may only be specified for
// fields of type string and search.HTML.
Language string
// Derived marks fields that were calculated as a result of a
// FieldExpression provided to Search. This field is ignored when saving a
// document.
Derived bool
}
As you can see, if you specify no language, it defaults to "en"
However, as can be seen in the search api source code:
class Field(object):
"""An abstract base class which represents a field of a document.
This class should not be directly instantiated.
"""
TEXT, HTML, ATOM, DATE, NUMBER, GEO_POINT = ('TEXT', 'HTML', 'ATOM', 'DATE',
'NUMBER', 'GEO_POINT')
_FIELD_TYPES = frozenset([TEXT, HTML, ATOM, DATE, NUMBER, GEO_POINT])
def __init__(self, name, value, language=None):
"""Initializer.
In particular This class should not be directly instantiated.
There are some other Field subclasses that you should be using instead. For your current example you should use (assuming that p.id is a string. Otherwise use NumberField)
class TextField(Field):
"""A Field that has text content.
and
class AtomField(Field):
"""A Field that has content to be treated as a single token for indexing.