Changeset 5212 for MILK


Ignore:
Timestamp:
21/04/09 15:12:22 (10 years ago)
Author:
cbyrom
Message:

Adjust the Atom and MolesEntity? data models to store their data
internally, 'as is' - and to escape/unescape XML unfriendly characters
on data export/import. Adjust templates and inputs processing to
cope with this change - which allows the input of most characters
without problem (NB, old method caused unfriendly errors when illegal
characters were detected).

Location:
MILK/trunk/milk_server/milk_server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/atomeditorcontroller.py

    r5199 r5212  
    55''' 
    66import logging, cgi 
     7from xml.sax.saxutils import unescape 
    78from ndg.common.src.models.ndgObject import ndgObject 
    89from milk_server.lib.base import * 
     
    9293        for key, val in inputs.items(): 
    9394            if not isinstance(val, cgi.FieldStorage): 
    94                 tidyInputs[key] = val 
     95                tidyInputs[key] = unescape(val) 
    9596 
    9697        logging.debug("Pickleable data extracted") 
  • MILK/trunk/milk_server/milk_server/templates/atom_list_results.html

    r5134 r5212  
    7272                                </td> 
    7373                                <td> 
    74                                 <a href="$atom.href" onclick="Div_show('loading');">${Markup(atom.name)}</a> 
     74                                <a href="$atom.href" onclick="Div_show('loading');">$atom.name</a> 
    7575                                </td> 
    7676                                <td> 
  • MILK/trunk/milk_server/milk_server/templates/utils.html

    r5175 r5212  
    11<?python 
     2 from xml.sax.saxutils import escape 
    23 def et2string(x): 
    34     #use this to strip namespaces for children within text elements 
     
    5253                                # adjust non-editable data to cope with newlines 
    5354                                nonEditVal = "" 
     55                                value = escape(value) 
    5456                                if value: 
    5557                                        nonEditVal = value.replace('\n', '<br />') 
Note: See TracChangeset for help on using the changeset viewer.