On Tue, 2009-01-27 at 17:13 -0500, Matthias Julius wrote:
> I am trying to write a model for which the data can be represented as
> a simple array of a fixed number of one byte integers.  To use a
> SQL database for that would be very much overkill.  I would simply use
> a file where I can seek to the index position and read or write that
> byte.
> 
> While this in itself is not that hard to do I am wondering about how
> to implement a model that integrates well into django (provides all
> methods and attributes that are expected by other parts of django) but
> does not use the database as backend but some other data source
> instead.
> 
> Somehow I did not find a complete interface documentation for
> models.Model and about the internal workings of django.  I didn't go
> to the last resort (Read the Source!), yet.

The source is the interface documentation. Python is sufficiently close
to English that duplicating it is usually a great way not to add much
value. What there isn't at the moment, however, is any overview document
on what pieces do what.

However, I can short-circuit things a little bit: this is going to be a
little fiddly to make it work transparently. You are either going to
have to go down the route that Google App Engine does and provide
replacements for the existing model fields you want to use, or write
your own QuerySet replacement that knows how to talk to something like
the Query class and doesn't talk to the database.

The talk I gave at DjangoCon last year (the one about the ORM) has a
quick guide to some of that that might provide some clues. The videos
are on YouTube.

In the future (Django 1.2, maybe?) I want to make it possible to replace
the SQL storage portion with "something else". But that's a fairly
intrusive change and not trivial to do.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to