Re: Django field model for HTML parser?

2017-11-17 Thread drone4four


I didn’t do a very good job explaining.  Let me try again.

If you take a look at this image of Blogger, the red arrow points to the 
formatting bar .  The formatting is a helpful 
feature in Blogger which allows blog posters to add an essay worth of 
content, and then alter the appearance of the Lorem Ipsum essay content 
with bold, italics, underline and a few dozen other buttons and options.

Then when you click the HTML button  in the 
Blogger dashboard, it shows you the same Lorem Ipsum content, but just the 
raw HTML source.

My Django admin panel when creating a new blog post just accepts plain 
text.  No HTML markup formatting.  Here is a pic of my Django dashboard with 
a red arrow pointing to where I am hoping to add an HTML formatting bar 
. Or does Django not have an HTML formatting 
menu feature helping blog contributors to format their content?  I can’t 
find it in the model field type / option doc that I linked to in my 
original post.

Thank you.

On Wednesday, November 15, 2017 at 10:41:31 PM UTC-5, Amitesh Sahay wrote:
>
> The HTML file in Django is parsed through views.py if that is what you are 
> looking for. For Italics  tag should work. For strong text, you may use 
>  tag. I hope that I have understood your question correctly.
>
> Hello,
>
> Regards,
> Amitesh Sahay
>
> primary :: *91-907 529 6235*
>
>
> On Thursday 16 November 2017, 6:51:03 AM IST, drone4four <
> drone...@gmail.com > wrote: 
>
>
> The contents of my models.py looks like this:
>
> from django.db import models
>
>
> # Create your models here.
> class Post(models.Model):
> title = models.CharField(max_length=256)
> pub_date = models.DateTimeField()
> image = models.ImageField(upload_to='media/')
> body = models.TextField()
>
>
> def __str__(self):
> return self.title
>
>
> def pub_date_pretty(self):
> return self.pub_date.strftime('%A %d %B %Y @ %-I:%M:%S %p')
>
>
> def summary(self):
> return self.body[:350]
>
> Lines 5 through 8 initiate the model class variables for my blog 
> dashboard. My dashboard looks like this . 
> There is a title, pub date, image and body. The Udemy instructor suggests 
> consulting the official Django doc for field types/options 
> . I’m not sure 
> I really understand most of it. There is just so much information there. My 
> question for all of you: Which field option or field type initiates an HTML 
> parser for body text? I mean, when I go to to create a new blog post, how 
> do I create rich text with HTML formatting buttons like bold, underline and 
> italics? It’s not really the buttons I care about. I just want my HTML tags 
> to parse. Take note of the HTML tags I’ve circled in red here 
> . How do I get the h5, hr and em to parse? Is 
> there a field option/type for this? I don’t see it in the models fields doc.
>
> Thanks for your attention.
>
> -- 
> 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...@googlegroups.com .
> To post to this group, send email to django...@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/d387add4-9859-4410-a882-cf98ee3a6278%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/b7d066e4-0cdf-46af-aa56-47a211611c67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: reg:not able to open registration form web page

2017-11-17 Thread Mike Dewhirst

Amitesh

I found this helpful ...

https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html

Cheers

Mike


On 17/11/2017 10:07 PM, 'Amitesh Sahay' via Django users wrote:

Hello James,

Thanks a lot for reply. There are couple of things that I would like 
to bring to the notice


1) I did go through that part of django document before posting the 
issue here.
2) In that doc, in the 2nd "if" condition, its talking about 
cleaned_data. In one of the public forum, I was asked to remove that 
part from my views.py, as I am not customizing my models.py. If I use 
cleaned_data. I entered the below in my earlier view.py


            #username = form.cleaned_data.get('username')
            #password = form.cleaned_data.get('password')
            #email = form.cleaned_data.get('email')
            #user.save()

Please let me know if that was right? Also, can you point me to the 
exact changes that you want me to make in my views.py. I am sorry that 
I am asking this, but over the last 2 week or so, I am so frustrated 
that I am not able to think much on this part.



Hello,

Regards,
Amitesh Sahay

primary :: *91-907 529 6235*



On Friday 17 November 2017, 12:04:25 PM IST, James Schneider 
 wrote:





On Nov 15, 2017 8:32 AM, "'Amitesh Sahay' via Django users" 
 
> wrote:


Hello Members,

I am new to Django, and trying to create a mock Django
registration page. I am using default Django "User" model to do
that, and I am not customizing anything. Its a very simple form
with 3 fields as follows:

'username','password','email'. Below are my python and html code
details:


Snip...

views.py


def SignUpFormView(request):
    user_form = 'SignUpForm'

    template_name = 'test.html'

    if request.method == 'POST':
        form = user_form(request.POST)
        if form.is_valid():
            form.save()
            #username = form.cleaned_data.get('usernam e')
            #password = form.cleaned_data.get('passwor d')
            #email = form.cleaned_data.get('email')
            #user.save()
            return render(request, template_name, {'form':form})


    else:
        SignUpForm()

    return render(request, 'user_info/about.html')


Snip...

My issue is, when trying to launch the "register" page, its not
going inside "if" condition in views.py, rather its going directly
to "else" condition.

I am tried many things under my reach, but couldn't resolve the
issue, and stuck for 2 weeks now.
Any help would be appreciated.


There are several issues with the view composition. Please refer to 
the docs here and verify your syntax matches the example:


https://docs.djangoproject.com/en/1.11/topics/forms/#the-view

Your template code also suggests that you are seeing duplicate form 
fields (or perhaps they are being rendered in the source but aren't 
visible). It's also possible that the Django form is not being created 
correctly in the first place, which is why you need to manually render 
the form fields, when the {{ form.as_p }} should be doing that for you.


If you are submitting the form and getting the behavior you describe, 
I'm guessing that the if statement isn't being skipped, but the values 
being submitted do not match the form object in Django, causing it to 
fail validation, meaning that the second if statement is coming back 
False.


-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 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/CA%2Be%2BciWNrWLhEzhM6649BsP5JByUXbsS7gvBVaKq2BkejKH7Rw%40mail.gmail.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 

Enable to display datas which are related

2017-11-17 Thread Daniel Roseman
Why have you posted pictures? Don't.

-- 
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/ee06706e-a2a3-4023-a359-17f02a0d4d3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Group with specific permission

2017-11-17 Thread Allan Nava
Hi,

I need to add a specific permission for users of group such as add new 
member, but only for the group users.

I have installed the django-permission 

-- 
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/12821a89-06e9-4518-8638-4911e40ed8dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Enable to display datas which are related

2017-11-17 Thread Uwe Aime Van
Hi as you can see on above pictures above i have relationship between 
AddProduct Model and SubCategory according to foreign key that i have made, 
i can not products which are related or belonged to specific subcategory, 
Can anyone help me on this please??

-- 
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/69d3b9ed-2f74-4f3e-b769-974bc81c395c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading from 1.9 to 1.11 Closed Network

2017-11-17 Thread Todd Gilliland
Great.  Thanks Jason.

On Friday, November 17, 2017 at 8:29:02 AM UTC-5, Jason wrote:
>
> You can do this with pip, check out 
> http://www.nyayapati.com/srao/2014/06/how-to-pip-install-python-packages-offline/
>
>>
>>

-- 
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/edc420e9-a960-474f-a6b6-a5d0eb2c9266%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading from 1.9 to 1.11 Closed Network

2017-11-17 Thread Jason
You can do this with pip, check out 
http://www.nyayapati.com/srao/2014/06/how-to-pip-install-python-packages-offline/

>
>

-- 
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/4491085d-a303-480d-ac85-fcdb6f892ddd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Speed up Loading the First Page of Django Project?

2017-11-17 Thread Jason
I would suggest you post the configuration file here as well as the server 
specifications and average CPU/memory usage.  Because what you're 
describing is definitely not normal and is most likely related to how 
Apache is configured.

A point of clarification: does the first page always load slowly, or is it 
just the first page after you restart the server?

-- 
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/b048d3d8-04b8-42cc-adbd-26ed6e61d938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to do query inner join in django rest framework

2017-11-17 Thread Jason
I would look at the django beginner tutorial first

https://docs.djangoproject.com/en/1.11/intro/tutorial01/

what you're asking for is covered in part 2

-- 
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/3ec3a085-a740-4c8c-9022-ec4e81b00b8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get as result a list of all the users ordered by birthday (month day), ignoring year

2017-11-17 Thread Roy Shillingburg
https://stackoverflow.com/questions/4236226/ordering-a-django-queryset-by-a-datetimes-month-day



On Friday, November 17, 2017 at 7:19:43 AM UTC-5, Roberta Takenaka Granero 
wrote:
>
> In models:
>
> birthday = models.DateField() 
>
> def birthday_month_day(self):
>   # returns month and day
>   return '12-31'  
>
>
> In views, I expect to see something pythonic like this:
>
> User.objects.all().order_by('birthday_month_day')
>
> I know it does not work because birthday_month_day is not a column in 
> database. 
>
> The question is how to get as result a list of all the users ordered by 
> birthday (month + day), ignoring year. (queryset order_by DateField month 
> day)
>
> Can you help me? Anyone has faced this question before?
>
> Thanks
>
>
>
> -- 
> Roberta Takenaka
>

-- 
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/97d66095-d7a5-42c9-ad99-673fac39dac5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Saving webp image near jpg version

2017-11-17 Thread Дмитрий Горобец
I want to save webp image near jpg version.

Now I'm doing it this way:
class ProductImage(models.Model):
product = models.ForeignKey(
to=Product,
related_name='images',
on_delete=models.CASCADE,
)

image = models.ImageField(
upload_to=upload_product_image,
default='',
blank=True,
max_length=255,
)

def save(self, **kwargs):
super().save(**kwargs)
self.create_webp_image()

def create_webp_image(self):
image = Image.open(self.image.path)
path = os.path.splitext(self.image.path)[0] + '.webp'
image.save(path, 'WEBP')

Is there more elegant way to do it?

Thank you.

-- 
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/7b4e1100-e147-4b8e-8ef7-db2b29caa747%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dynamically change model managers after initial queryset instanciation

2017-11-17 Thread Jason
Let's say I have a Poll object with two managers attached like so:

class Poll(models.Model):
   #fields here
   
   objects = PollManager()
   subjects = SubjectManager()

is it possible to dynamically change which manager is used to make which 
query after the initial call?  For example

results = Poll.objects.all()
results.filter(some_field=some_value) # execute filter on queryset using 
default Poll manager
results.changeManager(subjects) # change queryset's manager to different 
Poll manager
district_results = results.aggregate_district(district = some_district) # 
execute method in alternative Poll manager


There's nothing in the documentation to suggest this has been considered, 
nor in the codebase.

-- 
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/84ddd49e-60c9-411a-b877-2fa8bbdc34c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to do query inner join in django 1.11

2017-11-17 Thread Angel Omar Rojas Pacheco
Hello Cristiano, my relation ship data base is in this case one to many.
thanks

On Thursday, November 16, 2017 at 11:38:27 PM UTC-2, Cristiano Coelho wrote:
>
> .select_related or prefetch_related? Depends on if it's a 1-Many or 
> Many-Many relationship.
>
> El jueves, 16 de noviembre de 2017, 13:58:32 (UTC-3), Angel Omar Rojas 
> Pacheco escribió:
>>
>> hello peolpe
>>
>> I need your help please, I read documentation django rest 
>> framework/serialize, but isn't find my solution, I need this query in 
>> django:
>>
>> select * from auth_user as auser inner join profilecolonybit_profile as 
>> profileu on auser.id=profileu.user_id
>>
>> this show me all users and profiles related with similar id
>>
>> but de documentation not show me an example like my query
>>
>> please help me.
>>
>> thanks
>>
>> regards
>> Angel.
>>
>
>

-- 
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/52404297-de08-4931-9bfa-5973417c3509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Upgrading from 1.9 to 1.11 Closed Network

2017-11-17 Thread Todd Gilliland
I need to upgrade Django 1.9 to 1.11 on a closed network.  Is there a way 
to upgrade from a downloaded source file ?

I've successfully upgraded on our Cloud environment using "pip3.5 install 
-U Django"  but can't use this command on a closed network since pip is 
looking to go out

Thanks.
Todd

-- 
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/dabcfc00-2907-46fe-8fc2-b64827de0c56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to get as result a list of all the users ordered by birthday (month day), ignoring year

2017-11-17 Thread Roberta Takenaka Granero
In models:

birthday = models.DateField()

def birthday_month_day(self):
  # returns month and day
  return '12-31'


In views, I expect to see something pythonic like this:

User.objects.all().order_by('birthday_month_day')

I know it does not work because birthday_month_day is not a column in
database.

The question is how to get as result a list of all the users ordered by
birthday (month + day), ignoring year. (queryset order_by DateField month
day)

Can you help me? Anyone has faced this question before?

Thanks



-- 
Roberta Takenaka

-- 
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/CAJ9dYMF91gZBhmUvJp4hOAMti8SUy%3DGEQd7gQLozC6VW%3DAhjvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: reg:not able to open registration form web page

2017-11-17 Thread 'Amitesh Sahay' via Django users
Hello James, 
Thanks a lot for reply. There are couple of things that I would like to bring 
to the notice
1) I did go through that part of django document before posting the issue 
here.2) In that doc, in the 2nd "if" condition, its talking about cleaned_data. 
In one of the public forum, I was asked to remove that part from my views.py, 
as I am not customizing my models.py. If I use cleaned_data. I entered the 
below in my earlier view.py
            #username = form.cleaned_data.get('username')            #password 
= form.cleaned_data.get('password')            #email = 
form.cleaned_data.get('email')            #user.save()
Please let me know if that was right? Also, can you point me to the exact 
changes that you want me to make in my views.py. I am sorry that I am asking 
this, but over the last 2 week or so, I am so frustrated that I am not able to 
think much on this part. 



Hello,
Regards,Amitesh Sahay


primary :: 91-907 529 6235
 

On Friday 17 November 2017, 12:04:25 PM IST, James Schneider 
 wrote:  
 
 

On Nov 15, 2017 8:32 AM, "'Amitesh Sahay' via Django users" 
 wrote:

Hello Members, 
I am new to Django, and trying to create a mock Django registration page. I am 
using default Django "User" model to do that, and I am not customizing 
anything. Its a very simple form with 3 fields as follows:
'username','password','email'. Below are my python and html code details:

Snip...

views.py
def SignUpFormView(request):    user_form = 'SignUpForm'

    template_name = 'test.html'
    if request.method == 'POST':        form = user_form(request.POST)        
if form.is_valid():            form.save()            #username = 
form.cleaned_data.get('usernam e')            #password = 
form.cleaned_data.get('passwor d')            #email = 
form.cleaned_data.get('email')            #user.save()            return 
render(request, template_name, {'form':form})

    else:        SignUpForm()
    return render(request, 'user_info/about.html') 

Snip...

My issue is, when trying to launch the "register" page, its not going inside 
"if" condition in views.py, rather its going directly to "else" condition. 
I am tried many things under my reach, but couldn't resolve the issue, and 
stuck for 2 weeks now. Any help would be appreciated.

There are several issues with the view composition. Please refer to the docs 
here and verify your syntax matches the example:
https://docs.djangoproject.com/en/1.11/topics/forms/#the-view

Your template code also suggests that you are seeing duplicate form fields (or 
perhaps they are being rendered in the source but aren't visible). It's also 
possible that the Django form is not being created correctly in the first 
place, which is why you need to manually render the form fields, when the {{ 
form.as_p }} should be doing that for you.
If you are submitting the form and getting the behavior you describe, I'm 
guessing that the if statement isn't being skipped, but the values being 
submitted do not match the form object in Django, causing it to fail 
validation, meaning that the second if statement is coming back False.
-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 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/CA%2Be%2BciWNrWLhEzhM6649BsP5JByUXbsS7gvBVaKq2BkejKH7Rw%40mail.gmail.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/1670974142.510163.1510916854178%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


ManytoMany Relation and Custom widget in Django

2017-11-17 Thread Paul
I have two models Category and Products.

- a Product can have multiple Categories 
- a Category can have multiple Products.
- Categories have a circular Foreign key, to itself.
- not all Categories have the same depth level

Example:

Category A
- Category A_1
- category A_2
- Category A_2_1
Category B
Category C
- Category C_1


class Product:
categories = models.ManyToManyField(Category)
name = models.CharField(max_length=255)

class Category:
categories = models.ForeignKey(self)
name = models.CharField(max_length=255)

As Form I use a ModelForm:

class ProductForm(ModelForm):



class Meta:
model = Product
fields = ['categories', 'name', 'short_description', 
'description']
widgets = {
'categories': MyWidget,
}

**What I want to achieve:**

I want to implement a conditional select (narow options):

1. Only top parent Categories(level 0 A,B,C) are available
2. The user select a parent Category.  If the parent has children a new 
Select box appear with his children(category level 1 A1,C1) 
3. The user select a level 1 Category (A1,C1). If the parent has children a 
new Select box appear with his children(level 2 A2)

- The process is repeated until no children are availavable(recursive), an 
user select the "smallest" category in the tree
- A new button is available for the user to add more categories and start 
the 1-3 process again
- I want to do the select,add new select using JavaScript
- On Form Submit I want to send only the last children categories


Options I thought:

1. Change the ManyToMany coresponding default Fields - looks like there are 
no good hooks and/or inheritance
2. Use a non-default custom Field instean of ManytoMany(like Charfield) - 
more complex on clean,saving Form
3. Change/Inherit the widget. My issues is how to send the data to the 
default Field on submit, and get/show it on edit 
 
I need some help as code and indication how to do this.


-- 
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/dc81ac05-b0b7-4653-9779-70998dc86370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.