On 10/20/2014 12:26 PM, Carl Meyer wrote: > On 10/19/2014 12:54 AM, Marc Tamlyn wrote: >> I guess now with migrations we have a nice way of running the SQL >> against the database to create the stored procedures. >> >> However if we plan to make this a public API, it should be a nice one. >> Something along the lines of db.procedures.proc_name(*args, **kwargs) >> would be preferable I think. Obviously this requires more magic to make >> it work (or explicit registration of your procedures). > > I know this is hypothetical, but I don't think that is a particularly > nicer API, or that we should provide such syntactic sugar atop > callproc(). Providing the procedure name as a string is not really a > problem, and is preferable to doing `__getattr__` magic or requiring > registration of procedures; the syntactic sugar just doesn't provide > enough benefit to justify the magic, and all the various ways that that > magic could confuse users and cause maintenance issues.
(I should clarify: I do think there are ways that we could improve on the PEP 249 callproc() API if we were providing a higher-level Django-specific alternative. I just don't think that moving the procedure name from a string argument to a magical getattr-based Python function is a good idea.) Carl -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5445548D.3020407%40oddbird.net. For more options, visit https://groups.google.com/d/optout.
