Index: controlies/trunk/applications/controlies/views/laptops/index.html
===================================================================
--- controlies/trunk/applications/controlies/views/laptops/index.html	(revision 350)
+++ controlies/trunk/applications/controlies/views/laptops/index.html	(revision 351)
@@ -56,9 +56,9 @@
                 
                 colNames:['Marca','Modelo','Número Serie'],
                 colModel:[ 
-                    {name:'marca',index:'marca', width:60, align:"center"},
-                    {name:'modelo',index:'modelo', width:115, align:"center"},
-                    {name:'numero_serie',index:'numero_serie', width:115, align:"center"}
+                    {name:'trademark',index:'trademark', width:60, align:"center"},
+                    {name:'model',index:'model', width:115, align:"center"},
+                    {name:'serial_number',index:'serial_number', width:115, align:"center"}
                 ], 
                 rowNum:25,
                 height:335,
@@ -65,7 +65,7 @@
                 width: 900,
                 rowList:[25,50,75],  
                 pager: '#pager', 
-                sortname: 'marca', 
+                sortname: 'trademark', 
                 autowidth: false,
                 viewrecords: true, 
                 sortorder: "asc", 
@@ -163,11 +163,11 @@
 				jQuery("#form_data #user").css("background-color","#DDD");
 				jQuery("#form_data #messageForm").html("Todos los campos son obligatorios");
 				
-				jQuery.post('call/json/getLaptopData',{ id_portatil: id }, function(result) {						
+				jQuery.post('call/json/getLaptopData',{ id_laptop: id }, function(result) {						
 
-					jQuery("#form_data #id_portatil").val(result.response['id_portatil']);
-					jQuery("#form_data #numero_serie").val(result.response['numero_serie']);
-					jQuery("#form_data #marca_modelo").val(result.response['id_marca_modelo']);					
+					jQuery("#form_data #id_laptop").val(result.response['id_laptop']);
+					jQuery("#form_data #serial_number").val(result.response['serial_number']);
+					jQuery("#form_data #id_trademark").val(result.response['id_trademark']);					
 
 					x = (jQuery(window).width()-350)/2;
 					y = (jQuery(window).height()-500)/2;
@@ -197,7 +197,7 @@
                 modal: true,
                 buttons: {
                     "Borrar": function() {
-                        jQuery.post("call/json/delete","id_portatil="+id, function(data){
+                        jQuery.post("call/json/delete","id_laptop="+id, function(data){
                             jQuery("#dialog-confirm").dialog( "close" );
                             jQuery("#list").trigger("reloadGrid");
                         });
@@ -212,7 +212,7 @@
     function getAllLaptopTypes(){
             $.post("/controlies/laptops/call/json/getAllLaptopTypes",   function(result) {
                 $.each( result.response, function(i, l){
-                    jQuery("#form_data #marca_modelo").append("<option value='"+l.id_marca_modelo+"'>"+l.marca_modelo+"</option>");
+                    jQuery("#form_data #id_trademark").append("<option value='"+l.id_trademark+"'>"+l.trademark+"</option>");
                 });                    
             });             
     }
Index: controlies/trunk/applications/controlies/views/laptops/form.html
===================================================================
--- controlies/trunk/applications/controlies/views/laptops/form.html	(revision 350)
+++ controlies/trunk/applications/controlies/views/laptops/form.html	(revision 351)
@@ -28,7 +28,7 @@
                     jQuery('#message').html("Se produjo un error").effect("highlight", {"color":"yellow"}, 1000);
                     break;
                 }
-                case "existe_numero_serie":{
+                case "serial_number_exists":{
                     jQuery('#numero_serieTag').css("color","red");
                     jQuery('#numero_serie').effect("highlight", {"color":"yellow"}, 1000).focus();
                     jQuery('#message').html("Ya existe ese número de serie").effect("slide");                  
@@ -50,14 +50,14 @@
  
 <form id="form_data" onsubmit="return send();">
     <input type="hidden" id="action" name="action"/>
-    <input type="hidden" id="id_portatil" name="id_portatil"/>    
+    <input type="hidden" id="id_laptop" name="id_laptop"/>    
     <div>
-		<p><span id="marca_modeloTag">Marca / Modelo</span><br>
-			<select type="text" id="marca_modelo" name="marca_modelo">
+		<p><span id="id_trademarkTag">Marca / Modelo</span><br>
+			<select type="text" id="id_trademark" name="id_trademark">
 				<option value="none">Seleccione...</option>
 			</select>
 		</p>    
-		<p><span id="numero_serieTag">Número Serie</span><br><input type="text" id="numero_serie" name="numero_serie"/></p>        </div>
+		<p><span id="serial_numberTag">Número Serie</span><br><input type="text" id="serial_number" name="serial_number"/></p>
     </div>
     <div id="message" style="text-align:center; font-weight:bold; color:red; padding:3px; "></div>
     <div style="text-align:center;"><button id="saveButton" type="submit" style="width:100px;">Guardar</button>&nbsp;&nbsp;<button type="button" id="cancelButton" style="width:100px;">Cancelar</button></div>
Index: controlies/trunk/applications/controlies/controllers/laptops.py
===================================================================
--- controlies/trunk/applications/controlies/controllers/laptops.py	(revision 350)
+++ controlies/trunk/applications/controlies/controllers/laptops.py	(revision 351)
@@ -17,7 +17,7 @@
 @service.json
 def getLaptopData():
     my = SQLiteConnection()
-    l = Laptops(my,request.vars['id_portatil'],"","")
+    l = Laptops(my,request.vars['id_laptop'],"","")
     response = l.getLaptopData()
     return dict(response=response)
 
@@ -32,7 +32,7 @@
 @auth.requires_login()       
 def delete():
     my = SQLiteConnection()
-    l = Laptops(my,request.vars["id_portatil"],"","")
+    l = Laptops(my,request.vars["id_laptop"],"","")
     response = l.delete()                         
     return dict(response=response)
 
@@ -40,7 +40,7 @@
 @auth.requires_login()    
 def modify():
     my = SQLiteConnection()
-    l = Laptops(my,request.vars["id_portatil"],request.vars["numero_serie"],request.vars["marca_modelo"])
+    l = Laptops(my,request.vars["id_laptop"],request.vars["serial_number"],request.vars["id_trademark"])
     response = l.process(request.vars["action"])
     return dict(response = response)            
 
Index: controlies/trunk/applications/controlies/modules/Laptops.py
===================================================================
--- controlies/trunk/applications/controlies/modules/Laptops.py	(revision 350)
+++ controlies/trunk/applications/controlies/modules/Laptops.py	(revision 351)
@@ -29,28 +29,28 @@
     def __init__(self):
         pass
     
-    def __init__(self,SQLite,id_portatil,numero_serie,id_marca_modelo):
+    def __init__(self,SQLite,id_laptop,serial_number,id_trademark):
         self.SQLite = SQLite
-        self.id_portatil = id_portatil        
-        self.numero_serie = numero_serie
-        self.id_marca_modelo = id_marca_modelo        
+        self.id_laptop = id_laptop        
+        self.serial_number = serial_number
+        self.id_trademark = id_trademark        
         
     def validation(self,action):
 
-        if self.id_marca_modelo == "none":
-            return "marca_modelo"
+        if self.id_trademark == "none":
+            return "id_trademark"
 
-        if self.numero_serie == "":
-            return "numero_serie"
+        if self.serial_number == "":
+            return "serial_number"
         
-        exists = self.existsSerialNumber(self.numero_serie)
+        exists = self.existsSerialNumber(self.serial_number)
         
         if action=="add" and exists!=False:
-            return "existe_numero_serie"
+            return "serial_number_exists"
 
         if action=="modify" and exists!=False:
-            if exists!=self.id_portatil:
-                return "existe_numero_serie"
+            if exists!=self.id_laptop:
+                return "serial_number_exists"
                 
         return "OK"
 
@@ -76,32 +76,33 @@
             
     def list(self,args):
         db = self.SQLite.getDB()
-        rows = db().select(db.laptops.id_laptop)
-        print rows.id_laptop
 
-        """sql = "SELECT p.id_portatil, pmm.marca, pmm.modelo, p.numero_serie FROM portatiles p, portatiles_marca_modelo pmm "
-        sql = sql+"WHERE p.id_marca_modelo=pmm.id_marca_modelo"
+        sql = "SELECT l.id_laptop, t.trademark, t.model, l.serial_number"
+        sql = sql+" FROM laptops l LEFT JOIN laptops_trademarks t ON l.id_trademark=t.id_trademark "
         
+        sql = sql+" WHERE 1=1 "
+        
         try:
-            if str(args['numero_serie']) != "None":
-                sql = sql+" AND p.numero_serie LIKE '%"+str(args['numero_serie'])+"%'"
+            if str(args['serial_number']) != "None":
+                sql = sql+" AND l.serial_number LIKE '%"+str(args['serial_number'])+"%'"
         except LookupError:
             pass
 
         try:
-            if str(args['marca']) != "None":
-                sql = sql+" AND pmm.marca LIKE '%"+str(args['marca'])+"%'"
+            if str(args['trademark']) != "None":
+                sql = sql+" AND t.trademark LIKE '%"+str(args['trademark'])+"%'"
         except LookupError:
             pass
 
         try:
-            if str(args['modelo']) != "None":
-                sql = sql+" AND pmm.modelo LIKE '%"+str(args['modelo'])+"%'"
+            if str(args['model']) != "None":
+                sql = sql+" AND t.model LIKE '%"+str(args['model'])+"%'"
         except LookupError:
             pass
 
         sql = sql + " ORDER BY "+args['sidx']+" "+args['sord']
-        result = self.MySQL.execute(sql)
+        
+        result = db.executesql(sql)
 
         rows = []
         for reg in result:
@@ -108,9 +109,9 @@
             row = {
 				"id":reg[0],
 				"cell":[reg[1],reg[2],reg[3]],
-				"marca":reg[1],
-				"modelo":reg[2],
-				"numero_serie":reg[3]
+				"trademark":reg[1],
+				"model":reg[2],
+				"serial_number":reg[3]
             }
             rows.append(row)
 
@@ -133,38 +134,45 @@
         if page > totalPages:
             page = totalPages
 
-        return { "page":page, "total":totalPages, "records":len(rows), "rows":rows[start:finish] }"""
-        return True
+        return { "page":page, "total":totalPages, "records":len(rows), "rows":rows[start:finish] }
 
 
     def add(self):
-        """sql = "INSERT INTO portatiles (id_portatil, numero_serie, id_marca_modelo) "
-        sql = sql + "VALUES(null,'"+self.numero_serie+"','"+self.id_marca_modelo+"')"
-        result = self.MySQL.execute(sql)"""
-        data = { 'id_laptop':'1', 'serial_number':self.numero_serie, 'id_trademark':self.id_marca_modelo }
-        self.SQLite.insert(laptops,data)
+        sql = "INSERT INTO laptops (id_laptop, serial_number, id_trademark) "
+        sql = sql + "VALUES(null,'"+self.serial_number+"','"+self.id_trademark+"')"
+
+        db = self.SQLite.getDB()
+        result = db.executesql(sql)
+        
         return "OK"
             
             
-    """def modify(self):
-        sql = "UPDATE portatiles SET numero_serie='"+self.numero_serie+"', id_marca_modelo='"+self.id_marca_modelo+"' "
-        sql = sql + "WHERE id_portatil='"+str(self.id_portatil)+"'"
-        result = self.SQLite.execute(sql)
+    def modify(self):
+        sql = "UPDATE laptops SET serial_number='"+self.serial_number+"', id_trademark='"+self.id_trademark+"' "
+        sql = sql + "WHERE id_laptop='"+str(self.id_laptop)+"'"
+
+        db = self.SQLite.getDB()
+        result = db.executesql(sql)
                     
         return "OK"
 
 
     def delete(self):
-        sql = "DELETE FROM portatiles WHERE id_portatil='"+str(self.id_portatil)+"'"
-        result = self.SQLite.execute(sql)
+        sql = "DELETE FROM laptops WHERE id_laptop='"+str(self.id_laptop)+"'"
+
+        db = self.SQLite.getDB()
+        result = db.executesql(sql)
             
         return "OK"
 
 
-    def existsSerialNumber(self,serial):
+    def existsSerialNumber(self,serial_number):
         
-        sql = "SELECT p.id_portatil FROM portatiles p WHERE p.numero_serie='"+serial+"'"
-        result = self.MySQL.execute(sql)
+        sql = "SELECT p.id_laptop FROM laptops p WHERE p.serial_number='"+serial_number+"'"
+
+        db = self.SQLite.getDB()
+        result = db.executesql(sql)
+
         if len(result) > 0:
             return str(result[0][0])
         
@@ -172,23 +180,28 @@
         
     def getLaptopData(self):
 		
-        sql="SELECT * FROM portatiles p WHERE id_portatil='"+self.id_portatil+"'"
-        result = self.MySQL.execute(sql)
+        sql="SELECT * FROM laptops p WHERE id_laptop='"+str(self.id_laptop)+"'"
+
+        db = self.SQLite.getDB()
+        result = db.executesql(sql)
+        print result
         dataLaptop = {
-            "id_portatil":str(result[0][1]),
-            "numero_serie":result[0][0],
-            "id_marca_modelo":str(result[0][2])
+            "id_laptop":str(result[0][0]),
+            "serial_number":result[0][1],
+            "id_trademark":str(result[0][2])
         }
         return dataLaptop
 
     def getAllLaptopTypes(self):
-        sql="SELECT id_marca_modelo, marca, modelo FROM portatiles_marca_modelo ORDER BY marca"
-        result = self.MySQL.execute(sql)
+        sql="SELECT id_trademark, trademark, model FROM laptops_trademarks ORDER BY trademark"
+        db = self.SQLite.getDB()
+        result = db.executesql(sql)
+
         data=[]
         for r in result:
             dataType = {
-                "id_marca_modelo":str(r[0]),
-                "marca_modelo":r[1]+" / "+r[2]
+                "id_trademark":str(r[0]),
+                "trademark":r[1]+" / "+r[2]
             }
             data.append(dataType)
-        return data"""
\ No newline at end of file
+        return data
\ No newline at end of file
