Closed alok25 closed 11 years ago
No, they are not supported. There first have to be support in TastyPie for it.
but i saw file field in tastypie(https://django-tastypie.readthedocs.org/en/latest/fields.html?highlight=fields#filefield)
What would you like to use the file field for? File upload?
I would like to upload an image (in future, video file may be) file into mongodb. I'm able to send all other type of fields(List, Embedded, Reference, List of Emb/Ref/ etc). This plugin has been a lifesaver for me till now.
So, please make an example in TastyPie itself how to upload a file and then we can discuss how to store that into MongoDB.
I think I'm a bit confused here. You want an example in tastypie file upload ? or django file upload? Tastypie file upload is essentially my requirement.
As I said, django-tastypie-mongoengine just extends TastyPie with MongoDB backend. Show me that TastyPie can support file uploads with some other backend and then we can add support for file uploads to MongoDB backend. I am arguing that TastyPie does not support file upload so we cannot do much here yet. And you are saying it does support file uploads. So please show me.
this is an example of tastypie code for filefield how can I do it in mongo backend? http://django-tastypie.readthedocs.org/en/latest/fields.html#filefield
class ExcelResource(MultipartResource, ModelResource):
file_field = fields.FileField(attribute="file_field")
class Meta:
queryset = Excel.objects.all()
resource_name = 'excel'
authorization = DjangoAuthorization()
authentication = MultiAuthentication(BasicAuthentication(), SessionAuthentication())
always_return_data = True
list_allowed_methods = ['post']
I can see reference field, embedded document field, listfield of embedded document field, etc. but didn't see FileField. Is it supported?