On Wed, Apr 20, 2011 at 11:06 AM, Daniel Gagnon wrote:
> The first one uses a jquery plugin that's discontinued and the second one
> works only in the admin.
>
>
There is also:
https://bitbucket.org/mlavin/django-selectable
Karen
--
http://tracey.org/kmt/
--
You received this message because
On Apr 20, 5:06 pm, Daniel Gagnon wrote:
"The first one uses a jquery plugin that's discontinued and the second
one
works only in the admin."
But that first project is live; did you contact the author and ask him/
her about plans to update it (especially as the jquery plugin in
question has a cl
>
>
> It probably is related to the this being a foreign key field and in
> order for it to produce a valid object instance from the Target model,
> it needs a queryset. Try to subclass from ModelChoiceField[1] and see
> if that works.
>
> [1]
> http://code.djangoproject.com/browser/django/trunk/dj
New code:
from django.forms.widgets import Select
from django.forms.models import ModelChoiceField
from Server_Automation.target_mgmt.models import Target
class AutoCompleteWidget(Select):
def render(self, name, value, attrs=None, choices=()):
logger.debug(value) # Logs 1 (the i
On Wed, Apr 20, 2011 at 12:45 PM, Daniel Gagnon wrote:
> Sure, here's a minimal version of them (I skipped fields that aren't too
> relevant to the problem at hand because there's many, including tons of
> foreign keys):
> class Target(Model):
> name = CharField("Target Name", max_length=255,
Sure, here's a minimal version of them (I skipped fields that aren't too
relevant to the problem at hand because there's many, including tons of
foreign keys):
class Target(Model):
name = CharField("Target Name", max_length=255, unique=True)
created = DateTimeField(auto_now_add=True, edita
On Wed, Apr 20, 2011 at 12:30 PM, Daniel Gagnon wrote:
> Thanks
> It still doesn't work though. I found out through logging that value that is
> receive is an int (the id) instead of being the object itself. How can I
> make my widget pass the object itself to the widget instead of passing
> objec
Thanks
It still doesn't work though. I found out through logging that value that is
receive is an int (the id) instead of being the object itself. How can I
make my widget pass the object itself to the widget instead of passing
object.id ?
On Wed, Apr 20, 2011 at 12:17 PM, DrBloodmoney wrote:
>
On Wed, Apr 20, 2011 at 11:48 AM, Daniel Gagnon wrote:
> So far, I have the following code:
> from django.forms.widgets import TextInput
> from django.forms.fields import Field
> class AutoCompleteWidget(TextInput):
> def render(self, name, value, attrs=None):
> if hasattr(value, 'name
So far, I have the following code:
from django.forms.widgets import TextInput
from django.forms.fields import Field
class AutoCompleteWidget(TextInput):
def render(self, name, value, attrs=None):
if hasattr(value, 'name'):
v = value.name
else:
v = Non
On Wednesday, April 20, 2011 4:20:04 PM UTC+1, Dan wrote:
>
> I'm trying to create a Form Field, not a Model Field.
>
> The doc about creating a custom one is a tiny paragraph at the end of this
> page: http://docs.djangoproject.com/en/1.3/ref/forms/fields/
>
> I read the source code of django but
I'm trying to create a Form Field, not a Model Field.
The doc about creating a custom one is a tiny paragraph at the end of this
page: http://docs.djangoproject.com/en/1.3/ref/forms/fields/
I read the source code of django but I'm having trouble even finding where
exactly is the value stored in t
http://docs.djangoproject.com/en/1.3/howto/custom-model-fields/
What specific problems/errors are you experiencing?
--
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 unsubscri
The first one uses a jquery plugin that's discontinued and the second one
works only in the admin.
Also, I feel I'm missing something that's not so complex...
On Wed, Apr 20, 2011 at 10:48 AM, Shawn Milochik wrote:
> Maybe just save your time and re-use some tasty open-source.
>
> Examples:
>
>
Maybe just save your time and re-use some tasty open-source.
Examples:
http://code.google.com/p/django-ajax-selects/
http://code.google.com/p/django-autocomplete/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Thanks for that, using:
from django.core import validators
.
.
class ExistingUserField(forms.CharField):
def clean(self, value):
if value in validators.EMPTY_VALUES:
return value
did the trick.
Paddy
On Jul 17, 3:31 am, Nuno Maltez wrote:
> Hi,
>
> Looking at Django's f
Hi,
Looking at Django's forms/fiedls.py may give you some ideas.
The test for an empty value is
if value in validators.EMPTY_VALUES
You can also use self.required to see if the required attribute is set
(e.g., see Field's validate() method).
Of course, a username with a single space will still
ok, for my problem that don't works because when i set required=False
the field isn't evaluated when it is in blank. I want an evaluation
for my function in every situation. With required=True and a custom
error message an evaluation can be simulated but if i do a code inside
the function in that c
http://docs.djangoproject.com/en/1.2/ref/forms/fields/#required
usu = forms.CharField(required=False, ...)
On Jul 15, 2010, at 5:25 PM, refreegrata wrote:
> Hello list. I'm a newie in django with many questions. I want to do
> something like this:
> --
Thanks, Phil! That works perfectly.
The only thing that feels awkward about Django's models is that the
attributes feel like a mixture of stuff that belongs to the view and
stuff that belongs to the model (blank=True, null=True anybody?). But
that's about the only small complaint I have about Dja
Berco Beute escribió:
> Using: Latest from trunk
>
> I'm using a custom widget for datetimefields:
>
BTW, which one are you using? The one that wrappers jscalendar?
Juanjo
--
mi blog: http://www.juanjoconti.com.ar
--~--~-~--~~~---~--~~
You received this messag
On 20/04/2008, Berco Beute <[EMAIL PROTECTED]> wrote:
>
> Using: Latest from trunk
>
> I'm using a custom widget for datetimefields:
>
> ==
> #models.py
> class Event(models.Model):
> endDateTime = models.DateTimeField('Finish', blank=True,
> null=True
On Sun, 2008-04-20 at 02:20 -0700, Berco Beute wrote:
> Using: Latest from trunk
>
> I'm using a custom widget for datetimefields:
>
> ==
> #models.py
> class Event(models.Model):
> endDateTime = models.DateTimeField('Finish', blank=True,
> null=True)
>
23 matches
Mail list logo