Re: Initializing DateTimeField in django forms.

2018-02-20 Thread Ryan Nowakowski
You could make the date field "disabled": https://docs.djangoproject.com/en/2.0/ref/forms/fields/#disabled On Mon, Feb 19, 2018 at 08:37:40AM -0800, prince gosavi wrote: > That did the job.But I would like to get rid of the 'Field' type view that > surrounds the date. As I only want to display

Re: returning a zip file for download

2018-02-20 Thread Iago Otero
and with puttin in de .would it work???.because if you have a def on views.py with http response for the downloadand the correct url.py..should work El miércoles, 1 de agosto de 2012, 0:03:21 (UTC+2), Tomas Neme escribió: > > > Down here's the code in which I'm creating

Re: What validation tests are applied to ImageField?

2018-02-20 Thread mtnhiker
Brilliant! Thanks (John) for following through. I had the same questions with the same responses you had to your answers. And I also don't have a form that starts the view. I have an image type that is not common (but is a standard), so hoped that the documentation comment "validates that

'base64' is not a text encoding; use codecs.decode() to handle arbitrary codecs

2018-02-20 Thread anurag kumar
Its showing error LookupError: 'base64' is not a text encoding; use codecs.decode() to handle arbitrary codecs. Last few lines when the execution stops are - thumbnail = resize(photo_data, 200, 200) File "/home/anurag/photoshare/app.py", line 406, in resize image_string =

Re: returning a zip file for download

2018-02-20 Thread Ryan Nowakowski
To set the download filename, you'll need to set the response Content-Disposition header[1] in your view: response['Content-Disposition'] = 'attachment; filename="somefilename.zip"' [1] https://docs.djangoproject.com/en/2.0/howto/outputting-pdf/#write-your-view On Tue, Feb 20, 2018 at

Re: When to use get_user_model()

2018-02-20 Thread Scot Hacker
It's good future-proofing, in case you ever change the User model in your project. In real life, that's highly unlikely, but where it's *really important* to use get_user_model() is when you are writing reusable apps for distribution. If your app is intended to be dropped into any existing

Re: How do I get dynamic choices to a select widget at render time?

2018-02-20 Thread Mike Dewhirst
On 20/02/2018 11:16 AM, Mike Dewhirst wrote: Here is an example of get_choices() output ... it comes from a method on the Question model.  [('A', 'A - Once?'), ('B', 'B - Twice?'), ('C', 'C - Four times?'), ('D', 'D - Twelve times?'), ('E', 'E - Continously as changes are made?')] It is

Re: how can i allow visitors to make an account and post pictures in my django website. something like this

2018-02-20 Thread Andy
Have a look at the official tutorial, give you users acces to the admin and have a look at the fielfield which once you created an admin for your model containing this field will allow anyone to upload files to your project. Am Dienstag, 20. Februar 2018 13:21:10 UTC+1 schrieb miraj: > > how to

DjangoUnleashed-2.0

2018-02-20 Thread Midhat Šibonjić
Django 2.0 released before 2,5 months. We have some problems with code in Django Unleashed book. It's for Django 1.8, when someone want to write with Django 2.0 there are many problems with url section. Is there someone who would like to review the book and update code? Thanks. -- You

how can i allow visitors to make an account and post pictures in my django website. something like this

2018-02-20 Thread miraj
how to give members of my website to be able to upload photos and videos -- 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 do I get dynamic choices to a select widget at render time?

2018-02-20 Thread Andy
use django-select2 Am Dienstag, 20. Februar 2018 01:17:26 UTC+1 schrieb Mike Dewhirst: > > Here is an example of get_choices() output ... it comes from a method on > the Question model. > > [('A', 'A - Once?'), ('B', 'B - Twice?'), ('C', 'C - Four times?'), > ('D', 'D - Twelve times?'),

Re: DjangoUnleashed-2.0

2018-02-20 Thread Andy
How many problems are there and how big is this section? There is quite a gap from 1.8 to 2.0 mainly the new locations of url functions which are nagging you. How can i help? Am Dienstag, 20. Februar 2018 13:21:10 UTC+1 schrieb Midhat Šibonjić: > > Django 2.0 released before 2,5 months. We