Re: Can't submit picture through generic view form

2012-05-19 Thread Jian Chang
Your form need a attribute named enctype, and the value is multipart/form-data, try it. 在 2012-5-19 晚上10:55,"Michael Ackerman" 写道: > > I have a generic view: > > class create_ticket(CreateView): > model = ticket > form_class = ticket_form > template_name = "create_ticket.html" > suc

Re: login or login_decorator issue

2012-08-08 Thread Jian Chang
what's your '@login_required(login_url='/login/')'? seems like the decorator leads to the redirection. 2012/8/8 mapapage > for the login I do (username must be the id field(pk) of an 'owners' > table and password is a field of the same table): > > def login_user(request): > c = {} > c

Re: Separate file stream from request input stream while upload

2012-08-08 Thread Jian Chang
是不是可以用异步来完成? ajax upload 2012/8/8 Russell Keith-Magee > On Wed, Aug 8, 2012 at 2:42 PM, 春燕 李 wrote: > > Thanks ! > > > > In my application, I want to upload image files(such as *.iso) which > > are always large, it will take long time before the uploading > > completed. During this time, I can

Re: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread Jian Chang
"d:/wwwroot/djtest/djtest/" was already in system path, so I think you should set DJANGO_SETTINGS_MODULE like this: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") try it![?][?][?] 2012/9/11 DJ-Tom > Am Dienstag, 11. September 2012 00:43:44 UTC+2 schrieb Mike Dewhirst: > >> >> Try d

Re: authentication in django

2011-08-28 Thread Jian Chang
decorator? 2011/8/27 NISA BALAKRISHNAN > Hi, > > I am new to django. > i am making a django app for a logged in user to add movies he > watched. > > how can i block a logged in user from accessing the log in form ? > the url .../accounts/login > > -- > You received this message because you are s

Re: Wired image file upload problem

2011-09-29 Thread Jian Chang
size limitation? it is wired. [?] 2011/9/28 @@ > Hi > I got a image can't upload while other image works fine, and i use paint > open this image and save it as another file, then the other file can be > uploaded. > The debug page shows the request.FILES is None. > The attachment is the image can

Re: can't get STATICFILES to work (Django dev version)

2011-10-01 Thread Jian Chang
Did you set Debug=False? 在 2011-9-27 上午4:21,"nara" 写道: > I am having trouble getting STATICFILES to work. I have read the docs, > and followed the instructions, but I never get my css files to load. > My current workaround is to put all the css inline in my template > file, but that should not be a

Re: Multiple forms with same name.

2011-10-01 Thread Jian Chang
Fisrt,it's not multiple forms as your description. You can use request.GET.getlist('text','') to get the every text in one list 在 2011-9-26 下午11:34,"sakthi" 写道: > In a page i made multiple text forms with the same name. i cannot get > the values of all the forms. only the last form's value is avail

Re: Multiple forms with same name.

2011-10-01 Thread Jian Chang
request.GET.getlist('txt','') sorry! 在 2011-10-2 上午4:37,"Jian Chang" 写道: > Fisrt,it's not multiple forms as your description. > You can use request.GET.getlist('text','') to get the every text in one list > 在 2011-9-26 下午11:34,"s

Re: Problem with get_absolute_url

2011-11-17 Thread Jian Chang
yes, you need the decorator @models.permalink 2011/11/15 Rubén Dugo Martín > You forget the decorator: > > @models.permalink > def get_absolute_url(self): > return ('blog_post_detail', None, { >'year': self.publish.year, >'month': self.publish.strftime('%b').lower(), >

Re: Cache timeout

2011-11-30 Thread Jian Chang
u can test by yourself. yes, i don't know the answer, neather 在 2011-11-27 上午12:08,"Addy Yeow" 写道: > If I use cache_page() decorator for my view function, will the TIMEOUT be > able to take precedence over CACHE_MIDDLEWARE_SECONDS? > > In my settings.py, > > CACHES = { > 'default': { >

Re: OnChange or OnBlur event in javascript to run python function in Django and return the results???

2012-12-13 Thread Jian Chang
Yes, you need ajax 在 2012-12-13 中午12:29,"Mario Gudelj" 写道: > > Hey, > > First you need to add some id to that field and then use a jQuery selector to get the value from it on blur or input: > > $('#some_id).on("blur", function(){ >//make your ajax call here > }); > > To make the Ajax call you c

Re: only utf-8 letters regex pattern

2013-01-16 Thread Jian Chang
you can use unicode. 2013/1/16 armagan > Turkish chars -- 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 django-users+unsubscr...

Re: Database Transaction

2013-01-21 Thread Jian Chang
you mean two different databases? you can't do the transaction between two different databases. Anyway you can control the transactions by yourself. like: commit all or rollback all if all actions are ok or not, 2013/1/21 Sandeep kaur > Hello Django users, > I have created a django application w

Re: Goodbye, Malcolm

2013-03-20 Thread Jian Chang
Rest in peace 2013/3/21 Ernest Mundia > M.H.S.R.I.P > > > On Wed, Mar 20, 2013 at 6:16 PM, Javi Romero wrote: > >> El martes, 19 de marzo de 2013 18:01:39 UTC+1, Jacob Kaplan-Moss escribió: >> >> Hello fellow Djangonauts, >>> >>> We have difficult news: Malcolm Tredinnick has passed away. >>> >>

Re: PostgresSQL or MySql with django?

2013-03-20 Thread Jian Chang
postgres! do what you like 2013/3/18 frocco > Hello, > > What is the recommended database for django? > > I have used MySQL, but am interested in Postgres. > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from

Re: need help with calling following complex query

2011-07-10 Thread Jian Chang
Using raw sql is a better idea 2011/7/11 Jonas Geiregat > > > In order to find the places in near by area I want to make following > mysql query. but I am not sure how should I translate it using django > models and managers. > > > You could execute the raw sql query string, see: > https://docs.

Re: something about django mysql database long connection

2011-07-13 Thread Jian Chang
Try DBUtils http://www.webwareforpython.org/DBUtils/Docs/UsersGuide.html 2011/7/13 Kejun He > hi, > I am sorry. My English is very bad. > > Yes, i want to make persistent databases connection on each session. > > > and yesterday i try to modify the code on > "site-packages\django\db\__init__.py

Re: blog breack after 10 post x__x

2011-07-15 Thread Jian Chang
django doesn't have, but you can extent based on django.core.paginator.Paginator.The attachment is what i use, you can change it by your needs 2011/7/16 Kase > realy i dont know how to expres this.. > > i need this > (is a blog app) > > 1) post > 2)post > 3)post > ... > 10)post > page 1,2,3,4

Re: blog breack after 10 post x__x

2011-07-15 Thread Jian Chang
2011/7/16 Jian Chang > django doesn't have, > but you can extent based on django.core.paginator.Paginator.The attachment > is what i use, you can change it by your needs > > > > > 2011/7/16 Kase > >> realy i dont know how to expres this.. >> >>

Re: django.core.urlresolvers.reverse capturing group before include behavior

2011-07-15 Thread Jian Chang
try this: reverse("mysites.views.index") 2011/7/16 Squeesh > I have run into an issue using reverse() to lookup named urls with > capturing groups before an include(). > > Code: > > mysite/urls.py > from django.conf.urls.defaults import * > > urlpatterns = patterns('', >url(r

Re: Is there a way to insert data from a csv file into my database?

2011-07-24 Thread Jian Chang
Using copy_from is easy to solve it. And if you want to a get a speical format file from that csv, use a scirpt to handle it. http://www.initd.org/psycopg/docs/cursor.html#cursor.copy_from 2011/7/25 nixlists > On Sun, Jul 24, 2011 at 2:46 PM, Jarilyn Hernandez > wrote: > > Hi, Thanks for the res

Re: Using Form Elements Widgets direclty in HTML

2011-08-09 Thread Jian Chang
Since you don't want to use forms class, you can write elements in your templates directly. 2011/8/9 Hayyan Rafiq > Hi I wanted to know if there was a way in which we could use widget > directly in an HTML file > By widget i mean elements of a form such as input boxes,calendars,Buttons > etc wi

Re: How to order "links" in the Admin?

2011-08-09 Thread Jian Chang
you should figure out what it is based on to order these urls. i use time stamp to order them. 2011/8/10 Andre Lopes > Hi, > > I'm testing Django for my first project using it. > > I have a model like this: > > from django.db import models > import datetime > > class Directory(models.Model):