Overriding a ForeignKey field in a form looses it's "Add new" plus sign

2008-09-25 Thread D3f0

I've written a class which has two foreign keys which are displayed as
tabular forms. The form gets too long, so, I tried to override those
fk fields, but I lost the classic "Add New" plus signs that sits just
at the left of FK selects.
Any clue how can I get them back, using my custom field?

Thanks
Nahuel
--~--~-~--~~~---~--~~
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: Localized admin and date field formats

2010-06-14 Thread D3f0
Hi
There's been a slighty change in 1.2, take a look at:
http://docs.djangoproject.com/en/dev/ref/settings/#date-input-formats

Nahuel

On 13 jun, 09:00, Jeliuc Alexandr  wrote:
> Hello.
> I'm using django1.2.1 with i18n and l10n enabled...
>
> standart django admin date format is mm-dd-
> when it changes to Spain it becomes dd/mm/
> Not problem it is possible to choice date and save it...
> But if I want to edit row it becomes like standart mm-dd-...
> No problem... but if I edit row and want to save. I got error - wrong
> date format...
>
> Question is: How can I change date field format in admin edit form
> action? to be like it should be dd/mm/?
> Is it bug?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



form_for_model admin like add on ForeignKey

2007-08-23 Thread D3f0

Hi!
Sorry if my question is nonsense, I'm not experienced with Django,
this is my first real app.

I'm trying to reproduce the admin interfase in a form that I build
with form_for_model(), well, not *all* the admin interfase, but the
editing part, in particular, the widgets that it shows with ForeignKey
fields.

The model is like this (I've removed some fields, to make it shorter):

class Owner(models.Model):
first_name = models.CharField(maxlength = 40)
last_name = models.CharField(maxlength = 50)

class House(models.Model):
address = models.CharField(maxlength = 60)

class Rental(models.Model):
date = models.DateField()
owner = models.ForeignKey(Owner)
house = models.ForeignKey(House)

Later in the view, I get the form for the Rental class ( using
newforms.form_for_model ), but it shows -only- a select box and I also
need the plus sign, like in admin interfase, is there any way to get
something like that with django.

Thanks!
D3f0


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---