# OpenERP web_rpc examples

## Example 1: Display a list of defined ir.model

### Code:

    <script type="text/javascript" src="/base/webclient/js?mods=web_rpc"></script>
    <script type="text/javascript">

        var c = openerp.init(); // get a new webclient
        c._modules_loaded = true; // Hack to prevent loading of additional modules

        var s = new c.base.Session(); // setup a Session
        s.login("web-trunk", "admin", "admin", function() {

                var ds = new c.base.DataSetSearch(s, "ir.model"); // DataSetSearch used to search, read
                ds.read_slice(['name','model'], {}, function(users){
                    for(var i in users) {
                        $("#ex1res").append("<li>" + users[i].model + " (" + users[i].name + ") </li>")
                    }
                });
            }
        );
    </script>

### Div for output:

## Help me to complete this example page on launchpad