Django ユーザー登録について

2014-04-22 Thread hito koto
初めまして、 Django でスタッフの管理ツールを開発しょうと始めたのですが、まったくできないです、誰かが教えてくださいませ! 1,管理人は管理ログインのID/PWで入ってすべてのスタッフの情報を閲覧し管理できる 2,スタッフは管理者が発行してくれたID/PWでログインで入ってスタッフ個人個人のサイトでスタッフ個人個人の情報しか閲覧、管理できないこと 今はスタッフのID/PWで入ってもすべての情報を見てしまう! なんかわからないです。教えてくださいませ! 上記を作りとしたコード以下です。 こちらはstartprojectのUrls.py: from django.conf.url

Re: Django ユーザー登録について

2014-04-22 Thread hito koto
an example that you might be able to use: > > http://stackoverflow.com/questions/15181622/django-authenticate-based-on-an-objects-properties-using-class-based-views > > > Cheers and good luck - let us know if that helps. > > L. > > > > On 22 April 2014 18:15,

Re: Django ユーザー登録について

2014-04-22 Thread hito koto
= ('user_name','postalcode', 'address', 'residence','number') user_name = forms.CharField(label="氏名", error_messages={'required': ''}, help_text='必須') postalcode = forms.CharField(label="郵便番号&q

Re: Django ユーザー登録について

2014-04-23 Thread hito koto
; > On 23 April 2014 14:11, hito koto >wrote: > >> Thank you very much good idea! >> i'm was try but i'm have error when create new staff ! >> >> >>Request Method: POST >>Request URL: http://articles/create/ >>Django >> Version: 1.6.2

Re: Django ユーザー登録について

2014-04-23 Thread hito koto
Ok, Thank you very much! 曜日 7時08分05秒 UTC+9 Lachlan Musicman: > > > On 23 April 2014 17:59, hito koto >wrote: > >> Thank you! >> i can do create! >> >> Sorry! i'm don't understand create staff site, >> i want to create staff site , sta

Re: Django ユーザー登録について

2014-04-27 Thread hito koto
kForm(request.POST, instance = leave_work) if form.is_valid(): form.save() return HttpResponseRedirect('/articles/get/%s' % user.id) else: form = Leave_workForm() c = {} c.update(csrf(request)) c['form'] = form return

About django round-up display function of time

2014-05-07 Thread hito koto
Hi , good afternoon! I want to the round-up display function of time, how do i can do it , please help me!! (Django/Python) For example: 2, 09:30 minute = 09:40 09:15minute= 09:45 09:30minute= 10:00 09:31minute = 09:31 -- You received this message because you are subscribed to th

Django calendar error

2014-05-07 Thread hito koto
I hava also have some error , Why ? i did import calendar! ViewDoesNotExist at /admin/auth/user/ Could not import tcsarticle.views.calendar. View is not callable. Request Method: GET Request URL: http://admin/auth/user/ Django Version: 1.6.2 Exception Type: ViewDoesNotExist Exception Va

Re: About django round-up display function of time

2014-05-08 Thread hito koto
Thank you! 2014年5月7日水曜日 23時05分18秒 UTC+9 somecallitblues: > > I assume you're using datetime object in which case you have a look at > this SO answer > http://stackoverflow.com/questions/3463930/how-to-round-the-minute-of-a-datetime-object-python > > > On 7 May 201

Django create userprofile

2014-05-12 Thread hito koto
Hi, i have this error , why ? (1062, "Duplicate entry '1' for key 'start_work_id'") Exception Type: IntegrityError Exception Value: (1062, "Duplicate entry '1' for key 'start_work_id'" -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Django create userprofile

2014-05-12 Thread hito koto
(forms.ModelForm): class Meta: model = Myattendance class MyleaveworkForm(forms.ModelForm): class Meta: model = Myleavework 2014年5月12日月曜日 18時21分45秒 UTC+9 Erik Cederstrand: > > Den 12/05/2014 kl. 10.53 skrev hito koto >: > > > > Hi, > >

Re: Django create userprofile

2014-05-12 Thread hito koto
This the error is came out when edited and saved 2014年5月12日月曜日 18時21分45秒 UTC+9 Erik Cederstrand: > > Den 12/05/2014 kl. 10.53 skrev hito koto >: > > > > Hi, > > > > i have this error , why ? > > > > > > (1062, "Duplicate

Re: Django create userprofile

2014-05-12 Thread hito koto
Thank you ! I was should be set up unique=True 2014年5月12日月曜日 18時46分22秒 UTC+9 Erik Cederstrand: > > Den 12/05/2014 kl. 11.38 skrev hito koto >: > > > > Ok, Thank you! > > > > So, this is my the full codes; > > Are you sure your database is in sync with y

Django1.6 CentOS Apache static

2014-05-12 Thread hito koto
Hello, I have 3 project, CentOS Apache Django1.6 Mod_wsgi I have the following error: [Tue May 13 14:43:47 2014] [warn] The Alias directive in /etc/httpd/conf.d/wsgi.conf at line 17 will probably never match because it overlaps an earlier Alias. This is my the : /etc/httpd/conf.d/wsgi.conf

Re: Django1.6 CentOS Apache static

2014-05-13 Thread hito koto
Ok, Thank you! 2014年5月13日火曜日 17時28分07秒 UTC+9 Christian Ullrich: > > * hito koto wrote: > > > I have the following error: > > [Tue May 13 14:43:47 2014] [warn] The Alias directive in > > /etc/httpd/conf.d/wsgi.conf at line 17 will probably never match because >

Django year month day

2014-05-13 Thread hito koto
Hello, this time i have this the erroes: Please help me; Exception Type: NoReverseMatch Exception Value: Reverse for 'article.views.month year month 'prev'' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] this is my the urls.py; url(r"^month/(?P\d+)/(?

Re: Django year month day

2014-05-13 Thread hito koto
I'm also have the erroes Exception Type: NoReverseMatch Exception Value: u'article.views.main year|add' is not a registered namespace 2014年5月14日水曜日 12時19分06秒 UTC+9 hito koto: > > Hello, > > this time i have this the erroes: Please help me; > > Exceptio

Re: Django year month day

2014-05-13 Thread hito koto
Ok now working, thank you! 2014年5月14日水曜日 13時32分11秒 UTC+9 somecallitblues: > > Try instead. > > > On 14 May 2014 13:26, hito koto > wrote: > >> I'm also have the erroes >> >> Exception Type: NoReverseMatch Exception Value: >> >> u&#x

Django export CSV file of two objects

2014-05-15 Thread hito koto
Hello, I want to export file from database and from two objects; I'm use MYSQL, I have two objects: 1, attendance object: 2. get_work object: I now can export one object's datas; So, i how can export datas of two objects; My the views.py is here: def export_excel(request): response = Htt

Re: Django export CSV file of two objects

2014-05-15 Thread hito koto
tr(a,field.name)).encode("cp932")) writer.writerow(row1) return response 2014年5月15日木曜日 16時05分15秒 UTC+9 hito koto: > > Hello, > > I want to export file from database and from two objects; > > I'm use MYSQL, > > I have two objects: > 1, at

Django csv export from two objects

2014-05-16 Thread hito koto
Hello, I want to export csv from the two objects I have the erroe is here: Exception Type: AttributeError Exception Value: 'QuerySet' object has no attribute 'id' This is my the views.py : def export_excel(request): response = HttpResponse(mimetype='application/vnd.ms-excel; charset

Re: Django csv export from two objects

2014-05-16 Thread hito koto
/5/16 10:11:19 20:30 2014年5月16日金曜日 19時29分59秒 UTC+9 Daniel Roseman: > > > > On Friday, 16 May 2014 10:40:50 UTC+1, hito koto wrote: >> >> Hello, >> >> I want to export csv from the two objects >> I have the erroe is here: >> Exception Type: Attribute

Re: Django csv export from two objects

2014-05-18 Thread hito koto
ld(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, >> >&g

Re: Django csv export from two objects

2014-05-18 Thread hito koto
lea_list = leavework.objects.all() all_list = list(chain(att_list, lea_list)) for obj in all_list: row = [] for field in attendance._meta.fields, leavework._meta.fields: row.append(unicode(getattr(obj, field.name).encode("cp932"))) writer.writerow(row)

Django export the CSV file of objects form databas

2014-05-20 Thread hito koto
Hello, I have the following errors: why append is not done? AttributeError at /export_excel/ 'int' object has no attribute 'append' Request Method: GET Request URL: http://article/export_excel/ Django Version: 1.6.2 Exception Type: AttributeError Exception Value: 'int' object has no at

Re: Django export the CSV file of objects form databas

2014-05-21 Thread hito koto
Ok, thank you! 2014年5月21日水曜日 15時04分09秒 UTC+9 Erik Cederstrand: > > Den 21/05/2014 kl. 05.21 skrev hito koto >: > > > > Hello, > > > > I have the following errors: why append is not done? > > > > row = [[0 for i in range(5)] for i in range(31

Django export the CSV file from database

2014-05-21 Thread hito koto
Hello, I have the errors in the following: I don't know how can i to do ? Request Method: GET Request URL: http://articlet/export_excel/ Django Version: 1.6.2 Exception Type: AttributeError Exception Value: 'datetime.time' object has no attribute 'date' Exception Location: /var/www/

Re: Django export the CSV file from database

2014-05-21 Thread hito koto
ose_name = "time", default=datetime.now) class Meta: ordering = ["-contact_time"] def __unicode__(self): return unicode(self.user) 2014年5月22日木曜日 11時28分31秒 UTC+9 Andrew Farrell: > > So the error is somewhere here: > for att in attendance: >

Django export csv

2014-05-25 Thread hito koto
Hello, I have the errors is TypeError: 'long' object is unsubscriptable What is subscriptable? -- 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+unsub

Re: Django export csv

2014-05-25 Thread hito koto
a similar error. > > The x needs to be an integer. > > cheers > L. > > On 26 May 2014 11:50, hito koto > > wrote: > > Hello, > > I have the errors is TypeError: 'long' object is unsubscriptable > > What is subscriptable? > > >

Django queryset csv encode

2014-05-25 Thread hito koto
Hi, I want to encode in utf8 but don't know how can i to ? i have the errors is here: AttributeError: 'tuple' object has no attribute 'encode' My code is here : name = [name.encode("utf8") for name in Staff.objects.filter(id = 3).values_list('user_name')] -- You received this message becaus

Re: Django queryset csv encode

2014-05-25 Thread hito koto
'user_name', *flat=True*)] > > The other returns one-tuples in a list > > https://docs.djangoproject.com/en/dev/ref/models/querysets/#values-list > > K > > On Sunday, May 25, 2014 7:55:51 PM UTC-7, hito koto wrote: >> >> Hi, >> I want to encode

Re: Django queryset csv encode

2014-05-25 Thread hito koto
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > > >>> b'\xe5\x93\x88\xe6\x96\xaf\xe6\x9c\x9d\xe9\xad\xaf'.decode('utf8') > '哈斯朝魯' > > K &

Re: Django queryset csv encode

2014-05-25 Thread hito koto
C 4.2.1 (Apple Inc. build 5577)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> x = u'\u54c8\u65af\u671d\u9b6f' > >>> print(x) > 哈斯朝魯 > >>> import locale > >>&g

Re: Django queryset csv encode

2014-05-26 Thread hito koto
g you mentioned in your last message. Try > it. > > K > > > On Monday, May 26, 2014 2:12:14 AM UTC-7, hito koto wrote: >> >> Hi, >> >> this is output the one name, but i want to output all name, so i can't >> logic >> >>> name[0

Django get queryset year month day

2014-05-27 Thread hito koto
Hi, I want to get only year and get only month, i want to get the only : 2005 and 05-27 How can i to do? I know this : >>> Entry.objects.dates('pub_date', 'year')[datetime.date(2005, 1, 1)]>>> >>> Entry.objects.dates('pub_date', 'month')[datetime.date(2005, 2, 1), >>> datetime.date(2005, 3,

Django Python

2014-06-08 Thread hito koto
Hi, I want to change recursive definition from function, this code change to recursive definition, So how can i do to? def foo(n, m): sum = 0 while m > 0: sum = sum + n m = m -1 return sum -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Django Python

2014-06-08 Thread hito koto
t; ... return sum > > > 2014-06-08 12:19 GMT-03:00 Thiago borges dos reis >: > >> without identaction !!! >> >> def foo(n, m): >> sum = 0 >>while m > 0: >>sum = sum + n >>m = m -1 >>return sum >> &g

Re: Django Python

2014-06-08 Thread hito koto
I have a question This is why : if m >1 and why you not use 0? -- 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 p

Re: Django Python

2014-06-08 Thread hito koto
Thanks -- 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.

Django python fuction

2014-06-10 Thread hito koto
Hello, I don't know how can i do to change to write python function I want to following code change to write python function or change to write recursive definition >>> y = [10, 12, [13, [14, 9], 16], 7] >>> z = copy.deepcopy(y) >>> y [10, 12, [13, [14, 9], 16], 7] >>> z [10, 12, [13, [14, 9], 1

Django python function

2014-06-10 Thread hito koto
Hello, I don't know how can i do to change to write python function I want to following code change to write python function or change to write recursive definition >>> y = [10, 12, [13, [14, 9], 16], 7] >>> z = copy.deepcopy(y) >>> y [10, 12, [13, [14, 9], 16], 7] >>> z [10, 12, [13, [14, 9], 1

Re: Django python fuction

2014-06-10 Thread hito koto
he "elem" function? It is never accessed. > - What is the purpose of returning 1 if the argument is not a list? > - Why is it named "foo" rather than something that tells me what the > purpose of the function is? > > > On Tue, Jun 10, 2014 at 8:16 AM, hito kot

Re: Django python fuction

2014-06-10 Thread hito koto
t; return 1 > > And take this to a python list, this is for django. > > Cheers > > François > > > On Jun 10, 2014, at 9:43 AM, hito koto > > wrote: > > > hi, > > > > I have this erroes: > > > >

Re: Re: Django python fuction

2014-06-10 Thread hito koto
Hi, Qiancong : I was looking for exactly this、 Thank you ver much! 2014年6月10日火曜日 23時35分52秒 UTC+9 Qiancong: > >  > Hi, hito koto: > I think you want to deep copy the list. The following code maybe helpful: > def dcopy(obj): > if not isinstance(obj, list): &g

Re: Re: Django python fuction

2014-06-11 Thread hito koto
Thanks 2014年6月11日水曜日 10時37分43秒 UTC+9 Qiancong: > >  > Yeah, I think hito koto need a function like copy.deepcopy.. I think he > known copy.deepcopy before(as his example said), just not known how to > write a funtion work as copy.deecop

Django Python roop

2014-06-11 Thread hito koto
Hello, all I want to change to while statement from for statement, so how can i do to? this is my correct for statement codes: def fff(x): y = [] for i in range(len(x)): y.append(x[i]) return y and i want change to while statement So, this code have erroes: TypeError: list

Re: Django python fuction

2014-06-11 Thread hito koto
hi, François : Thanks 2014年6月11日水曜日 1時22分04秒 UTC+9 François Schiettecatte: > > Wouldn't the deep copy module handle this for you: > > https://docs.python.org/2/library/copy.html > > François > > On Jun 10, 2014, at 12:17 PM, hito koto > > wrote: &g

Re: Django Python roop

2014-06-11 Thread hito koto
(len(x)): y.append(x[i]) return y 2014年6月11日水曜日 20時21分42秒 UTC+9 hito koto: > > Hello, all > > I want to change to while statement from for statement, so how can i do > to? > > this is my correct for statement codes: > > def fff(x): >

Re: Django Python roop

2014-06-11 Thread hito koto
hi, Ilya Kazakevich: I would like to change the while statement from the for statement 2014年6月11日水曜日 21時49分32秒 UTC+9 hito koto: > > MemoryError , Why? idon't know. > I try this have Traceback (most recent call last): > File "", line 1, in > File "&qu

Re: Django Python roop

2014-06-11 Thread hito koto
Hi, qiancong: Thank you, Do you not use the while statement to Django? 2014年6月11日水曜日 21時52分54秒 UTC+9 Qiancong: > >  > Hi, hito koto: > I think the problems you asked should be post in python-lang mail-list. > For python program, I prefer "for", not "while&q

Re: Django Python roop

2014-06-11 Thread hito koto
Ok, thank you! 2014年6月11日水曜日 21時52分54秒 UTC+9 Qiancong: > >  > Hi, hito koto: > I think the problems you asked should be post in python-lang mail-list. > For python program, I prefer "for", not "while"; It's more simpler. > But if you like whil