How to give select images option in django model forms ?

2021-03-14 Thread Kumar Gaurav
Hii Everyone,

I have a Model Form, one field is to upload image. Right now , user can 
select images from their system and upload but I want to give a  certain 
number of images as a dropdown option (showing the images in preview) to 
select from.

How can I implement this ?? and the best solution to implement this ??

Can anyone help ..

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3da6d701-2dfe-460f-ba8c-672cd11a944cn%40googlegroups.com.


Re: Django Model Forms.

2019-05-17 Thread Alex Kimeu
Thanks. Makes sense. Let me try it. Thanks.

On Fri, 17 May 2019, 14:18 Joe Reitman,  wrote:

> In your template you can identify each field by its name and use a table
> to render them in columns. e.g.
>
> table
>   table row
> table data {{ form.username }}
> table data {{ form.password }}
>
> On Friday, May 17, 2019 at 2:23:14 AM UTC-5, kimeualexis wrote:
>>
>> Hello, guys.
>> Is there a way to lay out Django Model form fields across the Browser
>> rather than top-down?
>>
>> Kindly assist.
>>
> --
> 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 django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/91849286-5271-48be-ae7d-b90c5ab59ea5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACYP3VEqNWAukvQSf1DJOZ784oODbTxGxn0dZ71yOP6DNKzoPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Model Forms.

2019-05-17 Thread Joe Reitman
In your template you can identify each field by its name and use a table to 
render them in columns. e.g.

table
  table row
table data {{ form.username }}
table data {{ form.password }}

On Friday, May 17, 2019 at 2:23:14 AM UTC-5, kimeualexis wrote:
>
> Hello, guys.
> Is there a way to lay out Django Model form fields across the Browser 
> rather than top-down?
>
> Kindly assist.
>

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/91849286-5271-48be-ae7d-b90c5ab59ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Model Forms.

2019-05-17 Thread kimeualexis
Hello, guys.
Is there a way to lay out Django Model form fields across the Browser 
rather than top-down?

Kindly assist.

-- 
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 django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a15b2496-49a6-4ee3-ae44-487ea175bd5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django model forms validation and error display

2011-11-01 Thread Kurtis Mullins
I recommend using Class Based Views if you're running Django 1.3. I tried
to go over your app and re-create a prototype using CBVs. I didn't spend a
lot of time on the actual logic or field types. I also didn't even try
running this. You'll need to fill in a couple of blanks but hopefully you
get the idea. I hope it helps :)

http://dpaste.com/hold/645547/

On Tue, Nov 1, 2011 at 11:39 AM, luke lukes  wrote:

> i have this template: http://dpaste.com/645468/ that send data to this
> view: http://dpaste.com/645469/. the template display a form made by
> modelforms, with a custom layout. i have to validate the fields value
> send to view, and then redirect to the same template if the field
> validation fails. i've tried to do it by creating an instance of the
> related model, then gathering all fields one by one (checking before
> if they are present in request.POST) and assigning it to the model
> field, and then assigning that model instance to a new modelform
> instance. then i've prefromed a .is_valid() check, but it fails since
> it require the model instance pc, so that model instance need to exist
> on db. so how can i validate those data, and if validation fails,
> redirect to another template and display the errors?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django model forms validation and error display

2011-11-01 Thread luke lukes
i have this template: http://dpaste.com/645468/ that send data to this
view: http://dpaste.com/645469/. the template display a form made by
modelforms, with a custom layout. i have to validate the fields value
send to view, and then redirect to the same template if the field
validation fails. i've tried to do it by creating an instance of the
related model, then gathering all fields one by one (checking before
if they are present in request.POST) and assigning it to the model
field, and then assigning that model instance to a new modelform
instance. then i've prefromed a .is_valid() check, but it fails since
it require the model instance pc, so that model instance need to exist
on db. so how can i validate those data, and if validation fails,
redirect to another template and display the errors?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



pyjamas django model/forms integration

2009-03-09 Thread lkcl

i note that there is interest in GWT Django Models / Forms
integration, which is something presently being experimented on in
pyjamas by some of the users.

following on from this:
http://groups.google.com/group/django-users/browse_thread/thread/87035bc2fa95930d/a25d10638ed6f809?lnk=gst&q=pyjamas#a25d10638ed6f809

line 99 demonstrates the principle of adding extra "commands" to the
process() function:
http://pyjamas.svn.sourceforge.net/viewvc/pyjamas/trunk/pyjs/jsonrpc/django/jsonrpc.py?revision=332&view=markup

the FormProcessor class can basically be handed a Django ModelForm
class, and, over JSONRPC, applications can then work with that Forms
class to validate data, save it, etc. etc. all using AJAX / JSONRPC
rather than a tiresome HTML "form".

if anyone would like to help extend the functionality to include save,
obtaining a list of fields, obtaining default radio-button and drop-
down list values (all dynamically) please do contact the pyjamas-dev
google group and make yourself known, as a way to coordinate efforts.

l.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---