Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Rakhee Menon
Customization in the sense..I have lot of calculations to do so its not possible using viewset. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread James Schneider
On Sep 5, 2017 11:21 PM, "Rakhee Menon" wrote: Customization in the sense..I have lot of calculations to do so its not possible using viewset. Ah, that isn't reflected in the example code you provided. Fair enough. Custom logic like calculations can be integrated in

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread James Schneider
> > > Custom logic like calculations can be integrated in to any view or > viewset. Often times the logic is broken out in to separate standalone > functions and called by some simple overrides on the view[set]. > I forgot to mention, you may want to integrate that business logic directly in to

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Rakhee Menon
Thanks a lot James :-) > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Xavier Ordoquy
> Le 6 sept. 2017 à 10:00, Melvyn Sopacua a écrit : > > One of the core design issues with DRF is that everything > is based around a queryset. Even if the set is just one item. This sounds like an easy troll. A lot of code from DRF is based around queryset because DRF

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Melvyn Sopacua
One of the core design issues with DRF is that everything is based around a queryset. Even if the set is just one item. Django makes a clear distinction throughout, from model to view and doesn't combine list and detail views based on the absence or presence of an identifier. On Wed, Sep 6,

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Rakhee Menon
Thanks a lot people...I haven't tried writing logics in models.As you have suggested I would like to learn writing business logic in models.So can u provide with any links showing such examples?? > > -- You received this message because you are subscribed to the Google Groups "Django users"

Re: putting an dynamically created image to response

2017-09-06 Thread Jani Tiainen
Hi, You probably want to have actually a view that returns the map image as a response. And that's documented, using PDF though but for image same principle applies. https://docs.djangoproject.com/en/1.11/howto/outputting-pdf/ On 6.9.2017 11.55, Ahmet Temiz wrote: Hi, I created an image (

putting an dynamically created image to response

2017-09-06 Thread Ahmet Temiz
Hi, I created an image ( a map) dynamically. But, I am confused to put it into HttpResponse without saving to disk. What do I have to do? regards -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: how to write APIview to access a specific item by using APIViews only

2017-09-06 Thread Melvyn Sopacua
On Wed, Sep 6, 2017 at 10:19 AM, Xavier Ordoquy wrote: > >> Le 6 sept. 2017 à 10:00, Melvyn Sopacua a écrit : >> >> One of the core design issues with DRF is that everything >> is based around a queryset. Even if the set is just one item. > > This

Re: Link to download a file

2017-09-06 Thread giuseppe ricci
Thank you James for your reply.. So in my urls.py I insert a new entry: url(r'^download/$', 'views.download') and my view to download a file is: def download(request): file_path = 'static/tmp/' #settings.MEDIA_ROOT return render_to_response('download.html', file_path+'dati.csv') and the

setup.py for Django project?

2017-09-06 Thread Scot Hacker
I am accustomed to seeing pip-installable dependencies of a Django project each have their own `setup.py`. I am not accustomed to seeing a Django project *itself* have its own `setup.py`, but I am now working with a project that does just that. The setup does not move the Django project itself

how to use admin view as part of app

2017-09-06 Thread 1351552...@qq.com
hello I want use a admin edit view in my app,when edit done ,it will back to admin list view, how can it back to my app.listview. wblueboat -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Displaying a photo from a database

2017-09-06 Thread ron_w_add via Django users
Hello James Your suggestion worked. Thank you very much for your help. Ron On Tuesday, September 5, 2017 at 10:04:04 PM UTC+1, James Schneider wrote: > > However, when I try to add the photo to the page I’m getting stuck. If I >> try adding ‘> >> >> {% block content %} >> >> < Back >>

Re: Link to download a file

2017-09-06 Thread James Schneider
On Wed, Sep 6, 2017 at 6:03 AM, giuseppe ricci wrote: > Thank you James for your reply.. > So in my urls.py I insert a new entry: > > url(r'^download/$', 'views.download') > > and my view to download a file is: > > def download(request): > file_path = 'static/tmp/'