On Wed, Nov 2, 2011 at 12:15 PM, Jaroslav Dobrek
wrote:
> I now use ManyToManyFields and hide certain data from administrators
> by simply not importing them into admin.py. What I don't like about
> this solution is that this data still is in the database and not in my
On 1 Nov., 18:54, Mark Furbee <markfur...@gmail.com> wrote:
> As alluded to previously, the most "straightforward way to use a set of
> choices of which several can be chosen" IS to use a ManyToManyField. The
> syntax is slightly different, but ManyToManyFiel
As alluded to previously, the most "straightforward way to use a set of
choices of which several can be chosen" IS to use a ManyToManyField. The
syntax is slightly different, but ManyToManyFields are really easy to use
with Django. Do not reinvent the wheel in this case.
Thanks,
M
Candidate(models.Model):
programming_languages = models.CharField(max_length=50, choices=(
(u'Python)', u'Python'),
(u'C++', u'C++'),
(u'Java', u'Java'),
# ...
), blank=True)
with the only exception that, in the admin interface
e above code was to express that I wanted to use this code
>
> class Candidate(models.Model):
>
> programming_languages = models.CharField(max_length=50, choices=(
>
> (u'Python)', u'Python'),
> (u'C++', u'C++'),
> (u'Java', u'Ja
guages = models.CharField(max_length=50, choices=(
(u'Python)', u'Python'),
(u'C++', u'C++'),
(u'Java', u'Java'),
# ...
), blank=True)
with the only exception that, in the admin interface, several choices
are possible when one creates
On Tue, Nov 1, 2011 at 11:07 AM, Jaroslav Dobrek
<jaroslav.dob...@gmail.com> wrote:
> Hello,
>
> what is the most straightforward way to use a set of choices of which
> several can be chosen without using a ManyToManyField?
>
> Using a ManyToManyField would make
Hello,
what is the most straightforward way to use a set of choices of which
several can be chosen without using a ManyToManyField?
Using a ManyToManyField would make my program unnecessarily
complicated.
Example:
class Candidate(models.Model):
programming_languages
gt; override the default field for start_time and use a ChoiceField with
> choices set to something like this ((time(9), '9 am'), (time(10), '10
> am'), ...).
>
> This seems to work perfectly well, with the correct time values being
> saved to the database. The only real reason I'm a
for start_time and use a ChoiceField with
choices set to something like this ((time(9), '9 am'), (time(10), '10
am'), ...).
This seems to work perfectly well, with the correct time values being
saved to the database. The only real reason I'm asking this question
is that I couldn't find any examples
=
> Numerous clever workarounds are given in the forums but I decided to
> try using "formfield_for_manytomany" in the inline class. This works
> brilliantly.
==
Make that
"...using formfield_for_foreignkey() in the inline class."
!!! (Rushing to go for a coffee!)
On Aug
I am fairly new and using Django Admin to manage a set of lists and
forms for a database GUI.
I am not happy with the performance rendering a form which has
foreignkey fields or manytomany fields with numerous values. This
inspired me to get involved with overloading
"formfield_for_foreignkey"
return u"%s | %s | %s" % (
> unicode(self.name_branch),
> unicode(self.address_1))
>
> class TransactionUpdateForm(forms.ModelForm):
> branchqs = Branch.objects.get(name_branch)
> branches_field = forms.BranchModelChoiceField(bran
rm):
branchqs = Branch.objects.get(name_branch)
branches_field = forms.BranchModelChoiceField(branchqs)
#ModelChoiceField instance
branch_name_new = forms.models.CharField(required=True,
widget=forms.Select(choices={'BR_CODE1': 'HQ': 'Branch 2'}))
class Meta:
On Mon, Aug 8, 2011 at 2:56 PM, Daniel Roseman wrote:
>
> I'm afraid it's really not clear what you're trying to do, or what the
> problem is.
> If the issue is that you have a field referring to a foreign key, and you
> want to change what the values displayed in the
On Monday, 8 August 2011 13:06:51 UTC+1, Kayode Odeyemi wrote:
>
> That didn't help either. It still did not depict what I'm trying to do.
> Those filters are for retrieving values set by a user. However, I tried the
> code below which is to hard code the choices into th
e they do in the admin, right ?
>
> You might want to check Django's source for the admin forms and templates
> to get some inspiration then.
>
> Hard coding the choices is never a satisfactory solution but I suggest you
> retrieve them from your models file so you stay DRY complian
Like they do in the admin, right ?
You might want to check Django's source for the admin forms and templates to
get some inspiration then.
Hard coding the choices is never a satisfactory solution but I suggest you
retrieve them from your models file so you stay DRY compliant and then it's
pretty
That didn't help either. It still did not depict what I'm trying to do.
Those filters are for retrieving values set by a user. However, I tried the
code below which is to hard code the choices into the form field on creation
class TransactionUpdateForm(forms.ModelForm):
branch_name_new
ext,
> context_instance=RC(request))
>
> At what point do I do: update_form.get_branch_name_display()? In forms.py
or
> views.py? Where?
>
> It seems to me that get_FOO_display() is meant to display the values set
by
> the user. This is not what I'm looking to do. What I got stuck with i
eems to me that get_FOO_display() is meant to display the values set by
the user. This is not what I'm looking to do. What I got stuck with is that
the tuple values are not displayed as options in the form select
field(choices).
Thanks
On Mon, Aug 8, 2011 at 10:40 AM, Thomas Orozco <g.orozco.tho...@gm
;
> from django.db import models
> from django.forms import ModelForm
>
> TITLE_CHOICES = (
> ('MR', 'Mr.'),
> ('MRS', 'Mrs.'),
> ('MS', 'Ms.'),
> )
>
> class Author(models.Model):
> name = models.CharField(max_length=100)
> title = models.CharField(max_length=3, choi
= models.CharField(max_length=100)
title = models.CharField(max_length=3, choices=TITLE_CHOICES)
birth_date = models.DateField(blank=True, null=True)
def __unicode__(self):
return self.name
class AuthorForm(ModelForm):
class Meta:
model = Author
I have got similar setup
On Thu, May 12, 2011 at 10:09 AM, Jani Tiainen <rede...@gmail.com> wrote:
> On Thu, 2011-05-12 at 09:59 +0200, Thomas Weholt wrote:
>> I got a model looking something like this
>>
>> class SomeModel(models.Model):
>> somefield = models.CharField(m
You don't need to override choices for Model, because it is global to
validate "what values accepted to store into database". It's not depends on
current request scope or session.
If you need to provide user with subset of choices to choose from
dynamically, then you should
On Thu, 2011-05-12 at 09:59 +0200, Thomas Weholt wrote:
> I got a model looking something like this
>
> class SomeModel(models.Model):
> somefield = models.CharField(max_length=100, choices=somemethod())
>
> The problem is that somemethod, which produces the choices to
I got a model looking something like this
class SomeModel(models.Model):
somefield = models.CharField(max_length=100, choices=somemethod())
The problem is that somemethod, which produces the choices to give in
the form in the admin, is called when the module is imported, not when
the form
Hello,
I'm developing several personalized admin sites (by subclassing
admin.ModelAdmin).
Is it possible to use different Field.choices in a particular field
for each admin site?
The problem is that the choices option is set within the model
definition, not in the ModelAdmin.
Regards,
Juan
For the first question, you can use the form's 'instance' property to
access the underlying model instance.
For the latter, it sounds like you just need to concatenate the stuff
you display.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
However, in order to display more detail in each row, I'd like to have
> access to the object behind it - to reference columns not displayed,
> follow foreign key relationships, etc., but I can't see how to do it.
> Any advice?
>
> On the same form, I'd like a similar functionality for t
, etc., but I can't see how to do it.
Any advice?
On the same form, I'd like a similar functionality for the choices in
a series of radio buttons. The choices attribute only accepts a list
of two values - index and label. The design calls for several pieces
of data (date, time, location
x_length=255)
> mymodel = models.ForeignKey(MyModel)
>
> class MyModelItem(models.Model):
> mymodel = models.ForeignKey(MyModel)
> other = models.ForeignKey(OtherModel, null=True, blank=True)
> ===
>
> how can i use limit_choices_to (or some other way) to filte
(MyModel)
other = models.ForeignKey(OtherModel, null=True, blank=True)
===
how can i use limit_choices_to (or some other way) to filter
ForeignKey choices based on current model field?
basically, how can i do:
other = models.ForeignKey(OtherModel, null=True, blank=True,
limit_choices_to
Well,
MAX_CUISINES = 3
def clean(self):
# three cuisines max. allowed
if self.pk is None:
# That's the case that raise the error
# you're inserting a new Restaurant
pass
else:
# Here, you're editing an existing Restaurant
Dnia 11-03-2011 o 22:45:34 greenie2600 napisał(a):
'Restaurant' instance needs to have a primary key value before a many-
to-many relationship can be used.
That is the answer You need to understand. afiak You can't perform m2m
validation on model level due that very
werefr0g—
Yep, that's actually the solution I'm looking into right now. However,
I'm getting an error when trying to save a new instance of the
Restaurant model:
"'Restaurant' instance needs to have a primary key value before a many-
to-many relationship can be used."
Here's the new code that's
I didn't try it, but werefr0g may be right. It seems that
Model.clean() is the method do you need. And you can still add a
javascript control for more convenience without the risk that if a
user deactivate javascript, the error will be saved.
Let us know greenie if it's ok with this method.
Hello,
Can Model.clean() method help you? [1] You'll still have to pay
attention to validation before trying to save your instances.[2]
Regards,
[1]
http://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.clean
[2]
Dnia 11-03-2011 o 21:39:01 bagheera <neost...@go2.pl> napisał(a):
Dnia 11-03-2011 o 21:29:29 greenie2600 <greenie2...@gmail.com>
napisał(a):
bagheera -
I had seen the limit_choices_to parameter, but I thought it controlled
*which* choices are available to the user - not *how m
Dnia 11-03-2011 o 21:29:29 greenie2600 <greenie2...@gmail.com> napisał(a):
bagheera -
I had seen the limit_choices_to parameter, but I thought it controlled
*which* choices are available to the user - not *how many* they're
allowed to choose.
I want to show the user a list of 20
Dnia 11-03-2011 o 21:29:29 greenie2600 <greenie2...@gmail.com> napisał(a):
bagheera -
I had seen the limit_choices_to parameter, but I thought it controlled
*which* choices are available to the user - not *how many* they're
allowed to choose.
I want to show the user a list of 20
valid; it just wasn't saved).
I think I need to override the model validation instead. Perhaps I
need to override Model.clean_fields()?
Right, i just get to that point, there is a cave rat about limiting
choices on form level.
Depending on limiting query it may make problems if you edit this
bagheera -
I had seen the limit_choices_to parameter, but I thought it controlled
*which* choices are available to the user - not *how many* they're
allowed to choose.
I want to show the user a list of 20 or 30 cuisines, but forbid them
from checking more than three.
Can you show me an example
gontran -
Thanks.
However, I tried the sample code in your link, and I don't think it
will work. Returning a string from the overridden save() method
prevents the record from being saved to the database, but by the time
the save() method is invoked, my ModelForm (and consequently, I
presume, the
n't be able to check a fourth box.
My question: can this be enforced within the model, or is this
something I'd have to build into my interface layer?
You can limit choices on model level:
http://docs.djangoproject.com/en/1.2/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to
If que
edit: you don't need to raise an error if the restaurant already has 3
Cuisine's objects associated, you just need to return a string with
the explanation of the error.
On 11 mar, 20:11, gontran wrote:
> Hi greenie,
>
> you just need to override the save method from
Hi greenie,
you just need to override the save method from your model Restaurant.
Before saving each instance, you check if the restaurant already has
3 Cuisine's objects associated. If yes, you don't save the instance
and raise an error for exemple, if no, just call the standard method
of the
Hi all -
I have two models with a many-to-many relationship: Restaurant and
Cuisine. The Cuisine table contains, e.g., "Italian", "Mexican",
"Chinese", etc. Each Restaurant record can be associated with one or
more Cuisines.
Here's the thing: I'd like to limit this to three Cuisines per
I think it works. Thanks. What I did:
changed the form cal in view:
form_provinces_to_add = ProvinceForm(request.POST, user=request.user)
changed a form a little:
class ProvinceForm(ModelForm):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop('user')
On Thu, Feb 24, 2011 at 2:17 PM, galago wrote:
> Now I have some strange thing. I display my form, send post and try to save
> it. But it doesn't save:/
> Here's my code:
> model:
> class UserProvince(models.Model):
> user = models.ForeignKey(User)
> province =
Now I have some strange thing. I display my form, send post and try to save
it. But it doesn't save:/
Here's my code:
model:
class UserProvince(models.Model):
user = models.ForeignKey(User)
province = models.ForeignKey(Province)
class Meta:
unique_together = (('user',
On Thursday, February 24, 2011 05:15:09 am Tom Evans wrote:
> Cargo cult programming is bad.
>
> Cheers
>
> Tom
Not going to really argue the point, it's valid, but it could be based on
habits taught by others, mentors...
Mike
--
Never, ever lie to someone you love unless you're absolutely
On Thu, Feb 24, 2011 at 1:07 PM, Mike Ramirez wrote:
> On Thursday, February 24, 2011 05:00:23 am galago wrote:
>> class ProvinceForm(ModelForm):
>
>> def __init__(self, *args, **kwargs):
>>
>
> for self.instance, you'll wnat to do something like this:
>
> self.instance =
user_provinces =
> UserProvince.objects.select_related().filter(user__exact=self.instance.id).
> values_list('province') self.fields['name'].choices =
> Province.objects.exclude(id__in=user_provinces).values_list('id', 'name')
>
> class Meta:
> model = Province
>
hmm, that solutoin works great:)
class ProvinceForm(ModelForm):
def __init__(self, *args, **kwargs):
super(ProvinceForm, self).__init__(*args, **kwargs)
user_provinces =
UserProvince.objects.select_related().filter(user__exact=self.instance.id).values_list('province')
('province')
self.fields['name'].choices =
Province.objects.exclude(id__in=user_provinces).values_list('id', 'name')
class Meta:
model = Province
fields = ('name',)
widgets = {
'name': Select(),
}
--
You received this message because you
On Thursday, February 24, 2011 04:21:46 am galago wrote:
> Thanks, that's the way I'll do it:)
> But now I have 1 more problem. In ModelForm I want to get some data about
> user from DB. I nedd to filter user provinces. How canI call the user id
> in my query? I pass request.user as form instance
Typo
choices.append((item.name, item.name))
should be
choices.append((item.id, item.name))
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Mike Ramirez
Sent: 24 February 2011 14:10
To: django-users@googlegroups.com
Subject: Re: field choices() as queryset
Thanks, that's the way I'll do it:)
But now I have 1 more problem. In ModelForm I want to get some data about
user from DB. I nedd to filter user provinces. How canI call the user id in
my query? I pass request.user as form instance in view: form =
ProvinceForm(instance=request.user)
How to
= models.SlugField(max_length=30)
>
> def __unicode__(self):
> return self.name
>
> It's rows to this are added only by admin, but all users can see it in
> forms.
> I want to make a ModelForm from that. I made something like this:
> class ProvinceForm(Model
rows to this are added only by admin, but all users can see it in
forms.
I want to make a ModelForm from that. I made something like this:
class ProvinceForm(ModelForm):
class Meta:
CHOICES = Province.objects.all()
model = Province
fields = ('name',)
widgets
On Fri, Feb 4, 2011 at 3:37 PM, Marcos Moyano <marcosmoy...@gmail.com> wrote:
> Remove (None, "No Period") from your choices and left the required=False on
> your form field. That should work.
>
but I wanted to do was to change the default value of null value:
instead o
s/left/leave/
sorry fot the double post.
On Fri, Feb 4, 2011 at 11:37 AM, Marcos Moyano <marcosmoy...@gmail.com>wrote:
> Remove (None, "No Period") from your choices and left the required=False on
> your form field. That should work.
>
> Rgds,
> Marcos
>
>
&g
On Fri, Feb 4, 2011 at 3:31 PM, Marc Aymerich <glicer...@gmail.com> wrote:
> On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans <tevans...@googlemail.com> wrote:
>> On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich <glicer...@gmail.com> wrote:
>>> Hi
>>> In
Remove (None, "No Period") from your choices and left the required=False on
your form field. That should work.
Rgds,
Marcos
On Fri, Feb 4, 2011 at 11:31 AM, Marc Aymerich <glicer...@gmail.com> wrote:
> On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans <tevans...@googlemail.co
On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans <tevans...@googlemail.com> wrote:
> On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich <glicer...@gmail.com> wrote:
>> Hi
>> In some choices widgets I want to represent null values as u'No
>> period' i
On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich <glicer...@gmail.com> wrote:
> Hi
> In some choices widgets I want to represent null values as u'No
> period' instead of u''
>
> I try with:
>
> PERIOD_CHOICES = getatt
Hi
In some choices widgets I want to represent null values as u'No
period' instead of u''
I try with:
PERIOD_CHOICES = getattr(settings, 'PERIOD_CHOICES',
((None,
ugettext('No Period
In your __init__, after the super().__init__():
self.fields['state_province'].choices = dynamic_options
Shawn
--
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 u
Hi,
I have been trying to dynamically change CHOICES options of a
fields, which is modified inside the __init__(self,) of my model
class. I can see my choices being modified in the __init__(self,), BUT
using a modelform the final result is NOT considering the dynamic
changed CHOICES.
Does
In my model i have that part:
...
STATUSES_CHOICES = (
(0, _(u'one')),
(1, _(u'two')),
(2, _(u'three'))
)
...
status = models.SmallIntegerField(default=0, choices=STATUSES_CHOICES,
null=True, blank=True)
then in my form based on that model I wanto to make
. For example, rather than restricting this at the option
level, perhaps override the save() and add in some custom checking
there. Athough the below code segment isn't perfect, it might be a good
starting ground.
class Something(models.Model):
range_marks = models.IntegerField(choices
)
self.organization = organization
if self.organization:
account_entry_types =
AccountEntryType.objects.filter(organization=self.organization)
self.fields['account_entry_type'].choices = [('',
'---')]
self.fields['account_entry_type'].choices.extend([(aet.id
Hi Cal!
Thank you very much for your reply and advice, but unfortunately it doesn't
work. It seems like in __init__ method we can't re-assign the choices. Even
if I try:
class Something(models.Model):
def __init__(self, *args, **kwargs):
_choices = ((SomeValue, 'SomeString
= (('default', 'default'), )
self.range_marks = models.IntegerField(choices = _choices,
verbose_name = 'Marks of Something')
super(Something, self).__init__(*args, **kwargs)
Let us know if it works :)
Cheers
Cal
On 02/12/2010 06:53, Alex Boyko wrote:
Hi!
I got such kind
Hi!
I got such kind of problem.
I'd like to define the tuple(list) of choices option at the moment of
instance created on the fly
In the future these choices will not change.
Hence I've found just one way to do it - override __init__() of my model
and
pass there the particular predefined list
Hallöchen!
Todd Wilson writes:
> [...]
>
> [...] Instead of hard-coding the entity types here, you are using
> a constant, presumably because you may want to introduce more
> entity types later. But what are the trade-offs bewteen
> representing types as CharFields wi
relationship of interest.
>
> Hope this helps ...
>
> class Entity(models.Model):
> """
> Entities can be corporations or humans. entity_type indicates
> which.
> """
> entity_type = models.CharField(max_lengt
On Nov 15, 8:55 pm, Thomas Schreiber wrote:
> check the grids on django packages:http://djangopackages.com/grids/g/tagging/
django-taggit seems to be the new hotness. Unfortunately we've been
waiting for months for a conversion script to help us migrate from
django-tagging to
check the grids on django packages:
http://djangopackages.com/grids/g/tagging/
On Mon, Nov 15, 2010 at 22:22, gyanguru wrote:
> Hi all,
>
> I am looking for django tag project. I have discovered 2 "django
> tagging" and "django tagit".
> Does any one has a benchmark regarding
Hi all,
I am looking for django tag project. I have discovered 2 "django
tagging" and "django tagit".
Does any one has a benchmark regarding this?
or
Any advice on which tagging app should I use.
My use case requires less amount of unique tags compared to number of
items to be tagged.
Cheers
Thanks, Steve. Sounds like a plan.
On Sep 28, 10:48 pm, Steve Holden <holden...@gmail.com> wrote:
> On 9/28/2010 10:39 PM, Derek wrote:
>
> > I have a model which has choices specified for the "offer_type" field:
>
> > class Coupon(models.Model):
>
On 9/28/2010 10:39 PM, Derek wrote:
> I have a model which has choices specified for the "offer_type" field:
>
> class Coupon(models.Model):
> offer_types = (
> (1, 'Percentage Off'),
> (2, 'Amount Off'),
> (3, 'Free')
I have a model which has choices specified for the "offer_type" field:
class Coupon(models.Model):
offer_types = (
(1, 'Percentage Off'),
(2, 'Amount Off'),
(3, 'Free'),
)
business = models.ForeignKe
with a field called "status". I could set the
choices in three ways:
1) status_choices = ((1, 'Completed'), (2, 'Unfinished'), (3,
'Cancelled'))
2) status_choices = (('COM', 'Completed'), ('UNF', 'Unfinished'),
('CAN', 'Cancelled'))
Or, 3 ):
db_choices = Choice.objects.all(
On Sat, Sep 25, 2010 at 10:50 AM, Yo-Yo Ma wrote:
> Anyone have any thoughts.
Yes. My thought is that you should settle down.
This is a mailing list, populated by an international audience.
You've waited less than *2 hours* before pinging the list for a
response. This
Anyone have any thoughts.
--
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
Let's say I have a model with a field called "status". I could set the
choices in three ways:
1) status_choices = ((1, 'Completed'), (2, 'Unfinished'), (3,
'Cancelled'))
2) status_choices = (('COM', 'Completed'), ('UNF', 'Unfinished'),
('CAN', 'Cancelled'))
Or, 3 ):
> I generally do something like:
>
> class OrderForm(ModelForm):
> def __init__(self, *args, **kw):
> ordernumber = '%06d' % kw.pop('ordernumber', 0)
> super(OrderForm, self).__init__(*args, **kw)
> self.fields['associated_files'].queryset =
>
'),
#edit begins
choices=((0,""),),
#edit begins
On Thu, Aug 26, 2010 at 11:09 PM, The Boss wrote:
> This should really be much easier.
I generally do something like:
class OrderForm(ModelForm):
def __init__(self, *args, **kw):
ordernumber = '%06d' % kw.pop('ordernumber', 0)
super(OrderForm,
Ok, I sort of found a solution. After much digging and looking at
class dictionaries
I found that i could manually update the dictionary self.base_fields.
self.base_fields['associated_files']
=self.__class__.associated_files
It's seems that class attrs assigned in init do not get added
The documentation made this seem trivial but I must be missing
something.
I have an order form with a many to many field to ArchivedFiles. I
want to just show file choices that start with the order number given
to the form at instantiation.
I almost works.
class OrderForm(ModelForm):
def
t.
> How would I do that? Just referring to
> {{ selectform.fields.selectfield.choices }} in the template gives me
> the list of choices (i.e. each single choice when I loop over it), but
> not the html I want.
>
> Are there any other approaches to the problem?
>
> Thanks for your
Andreas,
I'll give it a try, but it won't be soon. Other projects are hot.
Bill
On Sun, Aug 22, 2010 at 9:07 AM, Andreas Pfrengle wrote:
> Hello Bill,
>
> thanks for the code. It took half the weekend, but finally I built
> upon this to get a radiobutton-iterator. This
Hello Bill,
thanks for the code. It took half the weekend, but finally I built
upon this to get a radiobutton-iterator. This was a bit more
complicated, since the RadioInput widget has no own render-method, so
I needed to introduce a helper class that derives from RadioInput.
I've put the code
Oh, that sounds like a great way to handle it. Thank you!
On Aug 17, 10:10 am, Alex Robbins <alexander.j.robb...@gmail.com>
wrote:
> Maybe the ChoiceField should just be a CharField that just uses the
> Select widget class? That way it won't have choices hardcoded into the
> f
Maybe the ChoiceField should just be a CharField that just uses the
Select widget class? That way it won't have choices hardcoded into the
field validation. Your clean method could check that the domain is
valid.
Alex
On Aug 16, 1:39 pm, ringemup <ringe...@gmail.com> wrote:
> I have
Ok. I have permission from my boss, and have cleaned it up a bit. See:
http://djangosnippets.org/snippets/2151/
Bill
On Sat, Aug 14, 2010 at 7:25 AM, Andreas Pfrengle wrote:
> Hello Bill,
>
> thanks for your answer. However, I've never written a template filter
> yet.
. Subsequently, the user may either enter a new list of
domains to check, or select a domain from the radio buttons.
However, when they select one of the radio buttons, the form never
validates because the selected domain "is not one of the available
choices" -- because, of course, t
201 - 300 of 857 matches
Mail list logo