Why not use zone.interface
On Wednesday, January 4, 2012 at 7:07 AM, huseyin yilmaz wrote:
Hi everybody,I want to implement interface functionality in python. I wrotefollowing sample codeHere I use an abc as an interface.Couple of my models are implementing this interface and one of myconsumer model is using those models. In this implementation, I use myabstract class to check if my models are implementing enoughfunctionality to make consumer model methods work (use_object method).Since I used abc's here, I get an error as soon as I try toinstantiate a model object. (I do not need to invoke use_object methodfor validation to work.)Question 1) Is there a better way to implement this validationfunctionality.Question 2) In this implementation, Validation happens at objectinstantiation time. Which means If I don't instantiate any object Iwon't get any error, Is there a ( short ) way of getting this check oncode initialization? ( I am not dynamicly changing methods of mymodels)--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+unsubscribe@googlegroups.com.For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 comments:
Post a Comment