merge
authorsylvain.thenault@logilab.fr
Fri, 13 Feb 2009 16:28:57 +0100
changeset 621 79123c597835
parent 618 68702d0c02f1 (current diff)
parent 620 be2dcc361105 (diff)
child 622 2d30c5e1a7d2
merge
--- a/doc/book/en/B0031-define-entities.en.txt	Fri Feb 13 15:12:36 2009 +0100
+++ b/doc/book/en/B0031-define-entities.en.txt	Fri Feb 13 16:28:57 2009 +0100
@@ -55,13 +55,20 @@
 It is possible to manage attributes/relations in the simple or multiple
 editing form thanks to the following *rtags*: 
 
-* `primary`, indicates that an attribute or a relation has to be inserted
-  in the simple or multiple editing forms. In the case of a relation,
-  the related entity editing form will be included in the editing form.
+* `primary`, indicates that an attribute or a relation has to be
+  inserted **in the simple or multiple editing forms**. In the case of
+  a relation, the related entity editing form will be included in the
+  editing form and represented as a combobox. Each item of the
+  combobox is a link to an existing entity.
 
-* `secondary`, indicates that an attribute or a relation has to be inserted
-  in the simple editing form only. In the case of a relation, the related
-  entity editing form sill be included in the editing form.
+* `secondary`, indicates that an attribute or a relation has to be
+  inserted **in the simple editing form only**. In the case of a
+  relation, the related entity editing form will be included in the
+  editing form and represented as a combobox. Each item of the combobox
+  is a link to an existing entity.
+
+* `inlineview`, includes the target entity's form in the editing form
+  of the current entity.
 
 * `generic`, indicates that a relation has to be inserted in the simple
   editing form, in the generic box of relation creation.
--- a/web/views/euser.py	Fri Feb 13 15:12:36 2009 +0100
+++ b/web/views/euser.py	Fri Feb 13 16:28:57 2009 +0100
@@ -14,7 +14,6 @@
 from cubicweb.web.form import EntityForm
 from cubicweb.web.views.baseviews import PrimaryView, EntityView
 
-
 class EUserPrimaryView(PrimaryView):
     accepts = ('EUser',)
     skip_attrs = ('firstname', 'surname')
@@ -33,7 +32,6 @@
         return  rschema.type in ['interested_in', 'tags', 
                                  'todo_by', 'bookmarked_by',
                                  ]
-
 class FoafView(EntityView):
     id = 'foaf'
     accepts = ('EUser',)
@@ -42,10 +40,10 @@
     content_type = 'text/xml'
 
     def call(self):
-        self.w(u'<?xml version="1.0" encoding="%s"?>\n' % self.req.encoding)
-        self.w(u'<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n')
-        self.w(u'xmlns:rdfs="http://www.w3org/2000/01/rdf-schema#"\n')
-        self.w(u'xmlns:foaf="http://xmlns.com/foaf/0.1/">\n')
+        self.w('''<?xml version="1.0" encoding="%s"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:rdfs="http://www.w3org/2000/01/rdf-schema#"
+         xmlns:foaf="http://xmlns.com/foaf/0.1/"> '''% self.req.encoding)
         for i in xrange(self.rset.rowcount):
             self.cell_call(i, 0)
         self.w(u'</rdf:RDF>\n')
@@ -70,7 +68,12 @@
             self.w(u'<foaf:mbox>%s</foaf:mbox>\n' % html_escape(emailaddr))
         self.w(u'</foaf:Person>\n')
 
-
+class FoafUsableView(FoafView):
+    id = 'foaf_usable'
+  
+    def call(self):
+        self.cell_call(0, 0)
+            
 class EditGroups(EntityForm):
     """displays a simple euser / egroups editable table"""