Re: How to handle the Browser Close ?

2009-03-31 Thread Briel
Hi. You don't really have to log the user out, unless you are making something with very sensitive material. A lot of sites wont log you out unless you haven't been at their site for some time. One thing you could do, would be to log users out that haven't been active for x minutes/hours, but you

Re: Sessions living through HttpResponseRedirect

2009-03-31 Thread Daniel Roseman
On Apr 1, 3:47 am, Joshua K wrote: > Howdy Folks, > > How do I get a session to live through a HttpResponseRedirect?  For > example: > >         form = clientFormCreate(request.POST) >         if form.is_valid(): >             newClient = form.save() >             request.sesson['current_client']

Re: Mysql?

2009-03-31 Thread Wiiboy
Why do you need shell access? Aren't you supposed to do all the coding and stuff on the local server, and then upload it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Flatpages variables

2009-03-31 Thread Wiiboy
Hi, I've got a site where users must be logged in to view any pages. Logged in users may write articles for the newsletter, and upload them. I then convert the article to HTML (manually), and make it available for other users. I'd like make them available on flatpages, but I have to be able to c

How to handle the Browser Close ?

2009-03-31 Thread veeravendhan
Say a user is logged in to the system, If he closes the browser how will I handle the Logout for that user ? Any idea ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: trouble uploading mp3 file

2009-03-31 Thread creecode
Hello oregon10, I wonder if the field you are using to upload is an ImageField or a FileField. If it's an ImageField you would have problems trying to upload an mp3 file. I would think you would get an error message but it might be masked by the code. Are you able to upload images with this fo

Re: Mysql?

2009-03-31 Thread Kenneth Gonsalves
On Wednesday 01 April 2009 09:23:36 Kenneth Gonsalves wrote: > On Wednesday 01 April 2009 05:14:01 stars wrote: > > So, I have a Mysql from my hosting plan can I use this in working with > > django? or do I have to download the MYSQL software? > > depends on what your hosting plan is. You basicall

Re: Mysql?

2009-03-31 Thread Kenneth Gonsalves
On Wednesday 01 April 2009 05:14:01 stars wrote: > So, I have a Mysql from my hosting plan can I use this in working with > django? or do I have to download the MYSQL software? depends on what your hosting plan is. You basically need mysql and mysqldb, which is the python interface to mysql. (I

Re: Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread Ricardob
Thank YOU! love the super(...)! On Apr 1, 4:03 am, Alex Gaynor wrote: > On Tue, Mar 31, 2009 at 11:01 PM, Ricardob wrote: > > > I'm sorry if this is too basic, just starting on django. > > > How do I call the default clean method? Am I not overriding it by > > defining on ModelForm? > > > On A

Re: Mysql?

2009-03-31 Thread Greg Poirier
On Tue, Mar 31, 2009 at 8:30 PM, Chris O'Donnell wrote: > > I think he means that his (shared?) hosting plan includes 1 MySQL > database, not unlimited databases. > Not sure. I meant to reply off-list -- as you pointed out this is maybe a little bit basic and is covered in the documentation some

Re: Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread Alex Gaynor
On Tue, Mar 31, 2009 at 11:01 PM, Ricardob wrote: > > I'm sorry if this is too basic, just starting on django. > > How do I call the default clean method? Am I not overriding it by > defining on ModelForm? > > On Apr 1, 3:35 am, Alex Gaynor wrote: > > On Tue, Mar 31, 2009 at 10:32 PM, skydark w

Re: Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread Ricardob
I'm sorry if this is too basic, just starting on django. How do I call the default clean method? Am I not overriding it by defining on ModelForm? On Apr 1, 3:35 am, Alex Gaynor wrote: > On Tue, Mar 31, 2009 at 10:32 PM, skydark wrote: > > > I am using the clean() method to do some costum valid

Sessions living through HttpResponseRedirect

2009-03-31 Thread Joshua K
Howdy Folks, How do I get a session to live through a HttpResponseRedirect? For example: form = clientFormCreate(request.POST) if form.is_valid(): newClient = form.save() request.sesson['current_client'] = str(newClient.pk) return HttpResponse

Re: Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread Alex Gaynor
On Tue, Mar 31, 2009 at 10:32 PM, skydark wrote: > > I am using the clean() method to do some costum validation, but I'm > getting an exception error instead of the validation error. This does > not occur when I don't use declare clean(), so I must be missing > something. > > #My model > class Ca

Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread skydark
I am using the clean() method to do some costum validation, but I'm getting an exception error instead of the validation error. This does not occur when I don't use declare clean(), so I must be missing something. #My model class Categoria(models.Model): nome = models.CharField('nome', max_le

Re: ModelForm

2009-03-31 Thread Alex Gaynor
On Tue, Mar 31, 2009 at 10:21 PM, jrs_66 wrote: > > Silly, simple(?) question... > > In a reduced sense, I have a model with two field Name & Age. I'd > like to use a ModelForm to display the Name field in plain text (no > form field), while have the Age be a CharField. How does a template > ac

ModelForm

2009-03-31 Thread jrs_66
Silly, simple(?) question... In a reduced sense, I have a model with two field Name & Age. I'd like to use a ModelForm to display the Name field in plain text (no form field), while have the Age be a CharField. How does a template access the Name field as straight text without it getting auto c

Re: mp3 converstion

2009-03-31 Thread Ariel Mauricio Nunez Gomez
On Tue, Mar 31, 2009 at 7:44 PM, oregon10 wrote: > > DISCLAMER: I'm not a program - only an end user and part-time admin > > I'm trying to upload a mp3 file to our my list of documents - so our > views can assess it online. It goes through the motions of uploading > but never appears in my list o

Re:error in response['Content-Type']

2009-03-31 Thread lhjlhj123123
File "C:\Python26\Lib\site-packages\django\http\utils.py", line 77, in fix_IE_for_vary if response['Content-Type'].split(';')[0] not in safe_mime_types: AttributeError: 'tuple' object has no attribute 'split' please check the 'tuple' where you have used. AttributeError: 'tuple' object has no

Re: mp3 converstion

2009-03-31 Thread Marcos Marín
I'm not sure I understand the problem but I doubt it is a format problem. I think maybe the server does not have permission to write in the folder you are trying to save files too. On Tue, Mar 31, 2009 at 18:44, oregon10 wrote: > > DISCLAMER: I'm not a program - only an end user and part-time ad

mp3 converstion

2009-03-31 Thread oregon10
DISCLAMER: I'm not a program - only an end user and part-time admin I'm trying to upload a mp3 file to our my list of documents - so our views can assess it online. It goes through the motions of uploading but never appears in my list of docs. That tells me that the format might be wrong. If so,

Re: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

2009-03-31 Thread Karl Gingerich
Mark, I'll up to my eye balls in alligators right now, I'll get back to you soon. - Karl -Original Message- From: Mark Shewfelt Date: Tue, 31 Mar 2009 08:25:55 To: Django users Subject: Re: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server? Hi Karl, I just came across

Re: How would you code a template to do this (template logic)

2009-03-31 Thread Chris O'Donnell
Interesting – I have I slightly different dilemma, but I think this will work. Here's the thread: http://groups.google.com/group/django-users/browse_frm/thread/b87a12f63f2db0a3 Regards, Chris --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Picky templating

2009-03-31 Thread Chris O'Donnell
Thanks – I'll post back here if it works out for me. And probably if it doesn't. But it will, right? :-) On Mar 31, 4:58 pm, Malcolm Tredinnick wrote: > On Wed, 2009-04-01 at 10:57 +1100, Malcolm Tredinnick wrote: > > On Tue, 2009-03-31 at 16:51 -0700, Chris O'Donnell wrote: > > > Hello all, > >

Re: Mysql?

2009-03-31 Thread Chris O'Donnell
I think he means that his (shared?) hosting plan includes 1 MySQL database, not unlimited databases. On Mar 31, 4:47 pm, Greg Poirier wrote: > On Tue, Mar 31, 2009 at 7:44 PM, stars wrote: > > > > > So, I have a Mysql from my hosting plan can I use this in working with > > django? or do I have t

Re: Easy API for Ordered ManyToMany Relation Fields

2009-03-31 Thread Russell Keith-Magee
On Wed, Apr 1, 2009 at 3:48 AM, Aryeh Leib Taurog wrote: > > I have an API implementation for ordered many-to-many relation fields > which uses the Python list interface to allow easy data manipulation > via the special manager associated with the field. > > I posted more information and a patch

Re: overriding the UserChangeForm

2009-03-31 Thread Marcos Marín
Hi Malcom, thanks for your response. However this would not fix my problem since I'm not using this in the Admin Interface so I have no ModelAdmin subclass. All I'm doing is subclassing the form so I can use it in a view where the user will be able to change his email address. On Tue, Mar 31, 20

Re: Mysql?

2009-03-31 Thread Chris O'Donnell
Oh, it looks like I was beaten to it. Oh well. His reply is better anyway. :-) On Mar 31, 5:01 pm, "Chris O'Donnell" wrote: > You should be able to use the MySQL database that comes with your > hosting plan, so long as they run a suitable version, which they > should. Which hosting company do yo

Re: Mysql?

2009-03-31 Thread Chris O'Donnell
You should be able to use the MySQL database that comes with your hosting plan, so long as they run a suitable version, which they should. Which hosting company do you use? Also, I get the feeling you're new to Web programming ... and running Django apps is a much more advanced task than coding HT

Re: Picky templating

2009-03-31 Thread Malcolm Tredinnick
On Wed, 2009-04-01 at 10:57 +1100, Malcolm Tredinnick wrote: > On Tue, 2009-03-31 at 16:51 -0700, Chris O'Donnell wrote: > > Hello all, > > > > Here's my dilemma: I want every fourth item displayed using a {% for > > %} loop to be rendered using a different block of HTML. This want is > > specifi

Re: Mysql?

2009-03-31 Thread Greg Poirier
On Tue, Mar 31, 2009 at 7:44 PM, stars wrote: > > So, I have a Mysql from my hosting plan can I use this in working with > django? or do I have to download the MYSQL software? > It's going to depend on your hosting plan, but you should be able to use the MySQL server that your host provides, gran

Re: Picky templating

2009-03-31 Thread Malcolm Tredinnick
On Tue, 2009-03-31 at 16:51 -0700, Chris O'Donnell wrote: > Hello all, > > Here's my dilemma: I want every fourth item displayed using a {% for > %} loop to be rendered using a different block of HTML. This want is > specific to a CSS framework I'm using, Blueprint CSS. Any of you that > use it a

Re: Newbie question - add dynamically optionMenu

2009-03-31 Thread Chris O'Donnell
Could you be a tad more specific? Not sure exactly what you're referring to. May be able to help out... On Mar 31, 1:26 pm, AsiSoudai wrote: > hey Gang, > > I'm new to django, and I'm looking to add dynamically optionMenu to a > dropdown several menus object, without updating the entire page. >

Re: overriding the UserChangeForm

2009-03-31 Thread Malcolm Tredinnick
On Tue, 2009-03-31 at 16:50 -0600, Marcos Marín wrote: > I have overridden the user change form, I only want to have the email > field however the username field seems to always appear no matter > what. Is this a bug or by design? I'm using the beta. I stumbled across this yesterday. I'm not sure

Picky templating

2009-03-31 Thread Chris O'Donnell
Hello all, Here's my dilemma: I want every fourth item displayed using a {% for %} loop to be rendered using a different block of HTML. This want is specific to a CSS framework I'm using, Blueprint CSS. Any of you that use it and haven't modified its source know that for the last column in the gr

Re: Trac + Sphinx

2009-03-31 Thread Malcolm Tredinnick
On Tue, 2009-03-31 at 17:34 -0300, Vinicius Mendes wrote: > Hi all, > > Does anyone here integrate trac and sphinx? How do you take advantages > from this? Can we keep this list on-topic for Django, please? Yes, we're a helpful group, but it's busy enough without random questions about other Pyt

Re: manytomany relation to child classes

2009-03-31 Thread Malcolm Tredinnick
On Tue, 2009-03-31 at 11:02 -0400, dunia wrote: > hi list! > > i have a model: > > class A(models.Model): > class Meta: > abstract = True > ... > > class B(A): > ... > > class C(A): > ... > > class D(models.Model): > ... > > instances of class D have a many t

Mysql?

2009-03-31 Thread stars
So, I have a Mysql from my hosting plan can I use this in working with django? or do I have to download the MYSQL software? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Counting queries and query execution time

2009-03-31 Thread Malcolm Tredinnick
On Tue, 2009-03-31 at 06:29 -0700, Ceph wrote: > Under settings.DEBUG=True, django.db.connection.queries is an array of > all queries executed. For a single request. > Obviously storing every query in text is a > memory hog. Not obvious at all. Storing a few strings doesn't use a lot of memor

overriding the UserChangeForm

2009-03-31 Thread Marcos Marín
I have overridden the user change form, I only want to have the email field however the username field seems to always appear no matter what. Is this a bug or by design? I'm using the beta. class EstudianteForm(UserChangeForm): class Meta(UserChangeForm.Meta): fields = ( 'e

Re: IOError: request data read error (revisited)

2009-03-31 Thread Graham Dumpleton
On Apr 1, 1:34 am, akaihola wrote: > We ran into the same issue Chunlei Wu described in January[1]. A user > was trying to upload large files and all we got were 500 errors by e- > mail: > >   File "/home/citedesarts/src/django/django/http/multipartparser.py", > line 406, in read > IOError: req

Newbie question - add dynamically optionMenu

2009-03-31 Thread AsiSoudai
hey Gang, I'm new to django, and I'm looking to add dynamically optionMenu to a dropdown several menus object, without updating the entire page. Is there a good/simple tutorial, code snippet around? I've seen couple, but couldn't make them work ;) Thanks, Asi --~--~-~--~~--

Easy API for Ordered ManyToMany Relation Fields

2009-03-31 Thread Aryeh Leib Taurog
I have an API implementation for ordered many-to-many relation fields which uses the Python list interface to allow easy data manipulation via the special manager associated with the field. I posted more information and a patch for the latest django release on my website: http://www.aryehleib.com

Re: Modifu request.user

2009-03-31 Thread Mitko Masarliev
I have application with table name clients. Clients has one to one relation with django users and in all app logic I check clients id by request.user.id, In some cases user_id is not same as clients_id. This is the problem, so I am trying to change request.user.id to be equal to clients_id and

Re: testing with a mock object

2009-03-31 Thread Daniel Roseman
On Mar 31, 7:39 pm, belred wrote: > i have a questions about mock objects.  i currently have a django view > function that calls a 2nd function.  this second function calls > urllib2.urlopen.   i was thinking about adding in a mock object so i > can get some better code coverage in the 2nd functi

Re: iterating over fields of a model

2009-03-31 Thread Filip Gruszczyński
I'll do. Thanks :-) W dniu 31 marca 2009 18:12 użytkownik Daniel Roseman napisał: > > On Mar 31, 4:54 pm, Filip Gruszczyński wrote: >> I have a user profile class and I would like to iterate over all >> defined fields and retrieve their values. For example if I had: >> >> class UserProfile: >>

Trac + Sphinx

2009-03-31 Thread Vinicius Mendes
Hi all, Does anyone here integrate trac and sphinx? How do you take advantages from this? Vinícius Mendes Engenheiro de Computação Meio Código - A peça que faltava para o seu código! URL http://www.meiocodigo.com --~--~-~--~~~---~--~~ You received this m

Re: Determining server identity from views.py?

2009-03-31 Thread Adi Sieker
Hi, On 31.03.2009, at 21:54, Ross wrote: > > Thanks for your reply, and you anticipated my follow up question. A > brief look found how to read an enviro var from python: > > os.environ['USER'] give me $USER from the OS it appears (haven't > tried it yet). > > BUT, I also took a close look at

Re: Determining server identity from views.py?

2009-03-31 Thread Ross
Thanks for your reply, and you anticipated my follow up question. A brief look found how to read an enviro var from python: os.environ['USER'] give me $USER from the OS it appears (haven't tried it yet). BUT, I also took a close look at the request.META data, wondering if there isn't somethin

Re: Determining server identity from views.py?

2009-03-31 Thread Alex Gaynor
On Tue, Mar 31, 2009 at 3:29 PM, Ross wrote: > > Is there a means by which I can programmatically tell whether I'm > running behind apache + mod_python or the django dev server? > > I want to do something along the lines of > > if dev_server: > do this > elif apache_mod_python: > do this > >

Determining server identity from views.py?

2009-03-31 Thread Ross
Is there a means by which I can programmatically tell whether I'm running behind apache + mod_python or the django dev server? I want to do something along the lines of if dev_server: do this elif apache_mod_python: do this Thanks for any hints... Ross. --~--~-~--~~

testing with a mock object

2009-03-31 Thread belred
i have a questions about mock objects. i currently have a django view function that calls a 2nd function. this second function calls urllib2.urlopen. i was thinking about adding in a mock object so i can get some better code coverage in the 2nd function when calling manage.py test. my first

Joining the Django Sprint in Ann Arbor on Wednesday

2009-03-31 Thread Michael Newman
Brian Kerr, http://xca2.com/, and myself have been sitting in Michigan upset that we aren't joining the sprinters in Chicago working on Django. We decided that we would do something about that and connect remotely in Ann Arbor for a day. We also wanted to give an open invitation to anyone in the a

Re: How to connect an app with a generic relation to an other app without changing it.

2009-03-31 Thread jfroehlich
On Mar 31, 12:19 pm, Malcolm Tredinnick wrote: > Yes, because that's exactly how django.contrib.comments works. Have a > look at the source for that (django/contrib/comments/models.py) for an > example. Erm yes, my mistake. I was thinking about the admin app when writing the question. As far as

set list_filter directly

2009-03-31 Thread Sams
Hi all, I would like to know if there is some way to pass to admin list_filter the values I want to filter. for example, i have a field for author's book. it's a string with more than one author. a few books could be have one or more author will be the same. I want to catch all the authors of

Re: iterating over fields of a model

2009-03-31 Thread Daniel Roseman
On Mar 31, 4:54 pm, Filip Gruszczyński wrote: > I have a user profile class and I would like to iterate over all > defined fields and retrieve their values. For example if I had: > > class UserProfile: >   first_name = CharField(.. >   last_name = CharFiel(.. > > etc. > > I would like to get name

iterating over fields of a model

2009-03-31 Thread Filip Gruszczyński
I have a user profile class and I would like to iterate over all defined fields and retrieve their values. For example if I had: class UserProfile: first_name = CharField(.. last_name = CharFiel(.. etc. I would like to get names first_name, last_name, etc. and be able to retrieve those valu

Re: Assigning a file manually to a model FileField

2009-03-31 Thread Karen Tracey
On Tue, Mar 31, 2009 at 10:55 AM, Matias Surdi wrote: > > I have the following model: > > class Document(BaseModel): > name = models.CharField(max_length=150,blank=True) > type = models.ForeignKey(DocumentType) > description = models.TextField(blank=True) > file = > > models.FileFi

Re: Changemanipulator takes 15 seconds to execute

2009-03-31 Thread Karen Tracey
On Tue, Mar 31, 2009 at 11:17 AM, Miguel wrote: > > where should I put "raw_id_admin=True" ? in the foreing key declaration? > > forma_parte_de = > models.ForeignKey('Plantilla_bloque',related_name='dentro_de',blank=True,null=True) > > and what implications does it have? > Sorry, I meant to inc

Re: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

2009-03-31 Thread Mark Shewfelt
Hi Karl, I just came across your post and am having the same issue (Ubuntu 8.04 Server). I managed to build the latest versions of unixODBC and FreeTDS and install them to /usr/local/lib. When I run python and try to import pyodbc I get the following error: administra...@maverick:~/pyodbc-2.1.4$

Re: Changemanipulator takes 15 seconds to execute

2009-03-31 Thread Miguel
where should I put "raw_id_admin=True" ? in the foreing key declaration? forma_parte_de = models.ForeignKey('Plantilla_bloque',related_name='dentro_de',blank=True,null=True) and what implications does it have? thank you Miguel Sent from Madrid, Spain On Tue, Mar 31, 2009 at 4:21 PM, Karen

Re: Time lookup

2009-03-31 Thread Brian Neal
On Mar 31, 5:31 am, LD wrote: > OK, but Django do not provide 'time' lookup so my problem is 'how to > retrieve time part of datetime field in a query' Ok, then why are you storing date and time together when all you care about is time? To me, when you have a DateTimeField, that represents a poi

manytomany relation to child classes

2009-03-31 Thread dunia
hi list! i have a model: class A(models.Model): class Meta: abstract = True ... class B(A): ... class C(A): ... class D(models.Model): ... instances of class D have a many to many relationship with A, and I want to be able to select if the above will be set

Assigning a file manually to a model FileField

2009-03-31 Thread Matias Surdi
I have the following model: class Document(BaseModel): name = models.CharField(max_length=150,blank=True) type = models.ForeignKey(DocumentType) description = models.TextField(blank=True) file = models.FileField(upload_to="data/documentation/document/%Y/%m/%d",blank=True) A

testing suite fails on auth

2009-03-31 Thread Filip Gruszczyński
I haven't yet created any my own tests and just run ./manage.py test. This is what I got: ...FFF.. == ERROR: test_known_user (django.contrib.auth.tests.remote_user.RemoteUserCustomTest) ---

IOError: request data read error (revisited)

2009-03-31 Thread akaihola
We ran into the same issue Chunlei Wu described in January[1]. A user was trying to upload large files and all we got were 500 errors by e- mail: File "/home/citedesarts/src/django/django/http/multipartparser.py", line 406, in read IOError: request data read error The user was on a public libr

Re: Changemanipulator takes 15 seconds to execute

2009-03-31 Thread Karen Tracey
On Tue, Mar 31, 2009 at 9:52 AM, Miguel wrote: > hi, > > I have found an optimizing problem. I have a model which i would like to > edit, when I call my method I do something like this: > > > def method_modify(request, method_id): > > try: >manipulator = Pattern_method.ChangeManipula

Re: Counting queries and query execution time

2009-03-31 Thread Thomas Guettler
Hi, I have written an SQLLogMiddleware: http://www.djangosnippets.org/snippets/344/ Maybe this helps you. But it only works if settings.DEBUG is true. Ceph schrieb: > Under settings.DEBUG=True, django.db.connection.queries is an array of > all queries executed. Obviously storing every query i

Re: Is Django right for me?

2009-03-31 Thread Dotan Cohen
> Django uses an ORM - so you don't (usually) need to query the database > directly. > Why don't you go through the Django tutorial and try it out? > http://docs.djangoproject.com/en/dev/#first-steps Thanks, I just finished that before I read your post! -- Dotan Cohen http://what-is-what.com h

Changemanipulator takes 15 seconds to execute

2009-03-31 Thread Miguel
hi, I have found an optimizing problem. I have a model which i would like to edit, when I call my method I do something like this: def method_modify(request, method_id): try: manipulator = Pattern_method.ChangeManipulator(method_id) except Pattern_method.DoesNotExist: r

Re: Could not import settings

2009-03-31 Thread Karen Tracey
On Tue, Mar 31, 2009 at 9:27 AM, knight wrote: > > Hi, > > I'm trying to install my django application on CentOS 5 and I'm > getting the following error: > > ImportError: Could not import settings 'mx30.settings' (Is it on > sys.path? Does it have syntax errors?): No module named mx30.settings >

Re: how to compare numeric in template?

2009-03-31 Thread ketu.lai
Thank you for your quick response! very helpful! 2009/3/31 Alex Gaynor > > > 2009/3/31 ketu.lai > >> >> hii want to compare numeric in template. just like less than,greater than >> etc. and how can i do? or other solutions? >> -- >> 有没有听过盲人摸象的故事,没有的话大神说给你听! >> >> >> > Take a look at django-tem

Re: Modifu request.user

2009-03-31 Thread Dougal Matthews
Why do you want to change the request object? Why are you trying to store a user object? Perhaps you want to store it in a session? I think you should explain what you are trying to do. Dougal --- Dougal Matthews - @d0ugal http://www.dougalmatthews.com/ 2009/3/31 Masarliev > > yes it's bad

Counting queries and query execution time

2009-03-31 Thread Ceph
Under settings.DEBUG=True, django.db.connection.queries is an array of all queries executed. Obviously storing every query in text is a memory hog. Would it still thrash as much if I wrote my own wrapper around a DB connection class via settings.DATABASE_ENGINE that implemented its own DebugCursor

Could not import settings

2009-03-31 Thread knight
Hi, I'm trying to install my django application on CentOS 5 and I'm getting the following error: ImportError: Could not import settings 'mx30.settings' (Is it on sys.path? Does it have syntax errors?): No module named mx30.settings My httpd.conf looks as follows: Listen 80 SetHandler python-p

Re: how to compare numeric in template?

2009-03-31 Thread Alex Gaynor
2009/3/31 ketu.lai > > hii want to compare numeric in template. just like less than,greater than > etc. and how can i do? or other solutions? > -- > 有没有听过盲人摸象的故事,没有的话大神说给你听! > > > > Take a look at django-template-utils which has templatetags for all these things. Alex -- "I disapprove of what

how to compare numeric in template?

2009-03-31 Thread ketu.lai
hii want to compare numeric in template. just like less than,greater than etc. and how can i do? or other solutions? -- 有没有听过盲人摸象的故事,没有的话大神说给你听! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Modifu request.user

2009-03-31 Thread Masarliev
yes it's bad idea. other solution is to create additional object similar to request.user for example request.additional. How can i do that. On Mar 31, 4:17 pm, Jeff FW wrote: > Changing request.user.id doesn't make sense--that would be trying to > change the id of the user object itself.  I thin

Re: Is Django right for me?

2009-03-31 Thread Oli Warner
> > Yup. The ORM goes out of its way to make safe strings. You can circumvent > it > > but that's naturally on your head. The Form classes also go a long way to > do > > the same. Forms go some distance further to make validation really simple > > too. > > > > Interesting, thanks. I did not know wh

Re: Is Django right for me?

2009-03-31 Thread Dougal Matthews
Django uses an ORM - so you don't (usually) need to query the database directly. Why don't you go through the Django tutorial and try it out? http://docs.djangoproject.com/en/dev/#first-steps Dougal --- Dougal Matthews - @d0ugal http://www.dougalmatthews.com/ 2009/3/31 Dotan Cohen > > > Yo

Re: Modifu request.user

2009-03-31 Thread Jeff FW
Changing request.user.id doesn't make sense--that would be trying to change the id of the user object itself. I think what you're trying to do is change the user that is actually logged in... right? If that's true, then you need to set request.user *not* request.user.id-- but that seems like a v

Re: Is Django right for me?

2009-03-31 Thread Dotan Cohen
> Yup. The ORM goes out of its way to make safe strings. You can circumvent it > but that's naturally on your head. The Form classes also go a long way to do > the same. Forms go some distance further to make validation really simple > too. > Interesting, thanks. I did not know what ORM means but

Re: Is Django right for me?

2009-03-31 Thread Dotan Cohen
> Django has really great documentation > http://docs.djangoproject.com/en/dev/ > > There is a tutorial to get a feeling for the framework > Thanks, I went through the docs briefly but I have yet to follow the tutorial. I will do that. -- Dotan Cohen http://what-is-what.com http://gibberish.co

Re: Is Django right for me?

2009-03-31 Thread Oli Warner
On Tue, Mar 31, 2009 at 12:35 PM, Dotan Cohen wrote: > > > Dotan, I think once you've got your head around some of the key concepts > > (urls, models, template inheritance and forms) and have a first site set > up, > > you'll never ever look back. > > > > Again, I am not interested in the templat

Re: Is Django right for me?

2009-03-31 Thread Kenneth Gonsalves
On Tuesday 31 March 2009 16:58:17 Dotan Cohen wrote: > > django would be a perfect fit as it's templates with inheritance would > > automate your site and it's ORM would automate your database access too. > > btw, last I heard, Qt uses C++. > > There are Qt bindings for Python as well. And I find

Re: DJango, threads and serial port

2009-03-31 Thread Filip Gruszczyński
> So, sys.path becomes None somewhere before you create the Serial object > in another thread? I'm afraid your options are either 1. add watchpoints > to pdb (http://wiki.python.org/moin/PdbImprovments), or 2. use binary > search principle to insert printfs into the middle of the execution > noodl

Re: Is Django right for me?

2009-03-31 Thread Brot
Django has really great documentation http://docs.djangoproject.com/en/dev/ There is a tutorial to get a feeling for the framework On Mar 31, 1:35 pm, Dotan Cohen wrote: > > Dotan, I think once you've got your head around some of the key concepts > > (urls, models, template inheritance and form

Re: Is Django right for me?

2009-03-31 Thread Dotan Cohen
> Dotan, I think once you've got your head around some of the key concepts > (urls, models, template inheritance and forms) and have a first site set up, > you'll never ever look back. > Again, I am not interested in the templating but rather I would like to know what other features Django offers

Re: Is Django right for me?

2009-03-31 Thread Dotan Cohen
> django would be a perfect fit as it's templates with inheritance would > automate > your site and it's ORM would automate your database access too. btw, last I > heard, Qt uses C++. There are Qt bindings for Python as well. And I find Python's learning curve to be more in step with my hobbist

Re: Is Django right for me?

2009-03-31 Thread Dotan Cohen
> You might want to look at the Django templating system. It's far more > powerful and flexible than using a simple PHP script and including other > files. > Django wouldn't be overkill - it would make all of the features you > mentioned really easy as it does them out of the box. Allowing you to

Re: What hash algorithm does django auth use?

2009-03-31 Thread Matthew Somerville
Joshua Partogi wrote: > # Process the data in form.cleaned_data > user = User() > new_member = form.save(commit=False) > > new_member.password = user.set_password > ( new_member.password ) > instance = new_member.save() > > But it seems

Re: What hash algorithm does django auth use?

2009-03-31 Thread Joshua Partogi
On Mar 30, 12:58 pm, Malcolm Tredinnick wrote: > A number of problems here. Firstly, Django uses SHA1 as the default > hashing algorithm. Secondly, you haven't accounted for including any > salt in the password hash (which make the task of dictionary attacks > much harder). > > The correct way

Re: Django 1.1 beta, problem with group_by and extra()

2009-03-31 Thread Russell Keith-Magee
On Tue, Mar 31, 2009 at 4:15 PM, Eric Bandel wrote: > Hi, i've just upgrade my django install from 1.1 alpha to 1.1 beta. > > i have a simple query. > > data = mymodel.objects.extra(select={'month':'month(date)', > > 'test':'SUM(IF(ok,0,ok)}) > data.query.group_by = [''month] > > with the 1.1 alp

Re: Is Django right for me?

2009-03-31 Thread Oli Warner
Dotan, I think once you've got your head around some of the key concepts (urls, models, template inheritance and forms) and have a first site set up, you'll never ever look back. The Python is the easy bit. It mostly "just makes sense" until you see the crazy-short ways of doing really quite compl

Re: Is Django right for me?

2009-03-31 Thread Kenneth Gonsalves
On Tuesday 31 March 2009 16:05:42 Dotan Cohen wrote: > Would Django be overkill for this type of website? Is there a better > alternative? One of my goals in switching to Python is to broaden my > exposure to the language as I intend to move into developing Qt > applications soon. django would be

Re: Is Django right for me?

2009-03-31 Thread Dougal Matthews
You might want to look at the Django templating system. It's far more powerful and flexible than using a simple PHP script and including other files. Django wouldn't be overkill - it would make all of the features you mentioned really easy as it does them out of the box. Allowing you to spend all y

regroup by date

2009-03-31 Thread Alfonso
regrouping some results by date and I can't seem to make it work on date only, i.e. not including the time - I get the following error "'unicode' object has no attribute 'hour'" when I try: {% regroup results by date_time|date:"D m Y" as results %} Am I missing a special Django filter to get gro

Is Django right for me?

2009-03-31 Thread Dotan Cohen
I have been writing websites as a hobby in PHP for a few years, but I want to switch to Python for various reasons. I have been advised to look into Django, but I am not sure that it fits my needs. My sites are mostly static HTML, generated from a header.inc and footer.inc file with code like $tit

Re: Using model instance properties in QuerySets in ModelForm's __init__()

2009-03-31 Thread Marek Wawrzyczek
So I sloved my problem with QuerySet - while creating the ModelForm instance, there should be passed instance argument, not only POST or GET, so that the ModelForm could "know" if there should be edition of existing model or creating a new one. Regards, Marek Marek Marek Wawrzyczek wrote: >

Authorize.net integration problem

2009-03-31 Thread Lakshman Prasad
Hi, I am trying to integrate Authorize.net SIM API into django views. I am facing a problem in the fingerprint generation. I am repeatedly getting that the fingerprint generated doesn't match the one the server generates. I have generated the md5 hash with the key provided as specified in the SI

  1   2   >