Super is one of python’s greatest mistakes.
http://docs.python.org/library/functions.html#super The form is
class class_name(parent_class):
def method(self, *args, **kwargs):
super(class_name, self).method(*args, **kwargs)
It’s better in Python 3, but Django hasn’t been ported over ye
Thank you for your effort, as far as I can see you understood my problem
right and your solution could work... if there wouldn't be that error:
TypeError at /kalender/1/new_termin/
super(type, obj): obj must be an instance or subtype of type
Termin is a model class, NewTerminForm is a modelfor
One minor edit to that:
form.save(request) -> form.save(request, kalender)
On Thu, May 31, 2012 at 8:47 PM, Kurtis Mullins wrote:
> Hey,
>
> I tried re-writing your view and form for you -- but I ran into a snag. I
> don't read German so other than code-wise (and a couple of obvious words,
> like
Hey,
I tried re-writing your view and form for you -- but I ran into a snag. I
don't read German so other than code-wise (and a couple of obvious words,
like kalender and participants) I'm not really sure what you're trying to
accomplish.
I do see one obvious issue, though. Participants is a many
On 31 mai, 20:09, Schmidtchen Schleicher
wrote:
> Thank you for your quick answer, but it doesn't really work. It raises the
> exception "can't assign to operator"
> My view now looks like this:
>
> @login_required
> > def create_termin(request, calid, year=None, month=None, day=None):
> > kal
Thank you for your quick answer, but it doesn't really work. It raises the
exception "can't assign to operator"
My view now looks like this:
@login_required
> def create_termin(request, calid, year=None, month=None, day=None):
> kalender = get_object_or_404(Kalender,pk=int(calid))
> if re
Yes, it is possible:
obj = form.save(commit=False)
obj.in_calender-id = kalender
obj.save()
On Wed, May 30, 2012 at 2:56 PM, Schmidtchen Schleicher <
spiolli...@googlemail.com> wrote:
> Is it possible to put missing data into the data of a form before calling
> form.save() ?
> I want to add the
Is it possible to put missing data into the data of a form before calling
form.save() ?
I want to add the calendar-id (calid/in_calendar) before saving to the
model.
http://susepaste.org/23451355
I tried adding it after instantiating the form with form.in_calendar_id =
kalender but it didn't
8 matches
Mail list logo