Let's say I have:

Calculator #1:
Expression: (True AND False) AND (True OR False)

This expression should be a child of some calculator. 

class Calculator(models.Model):
name = ...

class Expression(models.Model):
parent = models.ForeignKey(Calculator)

boolean = AND or OR

sub_exp1 = models.ForeignKey(Expression)
sub_exp2 = models.ForeignKey(Expression)


When I query all the expressions for the Calculator #1, I should get all 
the subexpressions.

1 AND 2 5
2 AND 3 4
3 leaf node of True 
4 lead node of False
5 OR 6 7
6 leaf node of True
7 leaf node of False

>From this, I can quickly apply my parse tree.

How would I display the base case/leaf nodes in my model? Also, is there a 
better way?

Thanks, I would really appreciate any help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/551f122e-3821-4395-b8b4-cf77d7e34c5f%40googlegroups.com.

Reply via email to