Hi all,
I get "global name 'self' is not defined" error what is the problem?
Thanks.
from django.db import models
from django.forms import *
from yenicrm.musteri.models import *
from django.contrib.auth.models import User
from django.forms.extras.widgets import *
# Create your models here.
class Ziyaret(models.Model):
tarih = models.DateField()
temsilci = models.ForeignKey(User)
musteri = models.ForeignKey(Musteri)
gorusler = models.TextField()
class ZiyaretForm(ModelForm):
tarih = DateField(widget=SelectDateWidget())
musteri = ModelChoiceField(queryset = Musteri.objects.none())
def __init__(temsilci = None, *args, **kwargs):
super(ZiyaretForm, self).__init__(*args, **kwargs)
self.fields["musteri"] = Musteri.objects.none() if temsilci is
None else Musteri.objects.filter(temsilci = temsilci)
class Meta:
model = Ziyaret
exclude = ("temsilci",)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.