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

OO Style #20

Closed
daffodil opened this issue Feb 3, 2013 · 1 comment
Closed

OO Style #20

daffodil opened this issue Feb 3, 2013 · 1 comment

Comments

@daffodil
Copy link
Contributor

daffodil commented Feb 3, 2013

I;ve just pushed a little patch to a branch which I'm using..

The idea is that it casts what returned into an Object then little helper makes it into a dict, custom fields etc.

https://rtkit.readthedocs.org/en/latest/resource.html
https:/daffodil/python-rtkit/blob/pedro/rtkit/resource.py

I'm pretty new to RT Rest API, but one thing I dont want to have to do is learn the syntax of fields all over the places..

For exampel I Just want to create a new Ticket
add a few values and just send it..

It looks like the entities is the way to do this, but for my purposed I would love..

tick = Ticket()
tick.Subject = "foo"
tick.Text = "bar"
tick.Queue = "HelpDesk"
tick.DateRequired = datetime.datetime.now()
tick.set_custom("X-ref", myId)
# conn
trackerObject = Tracker("server", USER, PASS, CookieAuthenticator)
success = tracker.new_ticket(tick)

Also I'm using dict's all over the place, from/to json etc.

The only snag I have with the entities is that they are not the same Case. eg self.Subject vs self.subject// and not sure that is a good idea..
And There is no simple way to simple create a "blank" Ticket or Comment" object ready to populate with data

any some thoughts
Pedro

@z4r
Copy link
Owner

z4r commented Feb 3, 2013

OO is working in progress in tracker and entities.
Like I explain in #15 i don't want a "middle" level API.

@z4r z4r closed this as completed Feb 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant