Hi all,
I have a form and a formset that are passed to a template. I would
like to display any errors at the top of the template, using something
like this:
{% if form.errors or form.non_field_errors or formset.errors or
formset.non_form_errors %}
The operation could not be performed
Hi guys,
I'm going to develop a survey application with the following
functionalities:
•An administrator defines a custom form through a form builder
interface to carry out a survey. The form can be composed of an
arbitrary number of questions (the form of text boxes, radio and check
boxes only).
Hi Guys,
I'm try to figure out how add some customized functionalities to an
inline formset. What I would implement are the two following features:
- ability to delete a record by pressing a submit button assigned to
each row (instead of checking the delete box and submitting the
overall form)
- a
:
> On Jan 21, 11:45 pm, pinco wrote:
>
> > The code
>
> > {% for choice_value, choice_text in
> > myform.fields.choicefieldname.choices %}
> > choice_value: {{ choice_value }}
> > choice_text: {{ choice_text }}
> >
The code
{% for choice_value, choice_text in
myform.fields.choicefieldname.choices %}
choice_value: {{ choice_value }}
choice_text: {{ choice_text }}
{% endfor %}
gives the choices text and values associated to each choice, but
actually do not rend
Hi Shawn,
I spent some time playing with dir and reading the django code for
forms, but to me there is no evident way to iterate through the single
choices within a choicefiled.
Hope I'm wrong and I missed something.
On Jan 21, 9:25 am, Shawn Milochik wrote:
> If this kind of thing isn't cle
Sorry for the trivial question but...
Is there a way to access the single choices of a choicefield within a
template?
I would get something like:
{% for choice in form.my_coicefield.choices %}
{{ choice }}
{% endfor %}
but obviously this is not working.
Many thanks in advance.
Paolo
Hi there.
I’m not able to figure out how to solve in a simple and clean way the
following problem.
Basically what I want to do is to edit the instances of the following
model:
Models.py
class Seller(models.Model):
brand = models.CharField(max_length=250)
...
slug = models.SlugField(uniqu
Hi,
I'm trying to figure out how to solve the following issue without
succeed.
I have a model like this:
class Product(models.Model):
...
measure_cm = models.FloatField(...)
measure_in = models.FloatField(...)
...
The fields contain the same information (a relevant dimension of a
pr
Michael,
You are right: the Django admin was stepping on my media directory. I
changed the name of "media" directory to "my_media" and now everything
works fine.
Thank you very much for your help.
By the way, thank you also for your blog, which is an invaluable
source of learning for every dja
Hi,
I'm having some problems to serve static files in the development
environment.
The directory that actually contains the static files under OSX is:
/Users/paolo/Sites/SF06/sensationalfly/media/
I modified the settings.py MEDIA_ROOT parameter to:
MEDIA_ROOT = '/Users/paolo/Sites/SF06/sensa
> same product field
> so that it can populate the choice field setting correct. i.e.
> FormForOptionQuantity(product,request)
>
> P.K.
>
> On Dec 9, 7:31 am, pinco <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I'm trying to populate dynamically at runti
Hi,
I'm trying to populate dynamically at runtime a choicefield and
subsequently validate the user choice, but without results.
The goal is to permit the user, in an e-commerce application, to
choose the number of products to buy through a choicefield, with a
list of integer from 1 to a maximum n
Frank,
your snippet works great. I just removed the int conversion on
bf_data, since I want to have f.is_valid() = false if the user submits
something different than an integer.
Without you I would never be able to solve the problem.
Thanks a lot.
On 11 Ott, 09:51, pinco <[EMAIL PROTEC
> ... super(CartForm, self).__init__(a)
> ... for key in a.keys():
> ... self.fields[str(key)] =
> forms.IntegerField(required = True)
> ... self.fields[str(key)].bf =
> forms.forms.BoundField(self, self.fields[str(key)], str(key))
you help me?
Many thanks
On 7 Ott, 02:45, FrankW <[EMAIL PROTECTED]> wrote:
> In your example,
> self.fields[str(key)]=forms.CharField(initial=c[key])
> isn't doing what you expect.
>
> You are setting the initial attribute of a field, not creating
> a Boun
Hi,
I'm trying to figure out how to build a form to display x fields,
where x is determined at runtime (e.g. a form to update the quantities
of all the items in a shopping cart).
My model is:
class CartForm(forms.Form):
def __init__(self, c, *args, **kwargs):
super(Cart
Hi,
I have the following models for each item in my shopping cart:
class CartItem(models.Model):
option = models.ForeignKey(Option) #product option tied to a
particular product
cart = models.ForeignKey(Cart) #contains all cart items
quantity = models.IntegerField(blank=Tr
Hi,
I'm new to Django and I'm evaluating this promising framework by
migrating a part of our e-commerce application from rails to Django
(and we are really amazed from the results, expecially for the speed
of the framework when compared to rails).
At the moment I'm implementing a prototype of th
19 matches
Mail list logo