Fail to create Django registration form with email and password only

2018-08-19 Thread Yan Cheng Cheok
Creating basic registration/ authentication in Django is insanely hard. After many tries, I manage to create basic registration/ authentication in Django using username and password. [image: enter image description here] The code is shown in

Supervisor FATAl Exited too quickly (process log may have details(About inet_http_server and unix_http_server)

2017-09-09 Thread Jonathan Cheng
I wrote a Django project and I use supervisor with gunicorn /etc/supervisor/conf.d/weather.conf [group:weather_station] programs=site [program:site] directory=$PROJECT command=/home/nhcc/.local/bin/gunicorn -c /$PROJECT/weather_station/ gunicorn.conf.py -p

Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread Jonathan Cheng
I use Python3.5.2 Django1.9 I use `python -m venv venv/weather_station` to create virtual evnironment (/home/user/venv) This is my project tree in Ubuntu /home/user/myproject: (`export project=/home/user/myproject`) myproject | ├── gunicorn.conf.py ├── static │ ├── admin

Cannot access imported functions in django shell by pipeline command

2017-08-24 Thread Cheng-Hung Hsueh
It is a python script `tshi3.py` : 在此輸入代碼... import csv def li2ho2(): print(csv) li2ho2() I copied this code and pasted it in `python manage.py shell`. It works. But I ran `python manage.py shell < tshi3.py`. Got `NameError: name 'csv' is not defined.` Why?

Help: Data model in django

2017-03-09 Thread Ricken Cheng
Hi: I am a beginner using django, I want to build a flexible data model like this: Item_ID AttributeValue 1 Attr1 V1 1 Attr2 V2 2 Attr1 V3 2 Attr2 V4 1

Heroku push failed

2017-02-05 Thread Jonathan Cheng
In Win10 when i run "git push heroku master" the traceback showed: "python manage.py collectstatic" ,the python file ImportError: No module named 'markdown_deux' but i have installed the django-markdown-deux why i met this traceback?

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
8時43分17秒寫道: > > On 16/09/2016 1:10 AM, Jonathan Cheng wrote: > > thx your code,though i cant run it in cmd > That is correct. It is designed to be imported and called from > settings.py. > > I'll send you a screenshot off-line > > Mike > > > > --

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
ng it every time I looked at the dev-server > output helped a lot. > > Comments in announce.py show how to use it. > > Good luck > > Mike > > On 12/09/2016 1:58 AM, Jonathan Cheng wrote: > > thx reply,but it just can see the original html with no css,is my path &

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx everyone,all bugs were fixed early. Jonathan Cheng於 2016年9月11日星期日 UTC+8下午10時59分56秒寫道: > > I use django1.10 > > i reference the official doc > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ > > my project name:mysite > >

Re: django.db.utils.OperationalError when remove the parent model

2016-09-13 Thread Cheng-Hung Hsueh
I tyied with some new filed in model B. class A(models.Model): data = models.CharField(max_length=30) class B(A): data2 = models.CharField(max_length=30) to class A(models.Model): data = models.CharField(max_length=30) class B(models.Model): data2 =

Re: django.db.utils.OperationalError when remove the parent model

2016-09-13 Thread Cheng-Hung Hsueh
The sample project: https://github.com/sih4sing5hong5/django_migration_error -- 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.db.utils.OperationalError when remove the parent model

2016-09-13 Thread Cheng-Hung Hsueh
My original models like this class A(models.Model): data = models.CharField(max_length=30) class B(models.Model): pass Make migrations, then I modified the artitecture class A(models.Model): data = models.CharField(max_length=30) class B(models.Model): pass Make migration and

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
1 19:15 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com > >: > >> i fixed usint STATIC_ROOD = '/static/' >> it seems to no error >> but when i connect to my runserver >> the css of assets just doesn't work >> >> >> Jonathan Cheng於 2016年9月12日星期一 UTC+8

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
1 19:15 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com > >: > >> i fixed usint STATIC_ROOD = '/static/' >> it seems to no error >> but when i connect to my runserver >> the css of assets just doesn't work >> >> >> Jonathan Cheng於 2016年9月12日星期一 UTC+8

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i use href="{% static '/assets/css/main.css' %}" and it worked but if i want to use the all files in static is there any way to do? ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道: > > If you look at the html send by django, what is the href value ? > > 2016-09-11 19:15 GM

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
i fixed usint STATIC_ROOD = '/static/' it seems to no error but when i connect to my runserver the css of assets just doesn't work Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道: > > here i explain , because i just test how main.css work, finally i want to > use the assets a

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
> your settings.py you wrote "STATIC_ROOT='/mysite/static/'" which says > that static should be subdirectory of mysite which its not a subdirectory > its in a same directory of mysite > > > On Sunday, September 11, 2016 at 8:48:57 PM UTC+4:30, Jonat

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
all static file and copy them in a > single directory. > > 2016-09-11 18:18 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com > >: > > > > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 > > > > ludovic coues於 2016年9月12日星期一 UTC+8上午12時0

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
//paste2.org/ or https://gist.github.com/ to share > it > > 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com > >: > > thx reply,but it just can see the original html with no css,is my path > > setted correct? > > > > ludovic coues於 2016年9

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
d } in the load > staticfiles tag > > 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com > >: > > I use django1.10 > > > > i reference the official doc > > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ > > >

Import css in Django

2016-09-11 Thread Jonathan Cheng
I use django1.10 i reference the official doc https://docs.djangoproject.com/en/1.10/intro/tutorial06/ my project name:mysite structure: - mysite- - mysite - urls.py -views.py ... - templates -

Re: The related_name of ForeignKey cannot be Unicode name after Django 1.8

2015-06-22 Thread Cheng-Hung Hsueh
gt; > On Monday, June 22, 2015 at 11:28:50 AM UTC-4, Cheng-Hung Hsueh wrote: >> >> This code can run before django 1.7 >> But "related_name" got an error after django 1.8 >> >> 使用者表.來源: (fields.E306) The name '使用者' is invalid related_name for fi

The related_name of ForeignKey cannot be Unicode name after Django 1.8

2015-06-22 Thread Cheng-Hung Hsueh
This code can run before django 1.7 But "related_name" got an error after django 1.8 使用者表.來源: (fields.E306) The name '使用者' is invalid related_name for field 使用者表.來源 class 來源表(models.Model): 名 = models.CharField(max_length=100) class 使用者表(models.Model): 來源 = models.OneToOneField(來源表,

Re: Django formset hidden id field

2015-05-27 Thread Cheng Guo
Cheers > Matthias > > 2015-05-27 15:47 GMT+02:00 Cheng Guo <chen...@gmail.com >: > >> Hello, >> >> I have a formset and when I render it, Django would include this line in >> the HTML: >> >> >> >> I am curious what is the pu

Django formset hidden id field

2015-05-27 Thread Cheng Guo
Hello, I have a formset and when I render it, Django would include this line in the HTML: I am curious what is the purpose of having an id field here. I mean in what situation would you use it. I did look through Django's documentation on formset

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Thank you Daniel, I didn't know this! I am going to lookup how to use session. Thanks! On Monday, 19 January 2015 17:13:10 UTC+8, Daniel Roseman wrote: > > On Monday, 19 January 2015 07:28:14 UTC, Cheng Guo wrote: >> >> Hello, >> >> I am new to Django and I have r

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
h shouldn't be calculated external to the file that is > attached to the object, it should be calculated by the object itself. > > Hope that helps and makes sense... > > -James > > > On Jan 19, 2015 12:37 AM, "Cheng Guo" <chen...@gmail.com > > wrote

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
s way you can save the > object from any view (or from the shell), and it would always generate a > new hash automagically (new meaning recalculated, may end up the same as > the previous value). > > TL;DR; The hash shouldn't be calculated external to the file that is > attached to t

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
gt; wrote: > >> On 19/01/2015 6:28 PM, Cheng Guo wrote: >> > Hello, >> > >> > I am new to Django and I have run into an issue with views.py. I >> > understand that there is a function behind each view. For a view that I >> > am currently writing

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, thanks! On Monday, 19 January 2015 15:46:40 UTC+8, Mike Dewhirst wrote: > > On 19/01/2015 6:28 PM, Cheng Guo wrote: > > Hello, > > > > I am new to Django and I have run into an issue with views.py. I > > understand that there is a function behind each v

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, 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

Newbie question: How to avoid a very long view function?

2015-01-18 Thread Cheng Guo
Hello, I am new to Django and I have run into an issue with views.py. I understand that there is a function behind each view. For a view that I am currently writing, it accepts a file upload from user and stores the file on the server. To do that, I need to: 1. check the file extension is

Re: Unicode character in Django project path

2015-01-18 Thread Cheng Guo
ing/decoding that in not aware of. > > Search through https://code.djangoproject.com/search and see if another > ticket already exists. > > -James > On Jan 18, 2015 7:05 PM, "Cheng Guo" <chen...@gmail.com > > wrote: > >> Hello everyone, >> >&g

Unicode character in Django project path

2015-01-18 Thread Cheng Guo
Hello everyone, I am new to this community. I have run into an issue related to Unicode character in project path: http://stackoverflow.com/questions/27996774/unicode-character-in-django-project-path Another user on StackOverflow provided a detailed analysis of what is causing the bug in the

Re: pattern validation in QueryDict.get()

2013-06-04 Thread CHI Cheng
Seems it should be '^\d+$'. Nobody likes this idea? Should I submit a ticket and pull request? On Saturday, June 1, 2013 9:48:17 PM UTC+10, CHI Cheng wrote: > > In url.py, we could use regex to limit string patterns. > > Is there anything similar for QueryDict.get()? > >

pattern validation in QueryDict.get()

2013-06-01 Thread CHI Cheng
In url.py, we could use regex to limit string patterns. Is there anything similar for QueryDict.get()? e.g. given q = request.GET.get(key='q', default=10, *pattern=r'\d+'*) # new parameter pattern If value of q in //*path?q=xxx* does not match the pattern, then give default value. -- Chi

Re: send_mail on MAC OS X 10.7

2012-10-03 Thread Cheng
Hi Kobe, I am not familiar with the Mac's setup. Do you mean the Mac's Mail application? If so, yes. If not, how do I start the sendmail program? Thanks, Cheng On Wednesday, October 3, 2012 1:37:45 AM UTC-7, Kolbe wrote: > > did you start the sendmail program? > > On Tuesday, Oct

Re: send_mail on MAC OS X 10.7

2012-10-03 Thread Cheng
is imap.googlemail.com. Thanks, Cheng On Tuesday, October 2, 2012 9:45:17 AM UTC-7, Dennis Lee Bieber wrote: > > On Tue, 2 Oct 2012 07:25:39 -0700 (PDT), Cheng > <chb...@googlemail.com> > > declaimed the following in gmane.comp.python.django.user: > > > > > I

Re: send_mail on MAC OS X 10.7

2012-10-02 Thread Cheng
Hi Laxmikant, Do you mean this statement (I can't find any other that refers to csrf) in settings 'django.middleware.csrf.CsrfViewMiddleware', I commented it, but it still gives me error 61 - Connection refused. Thanks, Cheng Hong On Monday, October 1, 2012 10:36:43 PM UTC-7, Laxmikant

send_mail on MAC OS X 10.7

2012-10-01 Thread Cheng
after that. Would be grateful if someone can help. Thanks, Cheng -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/r40DN0e3ybAJ. To post to this g

Re: Various thoughts on authentication, registration and social logins

2012-06-18 Thread Ien Cheng
Mattias, It may be worth checking out django-allauth. It doesn't use the flow you are proposing -- as register-by-email users do need to enter a password -- but it has an nicely integrated one-click login via Facebook/Google/etc. alternative option for users. I haven't tried, as I like the

Re: Keep getting TemplateDoesNotExist when unit testing

2012-03-03 Thread Calvin Cheng
Hi Jonas, I am having exactly the same problem in one of my projects and I am not sure why. Did you manage to solve it in the end? Would appreciate it if you could share with me your solution if you did. Regards, Calvin On Saturday, December 24, 2011 10:51:27 PM UTC+8, jonas wrote: > >

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
> On Jun 29, 4:01 pm, Stephen Cheng <stephenchengm...@gmail.com> wrote: > > > Yes, I check thecookievalue in view or in middleware class. > > > Just give example, eg, I want the browser to remember online user's > > city, so next time when they typewww.mydomain.com, it

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
ies are sent only when the request reaches > the server. > > -- Raja > > On Jun 29, 9:21 am, Stephen Cheng <stephenchengm...@gmail.com> wrote: > > > Hi > > > I am facing a problem in DEV server that I really have no idea how to > > resolve, which

Why file path and name disappear for Image Field when/after validation

2009-05-23 Thread Stephen Cheng
I suppose that all the fields' value in the form defined in model can be captured and remained when/after you do form validation. My problem is that : 1. When the form is not valid, the filename of image field is gone once you click submit or 2. If I intend to do something else once all fields

Re: Pass context vars to django-registration

2009-05-08 Thread Stephen Cheng
No bother, I have found the solution. Simply use the ContextProcessor. On May 7, 10:27 pm, Stephen Cheng <stephenchengm...@gmail.com> wrote: > I have got a case like this: I have a drop down list of value of 8 > cities which requires a db query every time when every page loads. T

Admin page with my own themes/skins

2009-05-07 Thread Stephen Cheng
I have thought this for quite a while and no idea so far. I like the forms/pages auto generated by Admin engine, but I also want to incorporate some of the forms/pages into my site with following expectations: 1. I can use my own template. 2. use my own template and also use the context

Pass context vars to django-registration

2009-05-07 Thread Stephen Cheng
I have got a case like this: I have a drop down list of value of 8 cities which requires a db query every time when every page loads. The problem is when the url is diverted to django-registration module, then I don't know how to properly pass the citylist as a context value to

distinct for ForeignKey field

2008-10-11 Thread Stephen Cheng
I am wondering how to get distinct values for a ForeignKey field For example: class ModelA(models.Model): . city=models.ForeignKey(City) I understand that I can pass the list to template than probably use regroup and get the group values, but is there a

Re: form submission problem

2008-10-10 Thread Stephen Cheng
Sorry about the silly question. This is resolved. All are documented: http://docs.djangoproject.com/en/dev/ref/forms/validation/#using-validation-in-practice Thanks for your help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: form submission problem

2008-10-09 Thread Stephen Cheng
price))+len(self.clean_title())> 10: raise forms.ValidationError("The length of title plus price should be less than 10 characters") return price class Meta: model=Card On Oct 9, 10:26 pm, Malcolm Tredinnick <[EMAIL PROTECTE

form submission problem

2008-10-09 Thread Stephen Cheng
I defined a field title in model the max length is 30 title=models.CharField("Title",max_length=30) while after I key in none - english characters, eg, Chinese and submit the form, it [database] can only take 10 Chinese characters,otherwise raise an exception. I also use an validation rule in

varible reference in template problem

2008-10-06 Thread Stephen Cheng
Hi django friends I got a problem with varible reference in template. the case is like this: I pass a map to a template, I am trying to get map[key], in the case the key= modelA.id, then I have to use map.modelA.id, then it won't work. How can I conquer this? Can I assign modelA.id to another

Re: Strange:Dev Web server crash with a python.core dump after Admin page being refreshed exactly 16 times

2008-06-01 Thread Stephen Cheng
the process, it's just working fine now :) Hope this help some others. On Jun 2, 12:32 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sun, Jun 1, 2008 at 2:41 AM, Stephen Cheng <[EMAIL PROTECTED]> > wrote: > > > > > > > Hi Guys > > > Thi

How to handle asian language?

2008-06-01 Thread Stephen Cheng
I got exception in admin page when I input chinese character into one field and try to save to db. I am not sure which lib I should install to make it work or any configure I should enable. Any advice? UnicodeEncodeError at /admin/books/author/add/ 'ascii' codec can't encode characters in

Strange:Dev Web server crash with a python.core dump after Admin page being refreshed exactly 16 times

2008-06-01 Thread Stephen Cheng
Hi Guys This is a very strange problem and I haven't resolved it. Dev Web server just crash with a python.core dump and no exception log at all. Problem occurs when you go around the Admin page, either refresh page, add record, delete record. Now I can reproduce it by keeping refresh the admin

Re: High Load

2006-12-08 Thread Cheng Zhang
running on Gentoo 2006.1, Postgres 8.1.5, Lighttpd w/ scgi. The speed to the site is visually slow. [1] http://www.linode.com/products/linodes.cfm -Cheng Zhang Gentoo/PostgreSQL/Lighttpd/Python/Django/jQuery Powered (Web) http://www.aragonconsultinggroup.com http://www.ifaxian.com 1st Django powered

Re: looking for Django Contractors

2006-11-01 Thread Cheng Zhang
ment manager located in San Francisco, California and engineering team in Beijing, China, we can discuss more. BR, -Cheng Zhang Gentoo/Python/Django Powered http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese --~--~-~--

Re: How to auto create a from Model just the Admin do?

2006-10-30 Thread Cheng Zhang
the default language of this m-list, please try not to have Chinese characters within your post, that might confuse other non-Chinese speaking participants. Thanks. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django po

Re: Django & Movable Python

2006-10-25 Thread Cheng Zhang
; also play with it. Hell, we can even make a small project "Django on a > stick" and spread that nice warm feeling called Django to the rest of > the world :) > > Ideas? Suggestions? Cool idea, +1! Please get something started soon. -Cheng Zhang http://www.ifaxian.com 1st Dj

Re: Dojo vs Mochikit for Django dev?

2006-10-17 Thread Cheng Zhang
tml [3] http://visualjquery.com/ -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: Mac vs. PC for Django work.

2006-09-15 Thread Cheng Zhang
on infrastructure open-source software like GCC, the same set of app will run faster on the same set of hardware. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese On Sep 14, 2006, at 1:13 AM, Tyson Tate wrote

Re: Mac vs. PC for Django work.

2006-09-15 Thread Cheng Zhang
r experience, lighttpd + scgi is much better than that. Again, pick what is the most comfortable one is always our guideline. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered sit

Re: generic ModifiedPreorderTreeTraversal app

2006-07-26 Thread Cheng Zhang
Great. If you get time, I suggest you update the wiki page accordingly. - Cheng Zhang On Jul 27, 2006, at 12:05 PM, nkeric wrote: > hi all, > > Base upon Julio's mptt-0.9 which handles nested contents: > > http://code.djangoproject.com/wiki/ModifiedPreorderTreeTraversal >

Re: [Changeset] r3455 - django/trunk/docs

2006-07-26 Thread Cheng Zhang
Adrian Would you mind to point out which OSCON presentation it is? Just curious. Thanks. - Cheng Zhang On Jul 27, 2006, at 8:46 AM, [EMAIL PROTECTED] wrote: > > Author: adrian > Date: 2006-07-26 19:46:32 -0500 (Wed, 26 Jul 2006) > New Revision: 3455 > > Modified: >

Re: New - monkey

2006-07-23 Thread Cheng Zhang
Of 'coz you can download everything needed on your windows box, then transfer over. - Cheng On Jul 21, 2006, at 7:59 PM, Rajeshwar Singh Jenwar wrote: > Hi ALL, > I m new to Django. > My linux box does not have net connection. > Can someone suggest me how to intsall Djang

IOError: Client read error (Timeout?)

2006-07-03 Thread Qi Cheng
Hi, guys. This is a problem that troubled me for months, but maybe it is very easy to you. I guess it is an problem that has something relation with mod-python or cookie, but I am not sure. Since many corresponding softwares I use, between our production and develope server, are the same except

Re: non mod-python deployment...any experiences? (dedicated server)

2006-05-02 Thread Cheng Zhang
Apache + mod_python IMHO. Hugo's Django scgi page (https://simon.bofh.ms/cgi-bin/trac-django- projects.cgi/wiki/DjangoScgi) helps a lot. We are not a high-traffic site yet, but so far, such setup has been very stable. - Cheng Zhang http://www.ifaxian.com --~--~-~--~~~---~--~---

Re: non mod-python deployment...any experiences? (dedicated server)

2006-05-02 Thread Cheng Zhang
That blog is in Russian. ;-) On May 2, 2006, at 9:49 PM, Dmitry Medvedev wrote: > about nginx ( http://nginx.org/ ) - this web server is similiar to > lighttpd and i think results won't really differ a lot. I took > django+nginx instructions from Igor Goryachev's blog ( > http://goryachev.org/

Re: ANN: magic-removal branch merged to trunk

2006-05-01 Thread Cheng Zhang
eports and other help in this > branch. Special thanks go to the magic-removal committers, Joseph > Kocherans, Russell Keith-Magee and Luke Plant. We are also busy in converting our code base for http:// www.ifaxian.com to use new API lately. :-) Cheers! -

[M-R] order by on custom SELECT column

2006-05-01 Thread Cheng Zhang
purpose. BR, - Cheng --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-30 Thread Cheng Zhang
On Apr 30, 2006, at 1:31 PM, Ivan Sagalaev wrote: > > Cheng Zhang wrote: > >> I tried lookup like Article.objects.filter(id__in = []), which will >> have SQL statement whose where clause is something like 'WHERE >> ("poll_article"."id"

[M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-29 Thread Cheng Zhang
th code like: if len(id_list) > 0: Article.objects.filter(id__in = id_list) else: Article.objects.filter(id__isnull = True) Should this problem be deal with on the Django framework level, instead of application level? BR, - Cheng --~--~-~--~~~---~--~~ Yo

Too many SQLs in change_list pages

2006-04-03 Thread Qi Cheng
Hi, guys I have been troubled by a problem for weeks, this maybe very easy for you guys. It is about the "list_display" in ADMIN of models, say ModelA. If I add a method in list_dispaly(not a field) , which will access other models data, say ModelB. Then when I acess the modelA's change_list

Re: Django API doc

2006-03-23 Thread Cheng Zhang
Very useful. Thanks. On Mar 23, 2006, at 4:28 AM, Daniel Poelzleithner wrote: > > Hi, > > i created a css to build a django styled API doc with epydoc. > > http://djangoapi.quamquam.org/ Beta Version :) > > I hope we can integrate it as http://api.djangoproject.com someday. > > kindly regards >

Re: caching questions

2006-03-01 Thread Cheng Zhang
check it out, it might be useful for you, although I didn't have chance to use it yet. Cheers - Cheng Zhang --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Class in views.py

2006-02-27 Thread Cheng Zhang
? Nope AFAIK. Why don't you show the errors you got? It will be easier for others to figure out why. - Cheng --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: recursive template calls

2006-02-07 Thread Cheng Zhang
Please search the previous email archive for discussion on such topic like "tree view". In fact, there is a wiki page for an implementation as well. On Feb 8, 2006, at 11:31 AM, Shannon -jj Behrens wrote: Hi, I'm trying to build ye ol' bulletin board application to try out Django. I'm

Re: Django and MS SQL

2006-01-21 Thread Cheng Zhang
Ok, the patch is away [http://code.djangoproject.com/ticket/1258]. :-) - Cheng Zhang

Re: Django and MS SQL

2006-01-20 Thread Cheng Zhang
x/UNIX to connect to SQL Server since it's only works on Linux/UNIX. - Cheng

Re: Django and MS SQL

2006-01-20 Thread Cheng Zhang
Actually that's incorrect. Pymssql is only a thin wrapper around FreeTDS library (http://www.freetds.org/). AFAIK, FreeTDS works with SQL-Server 2000 pretty well. - Cheng On Jan 13, 2006, at 12:15 AM, Rich Bakos wrote: Jeroen Ruigrok van der Werven wrote: Hi Jeroen, Can a bunch of us

Re: multiple levels of join

2006-01-12 Thread Cheng Zhang
On Jan 12, 2006, at 5:38 AM, Adrian Holovaty wrote: On 1/11/06, Cheng Zhang <[EMAIL PROTECTED]> wrote: class Entry(meta.Model): submission_user = meta.ForeignKey(users.User) class Friend(meta.Model): myself = meta.ForeignKey(users.User, related_name="myself&quo

multiple levels of join

2006-01-11 Thread Cheng Zhang
nd = meta.ForeignKey(users.User, related_name="friend", verbose_name="friend") How may I get a list of entry whose submission_user is in my friend list, which is myself == my_id? After looking at db api doc for hours, I just can't figure it out. Thanks for any advice. - Cheng

Re: Could django filters be used in its models instead of templates ?

2006-01-10 Thread Qi Cheng
sorry. I have got it resolved. Seems i was in a totally wrong direction. please ignore this question.

Could django filters be used in its models instead of templates ?

2006-01-10 Thread Qi Cheng
Hi I am implementing such a function. I have a textarea that will be inputted many characters, when they are showed in page, they will be displayed in one line, very ugly.So I want to change the '\n' in the texts to ''. I know this can be implemented by wysiwig editor(e.g. tiny_mce), and I

Re: Django and MS SQL

2006-01-10 Thread Cheng Zhang
ailing list couple months ago but didn't have time to work more on it. The reason for picking pymssql over ado-mysql is that we'd like to run Django on Linux instead of Windows. Anyway, at this point I am kind of walking in the dark, since MS-SQL is a new territory to me. - Cheng

Re: best practices for translating content

2006-01-10 Thread Cheng Zhang
We discussed a bit about this topic in our project as well. Surely that's one way to do it, or maybe the only practical way we could come up with. But the problem is once you support more than 2 languages, keeping schema in sync will become a headache and definitely not DRY. - Cheng

Re: models can't use globals

2006-01-10 Thread Cheng Zhang
e moved to the top of the file from django.models import get_module mod = get_module('portal', 'friends') try: f = mod.get_object(myself__id__exact=friend.get_friend().id, friend__id__exact=friend.get_myself().id) except (KeyError, mod.FriendDoesNotExist): return False

Re: Additional User Data?

2006-01-03 Thread Cheng Zhang
( list_display = ('user', 'location', 'website',), ) I don't need to specifying 'ordering' parameter for admin, just FYI. - Cheng On Jan 3, 2006, at 11:44 PM, Adrian Holovaty wrote: On 12/31/05, Andreas Neumeier <[EMAIL PROTECTED]> wrote: But when I try to use the admin int

Re: Modeling a category entity which has parent-child structure

2005-12-13 Thread Cheng Zhang
On Dec 13, 2005, at 10:53 PM, Alex Bondarenko wrote: On 12/13/05, Cheng Zhang <[EMAIL PROTECTED]> wrote: I am trying to model a category entity which has parent-child structure. My model is: ... If parent is as same as child, this is considered as top-level Maybe just use "par

Re: [NOOB] ImportError: No module named django.core

2005-12-13 Thread Cheng Zhang
On Dec 13, 2005, at 9:43 PM, patrick kranzlmüller wrote: i just wanted to create a new app using django-admin.py startapp manage and i get the error ImportError: No module named django.core by the way, i already created an app last week, which worked fine. patrick This is due to old

Re: Which user posted the blog entry.

2005-12-12 Thread Cheng Zhang
ntry? Can that info be gotten by who was logged in and made that post? Of 'coz, for example you can use author = meta.ForeignKey(users.User) for your purpose. - Cheng

Re: replaces_module

2005-11-29 Thread Cheng Zhang
please elaborate this new meta option 'replaces_module', which I couldn't find in the doc? Thanks. - Cheng

Re: Django job in Dallas, Texas

2005-11-22 Thread Cheng Zhang
. - Cheng On Nov 22, 2005, at 11:54 PM, Adrian Holovaty wrote: I spotted this on the Dallas craigslist: """ Pegasus News is looking for a Python programmer -- better yet for you and us if you're versed in Django -- to help with some light programming/tweaking on pre-existing content ma

Re: How do I specify default value for a form field while using manipulator

2005-11-22 Thread Cheng Zhang
Thanks. Guess I should get the habit of searching wiki, esp. the cookbook. On Nov 22, 2005, at 9:21 PM, Grigory Fateyev wrote: http://code.djangoproject.com/wiki/CookBookManipulators there are two ways to do this stuff.

OODB with Django? Was Re: ZODB Anyone ?

2005-11-20 Thread Cheng Zhang
in the deployment phase. - Cheng On Nov 20, 2005, at 7:22 PM, mario ruggier wrote: One of these is the moellus package, that is a layer on top of the small Durus OODB (that is a ZODB-inspired OODB, but intentionally simpler), that organizes items (objects) in containers (tables

Re: ZODB Anyone ?

2005-11-20 Thread Cheng Zhang
I am curious to learn more about why "object DBs are not good fit for the MVC-like separation". Previously I had very basic exposure to ZODB, along with the concept of object database, when I played with Zope a bit years ago. Thanks. - Cheng On Nov 20, 2005, at 1:12 PM, Tom T