Demo entry 6721501

System API

   

Submitted by anonymous on Mar 21, 2018 at 17:51
Language: Python 3. Code size: 416 Bytes.

class SchoolView(DetailView):

    def record(self, **kwargs):
        id = kwargs["school_id"]
        cursor.execute("SELECT * FROM schools WHERE establishment_name=%s", [id])
        record = cursor.fetchone()
        return {
                "posts": url_for(".posts", school_id=id, _external=True),
                "topics": url_for(".topics", school_id=id, _external=True),
                **record
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).