Re: management.py and post_syncdb

2007-11-26 Thread leotr

why would you need that?
why don't you simply use fixtures?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: complex query in limit_choices_to

2007-11-24 Thread leotr

On database level that should be done by UNIQUE constraints.
And your problem should be made on form level.
read about ChoiceField in newforms documentation
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Passing the max_length from the Model into the Form

2007-11-23 Thread leotr

Yes, not only it's dirty but it's ineffective as well!

Declare a constant somewhere and use it in both model and form.

max_link_url_len = 80

class Link(models.Model):
url = bla_bla_field(max_length = max_link_url_len)

class myForm(forms.Form):
   
url = forms.URLField( max_length=max_link_url_len)

:)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Imitating "edit_inline" in a view

2007-11-23 Thread leotr

Didn't you look at html code which was generated by admin?

you will need to generate a form which has such fieldnames:

car..

like










and then react on post method in view
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---