Hello,

I want user, contact_date, contact_time of attendance and leavework  objects

so, i use mata.fields of models

my the models:

class Staff(models.Model):
    user = models.OneToOneField(User, null=False)
    user_name = models.CharField(max_length=255)
    first_kana = models.CharField(max_length=255)
    last_kana  = models.CharField(max_length=255)
  
    def __unicode__(self):
        return self.user_name

class attendance(models.Model):
    user = models.ForeignKey(Staff, )
    contact_date = models.DateField( auto_now_add=True)
    contact_time = models.TimeField( auto_now_add=True)

    class Meta:
        ordering = ['-contact_time']
    def __unicode__(self):
        return unicode(self.user)

class leavework(models.Model):
    user = models.ForeignKey(Staff)
    contact_date = models.DateField( default=datetime.now)
    contact_time = models.TimeField(default=datetime.now)

    class Meta:
        ordering = ["-contact_time"]

    def __unicode__(self):
          return unicode(self.user)





2014年5月16日金曜日 21時31分25秒 UTC+9 Daniel Roseman:
>
> On Friday, 16 May 2014 12:34:52 UTC+1, hito koto wrote:
>>
>> Hi,
>>
>> I would like to export the csv file  as follows:
>>
>>   No name
>> date 
>> time of attendance
>> time of leavework
>>  01
>> hito
>> 2014/5/16 10:31:50 20:30
>>  01
>> hito
>> 2014/5/16 10:56:23 20:30  01
>> hito
>> 2014/5/16 10:19:59 20:30  02
>> charry
>> 2014/5/16 10:18:40 20:30  02
>> charry
>> 2014/5/16 10:12:52 20:30  02
>> charry
>> 2014/5/16 10:11:19 20:30 
>>
>
> I have no idea how that relates to my reply. But if you need it like that, 
> why are you doing all that mucking about with `_meta.fields`? You know 
> exactly what fields you want, you should simply specify them.
> --
> DR.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d5d691b-7f5a-43eb-81ce-296db3c61afb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to