lidate one form based on the (cleaned) data of
another form? Or how you would refactor that? Thanks in advance!
Kind regards, Roald
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://gro
On 20 feb, 00:03, Reinout van Rees wrote:
> On 19-02-12 14:16, dummyman dummyman wrote:
>
> The solution is simple: just add a {{ csrf_token }} somewhere in your
> form. That ought to do it.
A typo there, Reinout ;-). You meant:
{% csrf_token %}
Cheers, Roald
--
You received
?
Hi Visgean,
I think you want inline formsets: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/
#inline-formsets
Cheers, Roald
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-user
urrent value of bool_field, have a look at
https://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model.
class A(models.Model):
...
def save(self, *args, **kwargs):
super(A, self).save(*args, **kwargs)
self.b_set.update(bool_field=Tru
pe: NoReverseMatch at /order/
Exception Value: Reverse for 'ideal_in' with arguments '()' and
keyword arguments '{}' not found.
Cheers, Roald
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
ng-initial-data-with-a-formset
Cheers, Roald
--
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...@google
; import sys
>>> file = sys.stdin
Option 2: read command line arguments
>>> import sys
>>> file = open(sys.argv[1])
Cheers, Roald
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email
add the request context
You mean http://docs.djangoproject.com/en/dev/ref/settings/
#std:setting-TEMPLATE_CONTEXT_PROCESSORS?
Cheers, Roald
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, sen
On Aug 11, 2010, at 7:25 PM, refreegrata wrote:
My code
--
class Format(models.Model):
name = models.CharField(max_length=5, unique=True)
myBoolean = models.BooleanField(default=False)
class FormFormat(forms.ModelForm):
boolean1 = forms.BooleanField(requi
ng the widget attrs on form object creation:
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
# If you want an other widget:
# self.fields['name'].widget =
forms.TextInput(attrs={something...})
self.fields['name'].w
follow the django DRY principles.
Personally, I like all of my forms to be classes. If you want that,
you should create a context processor.
http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors
Cheers, Roald
--
You received this message because you are sub
therefore be saved in the database. If I create a personupdate using
PersonUpdate.objects.create or ~.get_or_create, I don't mind saving
the object, but I don't want to call 'self.save()' in
PersonUpdate.__init__. How should I handle this?
Cheers, Roald
--
You received this mes
On Aug 5, 2010, at 3:15 PM, Roald de Vries wrote:
On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote:
On Aug 5, 1:50 pm, Roald de Vries wrote:
Dear all,
I have the following error, and don't know what it means:
Error: One or more models did not validate:
update.personupdate:
On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote:
On Aug 5, 1:50 pm, Roald de Vries wrote:
Dear all,
I have the following error, and don't know what it means:
Error: One or more models did not validate:
update.personupdate: 'address' has a relation with model
Addr
but I think the problems started when
I separated my Person class into an abstract base class PersonProfile
and a derived class Person, and added the class PersonUpdate, deriving
from PersonProfile too.
Can anybody help?
Thanks in advance, cheers,
Roald
--
You received this message because you
=[]
while cnt
First: list is a very unlucky name for a parameter, since it's the
type of []
Second: list comprehension rules!
def groupListByRow(list):
return [lst[start:start+5] for start in range(0, len(lst), 5)]
Cheers, Roald
--
You received this message because yo
Because you're querying the Projects, you can not use Favourite fields
as keywords. So you'll (more or less) have to stick with the other
option.
Cheers, Roald
--
You received this message because you are subscribed to the Google Groups "Django
users" gro
On Jul 28, 2010, at 5:19 PM, kostia wrote:
Thank you very much Roald,
What is faster:
projects = Project.objects.filter(favourites__user = request.user)
or
select_related('project')
?
I think it doesn't matter much, but if one is faster, it should be the
first one.
7;project')" if performance is an
issue for you.
Cheers, Roald
--
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, s
des, VIM doesn't leave
you with a crippled little finger (from all the 's)
- VIM has more commands than Emacs
I would say Emacs makes you more productive on shorter term, VIM makes
you more productive on longer term.
Cheers, Roald
--
You received this message because you are subscrib
var2 = 'var2',
)
# ... and so on
I will probably post a more extensive code snippet to django-dev and
django-snippets in a few weeks.
Kind regards,
Roald
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
T
On Mar 31, 2010, at 9:12 AM, Eximius wrote:
Please help me out
On Mar 29, 11:04 pm, Eximius wrote:
Hi all,
I have created a django application using app engine sdk, and have
stored data in database using forms. But the problem i am getting
when
i deploy it, the data I stored is not ther
On Mar 11, 2010, at 11:56 AM, pyt...@roalddevries.nl wrote:
I have the following model:
1 class MyOrderItem(models.Model):
2 orderitem = models.ForeignKey(OrderItem, null=True,
blank=True)
3 # other fields
4
5 def save(self, *args, **kwargs):
6
23 matches
Mail list logo