Alternative model without Database

123 views
Skip to first unread message

Elyrwen

unread,
Nov 24, 2009, 4:28:13 AM11/24/09
to Django users
Hello,

I' ve been recently interested in Djagno framework and I am at the
point of choosing it as the framework for my project. My application
will not use database, but will use webservices to get data and then
process it.

I need a substitute for the Django model layer. Precisely I need a
class that would parse a wsdl (this I am doing with suds) and then
call the remote methods. There should be one instance of this class
served by all requests to
avoid parsing wsdl for evey request - sort of a singleton class that
would keep parsed stubs. It is possible to place such shared class in
Django? Can you point me to some solutions that avoid parsing wsdl
with each new request?

Maybe there is yet another way to obtain it with Django?

Best regards,
PS

Dirk Uys

unread,
Nov 24, 2009, 5:41:28 AM11/24/09
to django...@googlegroups.com
I'm also interested in something like this. My feeling was a bit different though. Sticking to django's way of doing things, I would rather create a web service model that defines all the messages and generate WSDL from that file (much like using manage.py syncdb). But I guess if you are using some other tool to generate the WSDL you may not wish to do it this way.

I know RoR has something called ActiveResource, but I don't know how closely it maps to ActiveRecord?

Regards
Dirk

Christophe Pettus

unread,
Nov 24, 2009, 12:17:39 PM11/24/09
to django...@googlegroups.com

On Nov 24, 2009, at 1:28 AM, Elyrwen wrote:

> My application
> will not use database, but will use webservices to get data and then
> process it.

It can be challenging to excise all of the uses of the database from a
Django application. Since you'll be caching the results of your web
services operations locally, perhaps cache them in a local database,
such as SQLite? You could, then, subclass Model in such a way as to
populate the cache on demand.

--
-- Christophe Pettus
x...@thebuild.com

Preston Holmes

unread,
Nov 24, 2009, 12:26:00 PM11/24/09
to Django users


On Nov 24, 1:28 am, Elyrwen <elyrwendyn...@gmail.com> wrote:
> Hello,
>
> I' ve been recently interested in Djagno framework and I am at the
> point of choosing it as the framework for my project. My application
> will not use database, but will use webservices to get data and then
> process it.
>
> I need a substitute for the Django model layer. Precisely I need a
> class that would parse a wsdl (this I am doing with suds) and then
> call the remote methods. There should be one instance of this class
> served by all requests to
> avoid parsing wsdl for evey request - sort of a singleton class that
> would keep parsed stubs. It is possible to place such shared class in
> Django? Can you point me to some solutions that avoid parsing wsdl
> with each new request?

Is there a reason your app can not use a database?

Depending on how often your wsdl data changes, you could map a
response to a django model object and then check to see if it exists
(essentially using the ORM as a wsdl cache). Or you could use
Django's cache framework itself:

http://docs.djangoproject.com/en/1.1/topics/cache/#the-low-level-cache-api

The former would let you have more class like access to the data (with
methods etc), while the latter is more pure key/value.

-Preston

bruno desthuilliers

unread,
Nov 24, 2009, 3:39:43 PM11/24/09
to Django users
Others already gave you good answers - like using the db/model layer
as a local cache, which, FWIW, it's probably how I would solve this
problem. I'd just like to add a more general comment: Django is a
Python framework, and your views can act on just any Python object. So
if and when you don't need the ORM part, don't use it !-)

ash

unread,
Nov 26, 2009, 2:06:57 AM11/26/09
to Django users
I don't know your problem in detail, but as alternative
I recommend read about twisted framework. If you work
with xmlrpc servers and you need in call remote methods,
then it help you. Simple exmaples:
http://twistedmatrix.com/documents/current/web/howto/xmlrpc.html
Reply all
Reply to author
Forward
0 new messages