Am 19.04.2007 um 17:56 Uhr schrieb Nicola Larosa:
> It looks like they are working mostly on the client side, but
> something
> tells me that the need for a server side will arise, sooner or
> later. It
> would be great exploring that side with Django.
Interesting discussion. I'm just about to implement a slightly
'semantish' serverside backend in django - it's the fourth
incarnation acutally: the first was done with python and the zope DB
(it just produced XML files that were eaten by a Flash interface),
the second was done with mod_python, Apache and MySQL, number three
Zope and postgreSQL.
I've been playing around with django for some weeks now, and I like
the approach a lot. I was surprised how quickly I could reimplement
the functionality of my architecture (it's called 'paragon') in
django, for you interest here's the models.
My aim is to combine the strictness of semantics with the flexibility
of a kind of 'digital scrapbook' (in Germany, we speak of a
'Zettelkasten' or 'sheetbox').
As you can see, I don't care about restrictions very much - classes
can be abstract or concrete, there's no concept of cardinality etc.
Inheritance is also only 'nominal' yet: As soon as an object has the
relation 'is_instance_of' or 'is_subclass_of', the business logic has
to know how to deal with that.
The main advantage is that I can model almost everything with this
approach: persons, topics, books, exhibitions, conferences,
scientific paradigms, person's affilitations etc.
The project began in the arts field as an 'open source webbased
ontology' for the arts and related fields like architecture,
psychology, physics, cognitive scienence.
If you'd like to look at the current implementation: http://
www.christoph-pingel.de/paragon/objectpage/George_Lakoff
Comments, proposals, criticism are welcome. I'm quite new to django,
so perhaps I'm missing some things to make the design even more sober
and easy to maintain.
best regards,
Christoph
Here's the models if you'd like to play with it:
----------------
from django.db import models
class pg_object(models.Model):
"""
Objects and Classes of Objects
"""
object_name = models.CharField(maxlength=300)
def __str__(self):
return self.object_name
class Admin:
pass
class pg_atm(models.Model):
"""
A thesaurus of possible attribute meanings.
A theasaurus means less ambiguity and better possibilities to
map e.g. BibTex entries in a controlled manner
"""
# atm_bedeutung = models.CharField(maxlength=200) -- it's probably
better to use a more generic approach vs. i18n.
atm_meaning = models.CharField(maxlength=200)
def __str__(self):
return self.atm_bedeutung
class Admin:
pass
class pg_rlt(models.Model):
"""
Possible relations between objects.
I'm not sure if it's possible (nor how) to implement a ForeignKey
into the same table
"""
rlt_relation = models.CharField(maxlength=200)
rlt_backrelation_id = models.IntegerField()
rlt_times_used = models.IntegerField()
def __str__(self):
return self.rlt_relation
class Admin:
pass
class pg_atp(models.Model):
"""
Here we store the actual poperties/slots, whatever you call it.
Each key/value pair exists only once. Objects register properties
via a link table (pg_oal below)
"""
atp_bedeutung = models.ForeignKey(pg_atm)
atp_value = models.TextField()
def __str__(self):
return "%s %s" % (self.atp_bedeutung, self.atp_value)
class Admin:
pass
class pg_oal(models.Model):
"""
The link table for objects to register properties
'oal' stands for object attribute link
"""
oal_object = models.ForeignKey(pg_object,
edit_inline=models.TABULAR, num_in_admin=3)
oal_attribute = models.ForeignKey(pg_atp, core=True)
def __str__(self):
return "%s %s" % (self.oal_object, self.oal_attribute)
class Admin:
pass
class pg_ool(models.Model):
"""
The link table for objects to relate to other objects (or classes).
'ool' stands for object object link
"""
ool_source = models.ForeignKey(pg_object, related_name="Quelle der
Relation")
ool_relation = models.ForeignKey(pg_rlt)
ool_target = models.ForeignKey(pg_object, related_name="Ziel der
Relation")
def __str__(self):
return "%s %s %s" % (self.ool_source, self.ool_relation,
self.ool_target)
class Admin:
pass
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---