I am trying to integrate durable_rules with my django restframework apis
I need some guidance as to how to proceed with this
Lets say, I have a class school , class student, class location
class School(models.Model):
schoolname = models.CharField(max_length=200)
class Location(models.Model):
locationname = models.CharField(max_length=200)
class Student(models.Model):
school = models.ForeignKey(School)
location = models.ForeignKey(Location)
studentname = models.CharField(max_length=200)
fees = models.IntegerField()
Now, I want to make rules saying
if (schoolname = 'ABC' and location = 'xyz') then update fees = 1000
if (schoolname = 'SDS' and location = 'sdfs') then update fees = 200
How do I do this with durable_rules? My question if more on where do I write the code for it, in views or serializers.
Any sample code would be of great help
Thanks
Now based on the school