Extend model
Drumm- opened this issue · comments
I may be being dumb, Is it possible to somehow extend the model to store additional data about the user without modifying the package? Or would the best way be to modify the package? Say if I wanted a link to a User or something?
You can make a model
with your custom extra fields and a OneToOne
relation to the gcm.Device
model.
E.g:
device = models.OneToOneField('gcm.Device', related_name='additional_data')
cheers
Yep. Implementing this alongside tastypie is hard. I've had to implement my own GCMResource in my api, which seems to be a waste of time, as your API is there already.
@Drumm- what do you want to achieve? Allow authorized user to register his devices via api?
Yep, but to store user data. I've ended up implementing another GCMResource, which I assume is unsafe.
I added new application to example project to show how to easily extend DeviceResource and add user authentication
Brilliant mate, thank you!