* improvement
bzr revid: mga@tinyerp.com-20081121125355-mjsfmldmqykc8nj2
This commit is contained in:
parent
5fde033037
commit
959d0130a2
|
@ -28,22 +28,13 @@
|
|||
|
||||
from osv import fields, osv
|
||||
import time
|
||||
#from core.Wiki2Html import Wiki2Html
|
||||
from StringIO import StringIO
|
||||
|
||||
class Tag(osv.osv):
|
||||
_name="wiki.wiki.tag"
|
||||
_description="Wiki"
|
||||
|
||||
_columns={
|
||||
'name':fields.char('Title',size=128),
|
||||
}
|
||||
Tag()
|
||||
from HTMLParser import HTMLParser
|
||||
|
||||
class Wiki(osv.osv):
|
||||
_name="wiki.wiki"
|
||||
_description="Wiki"
|
||||
_order = 'model_id'
|
||||
_order = 'name'
|
||||
_columns={
|
||||
'name':fields.char('Title', size=128, select=True, required=True),
|
||||
'write_uid':fields.many2one('res.users',"Last Modify By"),
|
||||
|
@ -51,11 +42,8 @@ class Wiki(osv.osv):
|
|||
'create_uid':fields.many2one('res.users','Authour', select=True),
|
||||
'create_date':fields.datetime("Created on", select=True),
|
||||
'write_date':fields.datetime("Last modified", select=True),
|
||||
'tags':fields.char('Tags', size=1024), # many2many("wiki.wiki.tag","wiki_tag_many_id","wiki_id","tag_id","Tags", select=True),
|
||||
'tags':fields.char('Tags', size=1024),
|
||||
'history_id':fields.one2many('wiki.wiki.history','history_wiki_id','History Lines'),
|
||||
'path':fields.char('Page Path',size=128),
|
||||
'model_id': fields.many2one('ir.model', 'Model id', select=True, ondelete='cascade'),
|
||||
'res_id': fields.integer("Record Id"),
|
||||
'minor_edit':fields.boolean('Thisd is a minor edit', select=True),
|
||||
'summary':fields.char('Summary',size=256, select=True),
|
||||
}
|
||||
|
@ -82,9 +70,7 @@ class Wiki(osv.osv):
|
|||
return super(Wiki,self).create(cr, uid, vals, context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
# wiki_data=self.read(cr,uid,ids,['minor_edit','summary'])[0]
|
||||
if vals.get('text_area'):
|
||||
# vals['html'] = self.Wiki2Html(vals['text_area'])
|
||||
if vals.has_key('minor_edit') and vals.has_key('summary'):
|
||||
vals['history_id']=[[0,0,{'minor_edit':vals['minor_edit'],'text_area':vals['text_area'],'modify_by':uid,'summary':vals['summary']}]]
|
||||
elif vals.has_key('minor_edit'):
|
||||
|
@ -132,9 +118,6 @@ class History(osv.osv):
|
|||
|
||||
History()
|
||||
|
||||
from StringIO import StringIO
|
||||
from HTMLParser import HTMLParser
|
||||
|
||||
class IndexLine(osv.osv):
|
||||
_name="wiki.index.line"
|
||||
_description="Index Lines"
|
||||
|
|
|
@ -4,115 +4,6 @@
|
|||
<record model="wiki.wiki" id="base_wiki_home">
|
||||
<field name="name">Wiki Home</field>
|
||||
<field name="minor_edit">False</field>
|
||||
<field name="text_area">
|
||||
<![CDATA[==Comment Test==
|
||||
This is a test Formatting
|
||||
|
||||
==Bold Italic, and Underline Test==
|
||||
You can ''italicize text'' by putting 2
|
||||
apostrophes on each side.
|
||||
3 apostrophes will embolden '''the text'''.
|
||||
5 apostrophes will embolden and italicize
|
||||
'''''the text'''''.
|
||||
(4 apostrophes don't do anything
|
||||
special -- there's just ''''one left
|
||||
over''''.)
|
||||
==Text with bullets==
|
||||
You should "sign" your comments
|
||||
on talk pages:
|
||||
* Three tildes give your user
|
||||
name: ~~~
|
||||
* Four tildes give your user
|
||||
name plus date/time: ~~~~
|
||||
* Five tildes give the
|
||||
date/time alone: ~~~~~
|
||||
==Formatting Test - 3==
|
||||
== Section headings ==
|
||||
''Headings'' organize your writing into sections.
|
||||
The Wiki software can automatically generate
|
||||
a table of contents from them.
|
||||
=== Subsection ===
|
||||
Using more equals signs creates a subsection.
|
||||
==== A smaller subsection ====
|
||||
Don't skip levels,
|
||||
like from two to four equals signs.
|
||||
Start with 2 equals signs not 1
|
||||
because 1 creates H1 tags
|
||||
which should be reserved for page title.
|
||||
==Formatting Test - 4==
|
||||
* ''Unordered lists'' are easy to do:
|
||||
** Start every line with a star.
|
||||
*** More stars indicate a deeper level.
|
||||
*: Previous item continues.
|
||||
** A new line
|
||||
* in a list
|
||||
marks the end of the list.
|
||||
* Of course you can start again.
|
||||
==Formatting Test - 5==
|
||||
# ''Numbered lists'' are:
|
||||
## Very organized
|
||||
## Easy to follow
|
||||
#: Previous item continues
|
||||
A new line marks the end of the list.
|
||||
# New numbering starts with 1.
|
||||
==Formatting Test - 6==
|
||||
: A colon (:) indents a line or paragraph.
|
||||
A newline starts a new paragraph. <br>
|
||||
Often used for discussion on talk pages.
|
||||
: We use 1 colon to indent once.
|
||||
:: We use 2 colons to indent twice.
|
||||
::: 3 colons to indent 3 times, and so on.
|
||||
==Formatting Test - 7==
|
||||
Here's a link to the [[ Main page ]].
|
||||
==Formatting Test - 8==
|
||||
[[Intentionally permanent red link]] is
|
||||
a page that doesn't exist
|
||||
yet. You could create it by
|
||||
clicking on the link.
|
||||
==Formatting Test - 9==
|
||||
You can link to a page section by its title:
|
||||
* [[Help:Contents#For editors]].
|
||||
If multiple sections have the same title, add
|
||||
a number. [[#Example section 3]] goes to the
|
||||
third section named "Example section".
|
||||
==Formatting Test-10==
|
||||
Here's a ''definition list'':
|
||||
; Word : Definition of the word
|
||||
; A longer phrase needing definition
|
||||
: Phrase defined
|
||||
; A word : Which has a definition
|
||||
: Also a second one
|
||||
: And even a third
|
||||
|
||||
Begin with a semicolon. One item per line;
|
||||
a newline can appear before the colon, but
|
||||
using a space before the colon improves
|
||||
parsing.
|
||||
==Formatting Test - 11==
|
||||
You can add footnotes to sentences using
|
||||
the ''ref'' tag -- this is especially good
|
||||
for citing a source.
|
||||
|
||||
:There are over six billion people in the
|
||||
world.<ref>CIA World Factbook, 2006.</ref>
|
||||
|
||||
For details, see [[Footnotes | Wikipedia:Footnotes]]
|
||||
and [[Help:Footnotes]].
|
||||
==Formatting Test - 12==
|
||||
This is a Link
|
||||
[[Page | MainPage]] do not show up in line
|
||||
but instead at page bottom
|
||||
''and cause the page to be listed in the category.''
|
||||
[[Category:English documentation]]
|
||||
|
||||
Add an extra colon to ''link'' to a category in line
|
||||
without causing the page to be listed in the category:
|
||||
[[:Category:English documentation]]
|
||||
==Formatting Test-12==
|
||||
===Apple Desktop Image===
|
||||
img://apple.jpg
|
||||
===Ubuntu Desktop Image===
|
||||
img://ubuntu-01.jpg]]></field>
|
||||
<field name="summary"></field>
|
||||
</record>
|
||||
</data>
|
||||
|
|
Loading…
Reference in New Issue