I would recommend that you don't use the patch decorator, but rather the
patch function itself. Here is a wrapper function I used when patching
classes and functions (assuming you are using TestCase class):
def patch(self, *args):
if len(args) == 2:
patcher = patch.object(
Both patterns will produce same query. You can also use
django-debug-toolbar, which gives ur debugsqlshell tool. So you can execute
code from the commandline and can see what the query will be.
Django also has a code pattern for your case - for getting the first
element, you can just use latest
Like this
http://readthedocs.org/docs/django/en/latest/py-modindex.html?highlight=django
or perhaps this http://djangoapi.quamquam.org/trunk/ ?
There is also a great book: http://www.djangobook.com/en/2.0/
--
You received this message because you are subscribed to the Google Groups
"Django us
First of all, I think your function is too big if it is doing all of these
things. Are you able to unit test the function?
In my view, the logic for extract should not be in the model. I would
create a class specifically for data extractions. I am assuming that the
_store does not DB saves to
It is much better to use Apache for static files than Django. You can still
run DJango for data validation, but all static content is typically served
via Apache. In your virtualhost, you should proxy the /static/ endpoint to
the /static/ folder in Django app.
On Sunday, April 29, 2012 5:39:15
I am a big fan of TastyPie. But I don't understand your following
requirement:
- *Get/set (conversion) between different schemas*
- I.e.: No matter the input API, you can get it formatted in
whichever output API you request
Are you simply trying to create a unified interface
6 matches
Mail list logo