hayır hayır benim dediğim doğru..
sen sanırım class ismine Ogrenciler vermiştin
ben ise Ogrenci asında class oluşturdum.
o bi değişken ve sen
ogrenci = models.ForeignKey(Ogrenci)
şeklinde kullanmalısın
ogrenci = models.ForeignKey('Ogrenci')
şeklinde değil .....................
On Tue, 2010-01-19 at 14:50 +0200, "H.İbrahim YILMAZ" wrote:
> H.İbrahim YILMAZ wrote:
> > A.S. Gaffar Durmaz wrote:
> >
> >> dediğiniz yerde şu şekilde olmalı hatta biraz düzeltelim
> >>
> >> class Ogrenci(models.Model):
> >> no = models.CharField(max_length=200)
> >> ad = models.CharField(max_length=200)
> >> soyad = models.CharField(max_length=200)
> >> sinif = models.CharField(max_length=200)
> >>
> >> #burada zaten öğrenciyi id si ile tutmuş olacaksın :)
> >> class Devamsizlik(models.Model):
> >> ogrenci = models.ForeignKey(Ogrenci)
> >> tarih = models.DateTimeField() # bu hem tarih hem zaman
> >> tarih = models.DateField() # bu sadece tarih
> >>
> >> ii çalışmalar kolay gelsin
> >>
> >> On Tue, 2010-01-19 at 12:16 +0200, "H.İbrahim YILMAZ" wrote:
> >>
> >>
> >>> class Devamsizlik(models.Model):
> >>> ogrencino = models.?
> >>> tarih = models.?
> >>>
> >>>
> >> _______________________________________________
> >> Linux-programlama mailing list
> >> [email protected]
> >> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
> >> Liste kurallari: http://liste.linux.org.tr/kurallar.php
> >>
> >>
> > Merhaba,
> > NameError: name 'Ogrenci' is not defined
> > şeklinde bir hata alıyorum :S sql'i oluşturamıyor
> > Saygılar.
> >
> >
> >
> Aşağıdaki şekilde kullanmak lazımmış :)
>
> ogrenci = models.ForeignKey('Ogrenci')
>
>
_______________________________________________
Linux-programlama mailing list
[email protected]
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Liste kurallari: http://liste.linux.org.tr/kurallar.php