Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach XML/Object Utils to Models #79

Open
damonkelley opened this issue Jan 27, 2016 · 0 comments
Open

Attach XML/Object Utils to Models #79

damonkelley opened this issue Jan 27, 2016 · 0 comments

Comments

@damonkelley
Copy link
Contributor

There are a number of utilities or "presentation" functions, that would be much more at home attached to a model.

For example, coda_replication.presentation.xmlToQueueEntry would be more appropriate as a converter constructor on the QueueEntry model...

class QueueEntry(models.Model):
# ...
    @classmethod
    def from_xml(self, xml):
         # xmlToQueueEntry body here.

Of course, not all of the functions will work like this. An xml -> object function that just updates an object might be more appropriately attached as an instance method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant