I'm new to Django and fairly new to Python. I'm developing an add-in
for using for using models as nested set trees*
At the moment it's a mixin class which provides methods such as
parent(), descendants(), depth() etc. for examining the tree, and
move_to() for relocating a node within the tree.
You can also run several trees in parallel in one table by specifying
the names of the fields which identify the members of each tree.
For example:
class SimpleTreeNode(models.Model, NestedSet):
lft = models.IntegerField()
rgt = models.IntegerField()
owner = models.IntegerField()
family = models.IntegerField()
identifying_columns = (family,owner)
SimpleTreeNodes can now be used as a tree structure.
Firstly, is a mixin a good way to do this?
Secondly, I'm having a nightmare trying to set up testing for this
class outside of a DJango installation. Basically, I'm importing
django.core.management and a SimpleTree class like the one above, plus
I have a dummy settings file with database settings in it.
But management.syncdb() doesn't create any tables, which is because it
doesn't have any INSTALLED_APPS. But I don't have any django apps,
just a handful of testing classes.
Advice?
And yes, I will be releasing it as soon as I can test it properly :)
*: See http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---