Search Results

Search found 2 results on 1 pages for 'leafstorm'.

Page 1/1 | 1 

  • Invoking a superclass's class methods in Python

    - by LeafStorm
    I am working on a Flask extension that adds CouchDB support to Flask. To make it easier, I have subclassed couchdb.mapping.Document so the store and load methods can use the current thread-local database. Right now, my code looks like this: class Document(mapping.Document): # rest of the methods omitted for brevity @classmethod def load(cls, id, db=None): return mapping.Document.load(cls, db or g.couch, id) I left out some for brevity, but that's the important part. However, due to the way classmethod works, when I try to call this method, I receive the error message File "flaskext/couchdb.py", line 187, in load return mapping.Document.load(cls, db or g.couch, id) TypeError: load() takes exactly 3 arguments (4 given) I tested replacing the call with mapping.Document.load.im_func(cls, db or g.couch, id), and it works, but I'm not particularly happy about accessing the internal im_ attributes (even though they are documented). Does anyone have a more elegant way to handle this?

    Read the article

  • Inline horizontal spacer in HTML

    - by LeafStorm
    I am making a Web page with a slideshow, using the same technique used on http://zine.pocoo.org/. The person I'm making the site for wants the slideshow to be centered. However, some of the photos are portrait layout and some are landscape. (This was not my choice.) I need a position: absolute to get the li's containing the items in the right place, so centering them does not work. (At least, not by normal methods.) So, I thought that it might work to insert a 124-pixel "spacer" before the image on the portrait pictures. I tried it with a <span style="width: 124px;">&nbsp;</span>, but it only inserts a single space, not the full 124 pixels. The slideshow fades in and out OK, though, so I think that it would work if I could get the proper spacing. My question is this: does anyone know a way to have 124px of space inline in HTML (preferably without using images), or another way to center the pictures in the li items?

    Read the article

1