I have a function that does certain checks, if the the checks fail, it will add values to a dict, i.e: outstanding = {} sims = [_sim for _sim in self.context.sims if unicode(_sim.iccid)] # for sim in [_sim for _sim in self.context.sims if unicode(_sim.iccid)]: print sims count = len(sims) if count > 250: outstanding["pack.maximum"] = count if count < 5: outstanding["pack.minimum"] = count If these checks fail I raise an exception: if outstanding: raise HTTPInternalServerError(outstanding) This will raise an error on my template, I handle with ajax error handler: error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR); hide_spinner(); show_error(1,"There was an error …

Member Avatar
+0 forum 0

I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful. I do not know what to do with AJAX $.post data. I do not know how to store that data in MongoDB as a Document. my AJAX: var url = "{{'add_candidate'|route_url}}"; $("form[name='is_submitted']").submit(function(e) { e.preventDefault(); var data = $('form').serialize(); $.post(url, data).success(function(data, status) { alert("Data: " + data + "\nStatus: " + …

Member Avatar
+0 forum 0

I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful. I do not know what to do with AJAX $.post data. I do not know how to store that data in MongoDB as a Document. my AJAX: var url = "{{'add_candidate'|route_url}}"; $("form[name='is_submitted']").submit(function(e) { e.preventDefault(); var data = $('form').serialize(); $.post(url, data).success(function(data, status) { alert("Data: " + data + "\nStatus: " + …

Member Avatar
+0 forum 0

Hi, I am new to Python and am looking into web development frameworks i.e. Pyramid. Is there anyone here who is familiar with this Framework using MongoDB? I am using pymongo and Ming I follwed a tutorial [here](http://pieceofpy.com/2012/01/10/working-with-pyramid-and-ming/). I am getting an `AttributeError: 'str' object has no attribute '_auto_ensure_indexes'` in this code : from ming import Session from ming.datastore import DataStore from ming.orm import ThreadLocalORMSession from ming.orm import Mapper session = Session DBSession = ThreadLocalORMSession(session) def init_mongo(engine): server, database = engine datastore = DataStore(server, database=database) session.bind = datastore Mapper.compile_all() # Here we just ensure indexes on all our mappers at …

Member Avatar
Member Avatar
+0 forum 1

**Pyramid Pattern** Dear Listers, I am in the process of wrting a java code that prints the following pattern 123454321 1234*4321 123***321 12*****21 1*******1 This is the code that I have written as public class Pyramid { public static void main(String[] args) { int j; for (int i=1; i<5; i++) { for(j=1; j<5; j++) { System.out.print(j); } for(int k=j; k>0; k--) { System.out.print(k); } System.out.println(); } } } My out put is 123454321 123454321 123454321 123454321 Reuqest some hint in acheiving the desired output. Thanks Vilas

Member Avatar
Member Avatar
+0 forum 4

The End.