I've not found a way to describe an xml attribute for a repeatable primitive type; my best guess so far:
class Contact(ComplexModel):
"contact person and communication channel"
contactName = primitive.Unicode(min_len=1, max_len=70, nillable=False)
channel = primitive.Unicode(max_occurs='unbounded')
channelCode = XmlAttribute(Enum('TELEPHONE', 'TELEFAX', 'EMAIL', 'WEBSITE', type_name='channelCode'), attribute_of='channel')
This produces a wsdl that looks like correct (at least to me):
<xs:complexType name="Contact">
<xs:sequence>
<xs:element name="channel" minOccurs="0" maxOccurs="unbounded" nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="channelCode" type="tns:channelCode"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="contactName" type="tns:Contact_contactNameType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
But I don't know how to use the Contact class!
>>> c = Contact()
>>> c.contactName = 'xxx'
>>> c.channel = [ '1', '2' ]
>>> # c.channelCode = ???