One of the forms I'm using in a FormWizard takes an aditional keyword
argument in its __init__, e.g.:
=
def __init__(self, arg1=None, *args, **kwargs):
pass
=
I'm at a loss how to make FormWizard construct my form while passing
in the extra keyword argument (arg1).
To reply to my own question...I've extended UserCreationForm as
follows:
==
class UserCreationFormExtended(UserCreationForm):
def __init__(self, *args, **kwargs):
super(UserCreationFormExtended, self).__init__(*args,
**kwargs)
Hi,
I'm using the UserCreationForm for creating users, but I would like to
show the email, firstname and lastname fields as well (and they should
be required). Much like the view you get when adding a user through
the admin interface. What's the best way to do this? Extend
UserCreationForm? Or
No worries, Python 2.6 will be actively supported for many, many years
to come and the differences between 2.6 and 3 are not that huge. You
can program for 2.6 while keeping in mind the code will be ported to 3
one day. It'll make a shift a breeze.
2B
On Aug 5, 10:47 pm, snfctech
> You forgot to set the prefix here, so the form that the user is
> submitting their data from doesn't have the fields named correctly. You
> need to set it up exactly the same way at this point as you did in the
> POST path, with the exception of not prepopulating with data.
Thanks, the missing
I'm trying to add multiple instances of the same form on one page,
each with its own submit button. I know how to use the 'prefix'
argument for a form to differentiate between forms, but I can't figure
out how to get the right data when it is POST'ed back (see view.py
below). Somehow the form
What's the recommended way for implementing (group)permission
inheritance in Django?
What I want to accomplish is a a hierarchy of groups where subgroups
inherit permissions from the parent group. I have seen
'comaie' (http://code.google.com/p/comaie-django-groups/) but that is
based on
On Jan 6, 2:35 pm, Pigletto wrote:
> So, Netbeans is currently my IDE of choice. Good svn integration,
> faster than eclipse and komodo, stable, nice markup highlighting.
+1
I'm using SciTe and emacs for simple, single file editing.
I've used pydev for a while but eclipse's
for iFrames to give back control to the parent page?
2B
On Jan 5, 10:43 am, Berco Beute <cybe...@gmail.com> wrote:
> The iFrame is from a different domain, which is likely causing the
> problem. I can see that the session is lost since the logged in user
> is suddenly logged out.
>
>
Still looking for some feedback. :)
In the meantime I've collected a few links that might be useful for
others with the same questions:
http://www.egenix.com/library/presentations/EuroPython2008-Designing-Large-Scale-Applications-in-Python/
http://highscalability.com/ebay-architecture
The iFrame is from a different domain, which is likely causing the
problem. I can see that the session is lost since the logged in user
is suddenly logged out.
2B
On Jan 5, 1:15 am, Daniel Roseman
wrote:
> Personally, I can't see how that redirect could be
I'm still searching for a solution for this problem.
Which other forums should I try?
Thanks,
2B
On Jan 3, 5:33 pm, Berco Beute <cybe...@gmail.com> wrote:
> My page shows a (logged in) user an iFrame but when the iframe
> redirects the browser after it's done, the ses
My page shows a (logged in) user an iFrame but when the iframe
redirects the browser after it's done, the session is lost. The
redirecting of the parent (by the iframe) is done as follows:
=
function load() {
parent.location.href='
I'm looking for additional information that could help me decide
whether I should port a large web application to Python/Django. The
application handles transactions, which often come in bursts. Peaks
may go up to tens of thousands of transactions per second. There are 3
views on the system:
On Dec 10, 7:24 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> You say you excluded 'product' from the form but the code you posted has not
> excluded 'product', it has excluded 'parent' and 'usePrice'.
Ahem[hides under a rock in shame]...I guess copy/paste got me
there.
> Also, the
> Try adding this to your template:
>
> {% if form.non_field_errors %}
> {{form.non_field_errors.as_ul}}{% endif %}
>
> This will tell you form errors that aren't specific to a field.
>
> Tim
>
> On Dec 10, 8:26 am, Berco Beute <[EMAIL PROTECTED]> wrote:
>
>
Here's the code:
http://dpaste.com/97758/
My modelform stays invalid although the required fields of the
instance are set. The 'product' field is excluded from the form
because it shouldn't be edited. When the form is posted I'm trying to
set the product on the form instance again, but that
Ah! Of course, why didn't I think of that! Works like a charm.
Thx!
2B
On Dec 8, 7:23 pm, Adi Sieker <[EMAIL PROTECTED]> wrote:
> Couldn't you add a method get_range() (or whatever name makes sense in
> your context)
> to the class the object is an instqnce of.
> The method would look
better to pass it in the context--why can't
> you do that?
>
> -Jeff
>
> On Dec 7, 5:12 pm, Berco Beute <[EMAIL PROTECTED]> wrote:
>
> > Is there a template tag to turn an int into a sequence (like 'range')?
> > What I want to do
Is there a template tag to turn an int into a sequence (like 'range')?
What I want to do is populate a select widget with the numbers up to
the int, like:
==
{% for i in someInt.range %}
{{i}}
{% endfor %}
==
Passing the sequence
> You might try reading the
> documentation:http://docs.djangoproject.com/en/dev/topics/email/#sending-alternativ...
Oops, completely overlooked that. Thanks for the pointer.
2B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Currently I'm sending plain text mails using:
###
from django.core.mail import EmailMessage
email = EmailMessage('hi', 'howdy', host, to)
email.send()
###
But now I want to use HTML in the body of the email. How do I format
such a message and can I just send it like above?
2B
I have one custom field in my form and I can't get the help_text in a
template. In the admin the help_text shows up fine so I assume it has
something todo with my custom field:
###template
{{ form.guests.help_text }} #where 'guests' is a
CommaSeparatedEmailField as specified
Is the fieldname or verbose_name of a instance-field (not a form-
field) accessible in a template?
2B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Thanks Rajesh,
I got a similar tip from someone else. I now specify the backend in
settings.py:
AUTH_BACKENDS = ('django.contrib.auth.backends.ModelBackend', )
where 'django.contrib.auth.backends.ModelBackend' is the default
backend. In my view I can then set the backend on the User
I have a User instance that I want to login. Normally in a view I
could just invoke authenticate() followed by login(), where the former
takes the username and password from the incoming request. In my case
I retrieve the User object from the db and only have the username, not
the plain password
28, 12:13 am, Berco Beute <[EMAIL PROTECTED]> wrote:
> Thanks, that works great! I didn't know about 'from
> django.core.files.images import get_image_dimensions'. Where can I
> find documentation about that? I've tried a custom 'clean_image'
> before using PIL, but that was just p
Thanks, that works great! I didn't know about 'from
django.core.files.images import get_image_dimensions'. Where can I
find documentation about that? I've tried a custom 'clean_image'
before using PIL, but that was just plain ugly. I never knew about
'get_image_dimensions'.
2B
> It's much
I have an image upload form and I want to INvalidate the form if the
uploaded image it too big. How can I get an error message in the form
saying the uploaded image is too big?
===Model==
class Image(models.Model):
image = models.ImageField(upload_to='imageupload')
To answer my own question, I now moved the validation code to the form
and create a PIL image using
Image.open(StringIO(uploadedFile.content)):
===forms.py
class ImageForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ImageForm, self).__init__(*args, **kwargs)
Something tells me the validation actually belongs to the form, but
how can I get to the image size from within the form?
===forms.py
class ImageForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ImageForm, self).__init__(*args, **kwargs)
def clean_image(self):
It should be in:
/project/application/templatetags/
2B
--~--~-~--~~~---~--~~
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
I have a form for uploading images. When uploaded I check for a
maximum size, see snippet below. If it's too big I return the same
form but without the uploaded (big) image. Unfortunately the big image
is part of the returned form (I can tell since I display the image for
a form). Is there a way
is_empty() was indeed what I was looking for. :)
For the time being I got it working using
any(form.cleaned_data.values())
Thanks for your great help!
2B
On Jul 2, 5:02 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Wed, 2008-07-02 at 07:58 -0700, Berco Beute wrote:
> >
I have multiple instances of same the form (of which all fields are
optional), but I only want to save the form in case something is
filled in. How can I test that in my view?
2B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Great! A cleaner solution. Thanks!
Is there any effort underway for making overriding default widgets
simpler? I think that's really needed (especially for beginner like
me).
2B
On Jun 8, 1:20 am, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote:
> On Jun 7, 4:18 pm, Berco Beute <[EMA
My model has a ForeignKey that renders as a SELECT field in HTML. The
problem is that there's an empty value ('-') that I would like
to hide. I've tried adding 'null=False' and 'blank=False' to the
ForeignKey but the empty value still appears. Any suggestions?
2B
Passing a complete context to a simple_tag doesn't (yet?) work, as
described here:
http://groups.google.com/group/django-users/browse_thread/thread/ee830466be465704/a41d89fd476becb1#a41d89fd476becb1
I finally solved my problem by defining my own tag as follows:
===
from
I've written a simple tag that renders a template, but to do so it
needs the complete context. How can I pass that from a template?
Thanks,
2B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
That's seems to be working, the only thing I've left to do is passing
the complete context from the template to the simple_tag, else the
simple_tag won't be able to render the template. How is that normally
done in Python?
2B
On May 31, 7:32 am, Alex Morega <[EMAIL PROTECTED]> wrote:
> Create
Unfortunately that doesn't work. This works:
{{ include dir|concat:"/tag.html" }}
But not this:
{% include dir|concat:"/tag.html" %}
Thanks, but I'm still searching for a solution...
2B
On May 29, 11:18 pm, Johannes Dollinger
<[EMAIL PROTECTED]> wrote:
> You could use a filter:
>
>
I can surely pass the path variable into the context from within my
view, but the view doesn't know which filename to include. So in the
template, I would still have to combine path and filename when
creating an include tag such as:
{% include "dir/tag.html" %}
But how can I combine the path
Inclusion tags sound good, but I'm not sure how it could solve my
problem. In my template I would like to use an inclusion tag this way:
###template
{% showTag 'tagName' %}
###inclusion tag
@register.inclusion_tag('tag.html')
def showTag(tagname):
#...
###tag.html
bla
But
In the following 'include' tag the 'dir' may vary:
{% include "dir/tag.html" %}
so I would rather use something like:
{% include {{ dir }}"/tag.html" %}
which of course doesn't work. Is there a way to accomplish this? Being
able to set a variable inside a template would solve the problem, but
How can I test whether the following (example) 'include' tag returns
any text?
{% include "dir/tag.html" %}
2B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Sounds interesting. It would be great if you could share some details
on how you combined Django and Moodle.
2B
On May 15, 4:35 am, "Ariel Mauricio Nunez Gomez"
<[EMAIL PROTECTED]> wrote:
> Moodle and Django can coexist happily (Using same database and writing
> django models for some of the
#the-matching...
>
> What the second paragraph means is that the URL handler is trying to call
> new(request, name = 'default') and (understandably) it is not working. You
> should change the id into a named argument.
>
> -- Scott
>
>
>
> On Wed, May 14, 2008 at 11:32
I've been using Moodle (moodle.org), which offers the functionality
you are looking for, and would prefer to use a Djange-based system as
well. I haven't found one though.
2B
On May 14, 5:26 pm, Wes Winham <[EMAIL PROTECTED]> wrote:
> Does anyone know of any learning management application
I want to capture an 'id' and a 'name' from a url (slug) and pass them
to a method with signature new(request, id, name='default'). For
example I want to capture '8' and 'newname' from:
/new/8/newname
Somehow the following url dispatchers work and don't work. The error
says there is a
Ah, Django's documentation is a treasure:
http://www.djangoproject.com/documentation/newforms/#a-simple-example
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Is there something like a 'CommaSeparatedEmailField'? I know there is
a CommaSeparatedIntegerField, which is rather handy...
2B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
Django.
After returning to Django now I remember again what was so cool about
it: the community around it. :)
Thanks, everyone!
2B
PS: I'm using this widget: http://www.djangosnippets.org/snippets/391/
On Apr 20, 12:19 pm, "Phil Davis" <[EMAIL PROTECTED]> wrote:
> On 20/0
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)
#forms.py
class EventForm(forms.ModelForm):
endDateTime =
Thank you very much, that was exactly what I was looking for!
2B
On Mar 3, 11:58 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-03-03 at 14:23 -0800, Berco Beute wrote:
> > I want to create a form for editing existing Poll objects and their
> > associate
I want to create a form for editing existing Poll objects and their
associated Choice objects (see below). Editing the Poll objects is no
problem, the 'name' textfield shows up nicely. But I also want to edit
the associated Choice objects with the same form (much like you can do
on the
55 matches
Mail list logo