Re: Cache middleware causing unit tests to fail
On Thu, 2007-08-16 at 17:05 -0600, Norman Harman wrote: > Hi, > > request.template is None instead of what it should be because the response is > from the > cache middleware. > > Which is fine. My question is there a good way to disable the cache > middleware during > tests? > > "good" being atleast the following. is automatic, isn't based of value of > DEBUG, doesn't > require changing django distro. > > Is there a special settings file or other file imported during tests only? The standard (and recommended) approach if you need slightly different settings during testing is to create a new settings file just for tests. It will look something like this: from settings import * CACHE_BACKEND = 'simple://' where "settings" is your normal settings file. This way you only override the settings you need to. Then you run your tests with manage.py --settings=test_settings test Note that if you are looking for a way to entirely ignore the cache middleware, you probably need to remove it from the middleware list. Since you test_settings.py file can contain arbitrary Python code in it, you can do that by examing your existing MIDDLEWARE_CLASSES list, removing the offending entry and reassigning the result to MIDDLEWARE_CLASSES. Regards, Malcolm -- Depression is merely anger without enthusiasm. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Seeking Django Developers USA (several projects and maintenance)
Must have experience installing, configuring python, etc... contact [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Datetimefield error using form_as_model
On Thu, 2007-08-16 at 05:25 -0700, jeffhg58 wrote: > Hi, > > I am using a form_as_model with newforms and when I do a save I get > the following error message on the form: > > format is %Y-%m-%d %H:%M:%S. Grepping through the source code, the string "format is" does not appear anywhere in the source in the for you describe. Which version of Django are you using? [...] > views.py > > AddEventFormClass = forms.form_for_model(Events) > > if request.method == 'POST': > # If data was POSTed, we're trying to create a new Event. > form = AddEventFormClass(request.POST) > > > # Check for errors. > print 'errors is ', form.errors > if form.is_valid(): > form.save() > return HttpResponseRedirect("/tct/events/%s/" % city_id) > > The errors occur before the form.is_valid check What do you mean? Does an actual exception get raised? Or are you saying that something is printed out on the line where your print statement is? Perhaps you could paste the actual traceback or printed output rather than trying to summarise the results, because it's not clear what is really going on. Also, what is in the POSTed data for the field in question? Is it valid data? Regards, Malcolm -- If Barbie is so popular, why do you have to buy her friends? http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Site Map template required?
On Thu, 2007-08-16 at 11:03 -0700, MikeHowarth wrote: > Malcolm > > Thanks for your comments, indeed changing to use the sitemap view, > then returns a template does not exist error. > > If I create a sitemap.xml file in my templates directory I then bypass > this. What I'm struggling with is that the documentation suggests that > the feed is automatically generated. It should be using the sitemaps.xml template from django/contrib/sitemaps/templates/. You might want to double-check that you have followed all the steps in the Installation section of the sitemaps documentation. If that is correctly set up, then check that django/contrib/sitemaps/templates/ exists and contains two files (sitemap_index.xml and sitemap.xml). Regards, Malcolm -- Depression is merely anger without enthusiasm. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Nesh Thumbnail - Not displaying correct dimensions
On 17-Aug-07, at 7:47 AM, Greg wrote: > Kenneth, > So in your models.py file do you use auto_rename=False? i use an old version - at that time it didnt have the auto_rename feature > > This is what I have: > > photo = field.ImageWithThumbnailField(upload_to='site_media/') thats what i have > > > > When the picture is uploaded and saved in your site_media folder. > Does it have the the same dimensions as the original file or does it > have smaller dimensions? same as original -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: mutual exclusion
On 8/16/07, Derek Anderson <[EMAIL PROTECTED]> wrote: > > hey, > > how is everyone handling mutual exclusion between server threads in > django? is there a built-in method i'm missing? What are you trying to accomplish? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: (1040, 'Too many connections')
On 8/16/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > Don't understand what 0.96pre means since not a regular Django user, > but there was a whole issue with MySQL database issues with Subversion > copy of Django back in June. Between releases, django.VERSION increments and adds the "-pre" suffix, so "0.96-pre" would be a Subversion checkout of Django from a point between the 0.95 and 0.96 releases (a current checkout will report "0.97-pre"). That means it's at least a six-month-old checkout, and probably a bit older (the window for such a checkout is roughly August 2006-February 2007). -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Life (1) ; Working
. Life It is something that everyone has, yet very view people comprehend it, or at least try to. If I put a book on your hand and ask you, "What is a book? I bet you can answer it easily. If now I put a slice of bread on your hand and ask you, "What is bread? Definitely, you'll answer it correctly. Likewise, sugar, rubber band, money, and many other things, I believe you know exactly what they are. But what about Life? If represented as a little thing and put onto your hand, then I ask you: What is Life? Can you answer it? Not easy, right? While every human being has life, or used to have it, it is absolutely not easy to define what exactly Life is. I tell you what, take some time, say 10 minutes, before you continue reading, to try to answer the question with your own thought and idea. Not other's idea that you got from a book somewhere, but with your own. Now, use your thought, perception, mind, experience, idea, meaning, and feeling. Answer this question: . What is LIFE ??? To be continued. - Indonesia ; Bank: BCA ( Bank Central Asia ) ; Code: CENAIDJA Account number: 526 025 9204 ; Name: Bintang Torang Sirait ; Branch: KCP K.S. Tubun - . Working Every human being, like all living creatures, has basic routine needs. Foods, clothing, medicines, etc. Without meeting those needs people will die soon. Most people do not want to die soon, then they have to meet those basic routine needs. How? Have something to exchange: money. How to get money? See the title above. Do you have problem with your boyfriend or girlfriend? You have problem with your husband or wife, family, job, social-life, etc? Something in your mind really disturbing you? If you have any kind of problem in life and need some advice, please send me an email to: [EMAIL PROTECTED] solveproblem11 at gmail dot com And let me know your problem in detailed. I'll give you some advice to solve that problem directly to your email address. Nobody will get your identity, not even me. Sincerely yours, Dr. Solve Personal Problem --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Nesh Thumbnail - Not displaying correct dimensions
Kenneth, So in your models.py file do you use auto_rename=False? This is what I have: photo = field.ImageWithThumbnailField(upload_to='site_media/') When the picture is uploaded and saved in your site_media folder. Does it have the the same dimensions as the original file or does it have smaller dimensions? Thanks On Aug 16, 8:33 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 17-Aug-07, at 6:49 AM, Greg wrote: > > > Thanks for the reply. When you use nesh and you upload a picture is > > the name of the picture: > > > classname-fieldname-none.jpg? Or does the filename contain the pk of > > the record? > > no - it is just the name of the picture that is on my local hard disk > > -- > > regards > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: (1040, 'Too many connections')
1040 is the MySQL error for when you've got too many connections open to the database server. MySQL's docs on this are here: http://dev.mysql.com/doc/refman/5.0/en/too-many-connections.html You have one or more of these happening: 1) You have too many Apache children for the MySQL's max_connections setting. You need to adjust the max_connections to match the number of possible Apache child processes. 2) Something is stalling mysql threads. Use the SHOW PROCESSLIST command to see what threads are around. --Simon --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: A "revision-controlled field" type?
It sounds like what you need to build is a custom ForeignKey type of field that creates another table for that field. Then, you can store an arbitrary number of revisions of that field, along with versioning information, and a wrapper around diff that can perform the functions you mention. On Aug 16, 5:54 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > I'm not sure I really understand. It sort of sounds like you are > > talking about a CharField with a choices argument. Is what you're > > looking for more complex? > > No...a "choices" argument assumes you know what you want in the > field beforehand...yes, I'm looking for a headache :) > > > Can you describe it in more detail? > > It would be like a TextField that behaves like the contents of an > RCS ",v" file. As the item is saved, past revisions are > maintained and only deltas are applied. Past revisions can be > extracted. Much like your average wiki edit-field. > > Theoretically, one could bind to an existing library like the > "bzr" revision-control libraries (graciously already written in > Python), mercurial/hg (also written mostly in python), SVN or CVS > (providing python interfaces, but to non-Django-DB backend > storage from my understanding) and hook into their ability to > manage the content as revisions. Even a "rcs.py" or something > like that would be sufficient as long as it could work with a > string-object rather than having to marshall files. > > Such fields would have ways of extracting various revisions and > differences between revisions. > > Sample usage of this imaginary field type (adjust for > apropriateness): > > class Foo(Model): >title = CharField(maxlength=42) >body = RevisionControlField() > > >>> f = Foo.objects.create(title='This is a test', body=""" > ... line 1 > ... Hello world > ... line 3 > ... """) > ... > >>> f.save() > >>> f.body = """ > ... line 1 > ... Goodbye world > ... line 3 > ... """) > >>> f.save() > >>> f.body = """ > ... line 1 > ... Aloha world > ... line 3 > ... """) > >>> f.body.diff() > [output showing "Goodbye" -> "Aloha" in your favorite diff > format, or perhaps a "diff" object] > >>> f.body.diff(1) #diff with > [output showing "Hello" -> "Aloha" in your favorite diff format, > or perhaps a "diff" object] > >>> f.body.revert() # now back at version 2 with "Goodbye" > >>> f.body[1] > """ line 1 >Hello world >line 3 >""" > >>> f.body.revisions > 2 > > Hope this clarifies what I'm hunting for. Thanks though! > > -tim --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
a nice new website look here
http://www.pennergame.de/ref.php?uid=4762 --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Nesh Thumbnail - Not displaying correct dimensions
On 17-Aug-07, at 6:49 AM, Greg wrote: > Thanks for the reply. When you use nesh and you upload a picture is > the name of the picture: > > classname-fieldname-none.jpg? Or does the filename contain the pk of > the record? no - it is just the name of the picture that is on my local hard disk -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: (1040, 'Too many connections')
Can you upgrade to proper 0.96 and not 0.96pre and see if it makes a difference. Don't understand what 0.96pre means since not a regular Django user, but there was a whole issue with MySQL database issues with Subversion copy of Django back in June. http://groups.google.com/group/django-users/browse_frm/thread/588718d711a5a0f0/0b36765c27bfb5c9 Maybe the version you have incorporates that problem code. Others may remember this issue and comment. Graham On Aug 17, 2:34 am, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote: > Hi guys! > > First of all, thanks for all help, I was busy on a project last week > and could not dig into the problem. > Let me remeber the thread, I having a problem, sometimes my server > stuck and goes down, just before it happens, I receive many messages > telling "Too many connections". I use apache +mod_pythoncombination > on a Suse server, the version of my package is: > > apache2-mod_python-3.1.3-60 > apache2-prefork-2.2.0-21.7 > mysql-5.0.18-20.8 > python-2.4.2-18.10 > django-0.96-pre > MySQLdb-1.2.1_p2 [*] > > [*] the version of MySQLdb is an older version that do not get messy > with my character set > > I didn´t get any other stuck after august, 8 (my last message) but I´m > disabling traceback email messages on fridays and re-enabling on > mondays. The RAM usage oscilate between 1GB and 3GB during these > period, I think it is ok. I don´t use MaxRequestPerChild directive, is > it a good practise? > > I read recomendations to change from apache+mod_pythonto apache > +mod_wsgi, this way I will have just one instance of python (am I > right?), reather than n instances created by apache/mod_python. > > Thanks for all help! > I wrote the traceback bellow: > > Traceback (most recent call last): > > File "/usr/lib64/python2.4/site-packages/django/core/handlers/ > base.py", line 74, in get_response > response = callback(request, *callback_args, **callback_kwargs) > > File "/usr/lib64/python2.4/site-packages/django/utils/ > decorators.py", line 20, in _wrapped_view > response = view_func(request, *args, **kwargs) > > File "/home/mrape/django/portal/common/views.py", line 56, in home > context['sponsored'] = (sponsored and sponsored[0]) or None > > File "/usr/lib64/python2.4/site-packages/django/db/models/query.py", > line 100, in __len__ > return len(self._get_data()) > > File "/usr/lib64/python2.4/site-packages/django/db/models/query.py", > line 430, in _get_data > self._result_cache = list(self.iterator()) > > File "/usr/lib64/python2.4/site-packages/django/db/models/query.py", > line 170, in iterator > cursor = connection.cursor() > > File "/usr/lib64/python2.4/site-packages/django/db/backends/mysql/ > base.py", line 100, in cursor > self.connection = Database.connect(**kwargs) > > File "/usr/local/lib64/python2.4/site-packages/MySQLdb/__init__.py", > line 75, in Connect > return Connection(*args, **kwargs) > > File "/usr/local/lib64/python2.4/site-packages/MySQLdb/ > connections.py", line 164, in __init__ > super(Connection, self).__init__(*args, **kwargs2) > > OperationalError: (1040, 'Too many connections') --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Nesh Thumbnail - Not displaying correct dimensions
Kenneth, Thanks for the reply. When you use nesh and you upload a picture is the name of the picture: classname-fieldname-none.jpg? Or does the filename contain the pk of the record? Thanks On Aug 16, 7:42 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 16-Aug-07, at 9:02 PM, Greg wrote: > > > When the image gets uploaded the name of the image is myphototest- > > photo-none (without auto_rename attribute). Isn't none supposed to be > > the object pk. Shouldn't that be a 1,2,3 etc instead of none? > > i'm afraid i cant help you further - I have been using Nesh Thumbnail > right from it's first release, and the only issues i have faced is > when there were spaces and unusual characters in the filename. > Otherwise it works perfectly > > -- > > regards > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: updating models
On 17-Aug-07, at 6:35 AM, James Bennett wrote: >> So how do I do it? > > http://www.google.com/search?hl=en=sql+alter+table=Google > +Search an example: http://www.djangosnippets.org/snippets/188/ -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: updating models
On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So how do I do it? http://www.google.com/search?hl=en=sql+alter+table=Google+Search -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: updating models
On 17-Aug-07, at 6:15 AM, [EMAIL PROTECTED] wrote: > There seems to be some trickery in updating a model that already has > database entries. There is no trickery involved. One thing people forget is that Django is a framework made up of python, sql, html, css and javascript. It simplifies and makes tasks easier, but in the last analysis, it is still python, sql, html, css and javascript. One of the givens in sql is the necessity of altering database structure after going into production. So far, django devels have not found a safe and sure way of automating the alteration made within a table - although there are several projects to implement schema evolution going. So in this case you do what you would anyway - fall back on sql and do it 'the hard way'. When you make a change within a model, run sqlall before the change, run sqlall after the change, compare the two, create a script to change the table and manually run that. -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: updating models
On 8/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > That mentions syncdb will never alter tables, because of ambiguity. > > So how do I do it? The problem you are referring to is schema evolution - evolving the database schema for a Django model over time. Search the archives and you will find multiple projects currently underway that are attempting to resolve this issue. In the absence of one of these projects, the solution is to either: 1) Use the SQL ALTER TABLE statement to change your model, or 2) Use a combination of loaddata, dumpdata, recreating tables and manual data modification. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
oracle and syncdb
Anyone getting syncdb to work with Oracle and the current django trunk? My tables are generated, then... ...blah blah... File "/dept/training/lib/python2.4/site-packages/django/db/backends/ oracle/base.py", line 122, in execute return Database.Cursor.execute(self, query, params) cx_Oracle.DatabaseError: ORA-01400: cannot insert NULL into ("LOIS_DJANGO"."DJANGO_CONTENT_TYPE"."ID") It seems like the triggers for the "django tables" are never created. Anyone see this kind of problem? Is anyone using django and the current trunk in production or heavy development? David --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
updating models
Hi, There seems to be some trickery in updating a model that already has database entries. Right now, in early development, I'm just erasing everything and calling sqlreset or sqlclear on a model to update it. This is clearly bad for a live site. There is a note here: http://www.djangoproject.com/documentation/django-admin/#sqlclear-appname-appname That mentions syncdb will never alter tables, because of ambiguity. So how do I do it? Ivan --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Nesh Thumbnail - Not displaying correct dimensions
On 16-Aug-07, at 9:02 PM, Greg wrote: > When the image gets uploaded the name of the image is myphototest- > photo-none (without auto_rename attribute). Isn't none supposed to be > the object pk. Shouldn't that be a 1,2,3 etc instead of none? i'm afraid i cant help you further - I have been using Nesh Thumbnail right from it's first release, and the only issues i have faced is when there were spaces and unusual characters in the filename. Otherwise it works perfectly -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
mutual exclusion
hey, how is everyone handling mutual exclusion between server threads in django? is there a built-in method i'm missing? derek --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: management.flush, load_data etc. what to use instead?
On 8/17/07, eXt <[EMAIL PROTECTED]> wrote: > >>> from django.core import management > >>> management.flush(verbosity=0, interactive=False) > >>> management.load_data(['test_data'], verbosity=0) Hi Jakub, Sorry for the inconvenience here - especially after I just gave you that piece of advice a few days go. If it's any consolation, the new infrastructure opens up a whole lot of possibilities for end users writing applications that integrate with Django itself. The new form looks something like: >>> from django.core.management import call_command >>> call_command('flush', verbosity=0, interactive=False) >>> call_command('load_data', ['test_data'], verbosity=0) Again - sorry for stepping on toes here. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: A "revision-controlled field" type?
this does sound quite usefullet us know if you find one and/or roll your own. :) Tim Chase wrote: >> I'm not sure I really understand. It sort of sounds like you are >> talking about a CharField with a choices argument. Is what you're >> looking for more complex? > > No...a "choices" argument assumes you know what you want in the > field beforehand...yes, I'm looking for a headache :) > >> Can you describe it in more detail? > > It would be like a TextField that behaves like the contents of an > RCS ",v" file. As the item is saved, past revisions are > maintained and only deltas are applied. Past revisions can be > extracted. Much like your average wiki edit-field. > > Theoretically, one could bind to an existing library like the > "bzr" revision-control libraries (graciously already written in > Python), mercurial/hg (also written mostly in python), SVN or CVS > (providing python interfaces, but to non-Django-DB backend > storage from my understanding) and hook into their ability to > manage the content as revisions. Even a "rcs.py" or something > like that would be sufficient as long as it could work with a > string-object rather than having to marshall files. > > Such fields would have ways of extracting various revisions and > differences between revisions. > > Sample usage of this imaginary field type (adjust for > apropriateness): > > > class Foo(Model): >title = CharField(maxlength=42) >body = RevisionControlField() > > > >>> f = Foo.objects.create(title='This is a test', body=""" > ... line 1 > ... Hello world > ... line 3 > ... """) > ... > >>> f.save() > >>> f.body = """ > ... line 1 > ... Goodbye world > ... line 3 > ... """) > >>> f.save() > >>> f.body = """ > ... line 1 > ... Aloha world > ... line 3 > ... """) > >>> f.body.diff() > [output showing "Goodbye" -> "Aloha" in your favorite diff > format, or perhaps a "diff" object] > >>> f.body.diff(1) #diff with > [output showing "Hello" -> "Aloha" in your favorite diff format, > or perhaps a "diff" object] > >>> f.body.revert() # now back at version 2 with "Goodbye" > >>> f.body[1] > """ line 1 >Hello world >line 3 >""" > >>> f.body.revisions > 2 > > > > > Hope this clarifies what I'm hunting for. Thanks though! > > -tim > > > > > > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Cache middleware causing unit tests to fail
Hi, request.template is None instead of what it should be because the response is from the cache middleware. Which is fine. My question is there a good way to disable the cache middleware during tests? "good" being atleast the following. is automatic, isn't based of value of DEBUG, doesn't require changing django distro. Is there a special settings file or other file imported during tests only? thanks, njharman --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django-cart integration?
Thats absolutely it. Validated and no errors found. Great stuff. I was sure I'd searched for Teacher and couldn't find anything. Thanks again for your help. On Aug 16, 8:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If I remember this correctly, Talk is the item being sold in the > store, and it has a foreignkey relationship with Teacher... so that's > where you're getting your error. > > You don't need Talks (unless that's what you're selling). > Where it says from eshop.talks.models import Talk, you need to change > that to import the thing you're going to sell. > > On Aug 16, 1:12 pm, MikeHowarth <[EMAIL PROTECTED]> wrote: > > > Importing other bits of code is still fairly new to me, I only started > > looking at django last week. > > > I basically took the files out of subversion and created a dir > > structure like so: > > > /eshop/shop > > /eshop/cart <- django cart installed here > > /eshop/talks <- additional django cart files > > > Within my settings.py my installed apps looks like this: > > > INSTALLED_APPS = ( > > 'django.contrib.auth', > > 'django.contrib.contenttypes', > > 'django.contrib.sessions', > > 'django.contrib.sites', > > 'django.contrib.admin', > > 'django.contrib.flatpages', > > 'django.contrib.sitemaps', > > 'eshop.shop', > > 'eshop.cart', > > 'eshop.talks', > > ) > > > I've snipped the contents to keep it a readable length. All imports > > happen at the top of the page so hopefully this should give you an > > idea of whats going on. > > > Models follow: > > > eshop/shop/models.py > > > from django.db import models > > from django.contrib.sitemaps import Sitemap > > > import datetime > > > #more model logic snipped contents > > > eshop/cart/models.py > > > from eshop.talks.models import Talk > > > PRICE=12 # All units have a price of $12 for now. > > > class Item: > > > #snipped contents > > > eshop/talks/models.py > > > from django.contrib.sites.models import Site > > from django.db import models > > from django.conf import settings > > > class Talk(models.Model): > > > #snipped contents > > > On Aug 16, 5:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > I've got it set up, but it's not plug and play... it's tied fairly > > > closely to a model you don't have. > > > It's trying to import Teacher from that model. You need to import your > > > stuff from your models. > > > > On Aug 16, 3:02 am, "Jon Atkinson" <[EMAIL PROTECTED]> wrote: > > > > > On 8/15/07, MikeHowarth <[EMAIL PROTECTED]> wrote: > > > > > > Does anyone have experience of integrating django-cart in to an app? > > > > > > I've tried adding this to my project, however soon as I use runserver > > > > > I get issues with the models: > > > > > > name 'Teacher' is not defined > > > > > > Anyone any idea? > > > > > Could you paste the output of ./manage.py validate, and your models.py > > > > file for each of your apps? It sounds like you're just missing an > > > > import statement somewhere. > > > > > --Jon --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Feds Train Clergy To "Quell Dissent" During Martial Law Shocking KSLA 12 news report confirms story we broke last year, Pastors to cite Romans 13 as reason for public to obey government orders, relinq
Feds Train Clergy To "Quell Dissent" During Martial Law Shocking KSLA 12 news report confirms story we broke last year, Pastors to cite Romans 13 as reason for public to obey government orders, relinquish guns and be taken to camps during state of emergency Prison Planet | August 16, 2007 Paul Joseph Watson A shocking KSLA news report has confirmed the story we first broke last year, that Clergy Response Teams are being trained by the federal government to "quell dissent" and pacify citizens to obey the government in the event of a declaration of martial law. In May 2006, we exposed the existence of a nationwide FEMA program which is training Pastors and other religious representatives to become secret police enforcers who teach their congregations to "obey the government" in preparation for the implementation of martial law, property and firearm seizures, mass vaccination programs and forced relocation. A whistleblower who was secretly enrolled into the program told us that the feds were clandestinely recruiting religious leaders to help implement Homeland Security directives in anticipation of a a potential bio-terrorist attack, any natural disaster or a nationally declared emergency. (Article continues below) The first directive was for Pastors to preach to their congregations Romans 13, the often taken out of context bible passage that was used by Hitler to hoodwink Christians into supporting him, in order to teach them to "obey the government" when martial law is declared. It was related to the Pastors that quarantines, martial law and forced relocation were a problem for state authorities when enforcing federal mandates due to the "cowboy mentality" of citizens standing up for their property and second amendment rights as well as farmers defending their crops and livestock from seizure. It was stressed that the Pastors needed to preach subservience to the authorities ahead of time in preparation for the round-ups and to make it clear to the congregation that "this is for their own good." Pastors were told that they would be backed up by law enforcement in controlling uncooperative individuals and that they would even lead SWAT teams in attempting to quell resistance. Though some doubted the accuracy of this report at the time due to its fundamentally disturbing implications, the story has now been confirmed by a KSLA 12 news report , in which participating clergy and officials admit to the existence of the program. Watch the video. The report entertains the scenario of martial law as depicted in the movie The Siege and states that "quelling dissent would be critical." Dr. Durell Tuberville serves as chaplain for the Shreveport Fire Department and the Caddo Sheriff's Office. Tuberville said of the clergy team's mission, "the primary thing that we say to anybody is, 'let's cooperate and get this thing over with and then we'll settle the differences once the crisis is over.'" Such clergy response teams would walk a tight-rope during martial law between the demands of the government on the one side, versus the wishes of the public on the other. "In a lot of cases, these clergy would already be known in the neighborhoods in which they're helping to diffuse that situation," assured Sandy Davis. He serves as the director of the Caddo-Bossier Office of Homeland Security and Emergency Preparedness. For the clergy team, one of the biggest tools that they will have in helping calm the public down or to obey the law is the bible itself, specifically Romans 13. Dr. Tuberville elaborated, "because the government's established by the Lord, you know. And, that's what we believe in the Christian faith. That's what's stated in the scripture." Screenshot from the KSLA 12 news article that accompanies the video report ( http://www.ksla.com/Global/story.asp?S=6937987 ). So there you have it - Homeland Security are working with local police departments and religious leaders to prepare for the declaration of martial law and in particular developing techniques they will employ during the crisis to "quell dissent." Phony Christian leaders are brainwashing their congregations to accept the premise that the totalitarian police state is "of the Lord" and that they should get on their knees and lick jackboots while the round-ups take place as citizens are processed into quarantine zones and detention camps by the National Guard and U.S. troops returning from Iraq. The precedent for mass gun confiscation and martial law in times of a real or manufactured emergency was set during Hurricane Katrina, when police and National Guard patrols forced home owners - even in areas unaffected by the hurricane - to hand over their legally owned firearms at gunpoint . This is a clear precursor for the imminent declaration of a state of emergency, a scenario that President Bush codified in his recent Presidential Decision Directive of May 9th , which states in the event of a "catastrophic event" the President can take total control over the
Re: Newforms file upload
The change is just that this: form = MyForm(request.POST) changes to this: form = MyForm(request.POST, request.FILES) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: A "revision-controlled field" type?
I'm not sure I really understand. It sort of sounds like you are talking about a CharField with a choices argument. Is what you're looking for more complex? Can you describe it in more detail? On Aug 16, 4:06 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > Has there been any work on a "RevisionControlledField" type? > Likely, a standard text-field with some controls for selecting > versions or branches thereof, and saving becomes a bit complicated. > > I'm looking for ideas/suggestions/caveats for such a field (and > if such a beast already exists, perhaps simply reusing it instead > of rolling my own). > > Thanks, > > -tim --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: management.flush, load_data etc. what to use instead?
On 8/16/07, eXt <[EMAIL PROTECTED]> wrote: > I just updated to the current django's trunk and I noticed that > management.py has disappeared. Management is now a package with... > something inside ;). Ok, the quesiton is how to execute this code in > the new version: > > >>> from django.core import management > >>> management.flush(verbosity=0, interactive=False) > >>> management.load_data(['test_data'], verbosity=0) > See this message from Adrian on the developer's list: http://groups.google.com/group/django-developers/msg/752493e7dd47f937 A work in progress still, I believe, so possibly some changes yet to come. See the parent thread for all the details. Cheers, deryck -- Deryck Hodge Lead Developer, Product Development Washington Post.Newsweek Interactive --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Apache-Django server performance questions (Hardware, Cache, Memory)
Interesting question you raise here. In fact, I believe that memory is generally considered to be very important for these purposes (and it comes relatively cheap). I cannot substantiate that, however. Gypsy (specialized django) hosting from the django-maestro Jacob has the following configuration: Hardware: * Dual 2.0 Ghz Opteron * 8 GB RAM * 10,000 RPM SATA drives in a RAID 1 configuration Software: * Ubuntu 5.10 ("Breezy Badger") * PostgreSQL 8.0 * Apache 2 - Please consider posting this question to a more permanent / accessable location, since the question will remain topical for years to come. Don't know where though, since the django wiki is just related to code. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
management.flush, load_data etc. what to use instead?
Hi! I just updated to the current django's trunk and I noticed that management.py has disappeared. Management is now a package with... something inside ;). Ok, the quesiton is how to execute this code in the new version: >>> from django.core import management >>> management.flush(verbosity=0, interactive=False) >>> management.load_data(['test_data'], verbosity=0) Regards -- Jakub Wiśniowski --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: A "revision-controlled field" type?
Not the same, but interesting: http://code.djangoproject.com/wiki/AuditTrail In general, I'd be tempted to make a file-based svn repo and map app/model/field into a URL, rather than try to make my own system. :) On 8/16/07, Tim Chase <[EMAIL PROTECTED]> wrote: > > Has there been any work on a "RevisionControlledField" type? > Likely, a standard text-field with some controls for selecting > versions or branches thereof, and saving becomes a bit complicated. > > I'm looking for ideas/suggestions/caveats for such a field (and > if such a beast already exists, perhaps simply reusing it instead > of rolling my own). --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
A "revision-controlled field" type?
Has there been any work on a "RevisionControlledField" type? Likely, a standard text-field with some controls for selecting versions or branches thereof, and saving becomes a bit complicated. I'm looking for ideas/suggestions/caveats for such a field (and if such a beast already exists, perhaps simply reusing it instead of rolling my own). Thanks, -tim --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Apache-Django server performance questions (Hardware, Cache, Memory)
Hi, I want to assemble a powerful Django server and had some questions on how to best I can spend my $ on Hardware/Server to get higher performance in general on my Django Server. My Django site is a CRM web application serving tons of data. In order to make it as scalable and responsive as possible, DB server (Postgresql) will have its own beefy dedicated server with tons of memory and processing power. Also we have moved a lot of functionality to stored procedures on Postgresql using PG/plSQL to lower the number of hits/requests to DB. Now the question is about Django server. Will my Django server be handling a lot of (if any) pressure having the situation above? What kind of hardware should I use for Django? Should I use AMD Opteran or XEON (dual cores)? Should I use dual socket servers each having Dual Core CPUs or only one Dual Core is enough? Is this extra processing power going to help me at all or I am throwing my money away? What about memory? For such a dynamic application like a CRM which has a lot of DB activity which is always changing, how having more memory on Django/Webserver can help? I was thinking of 2GB RAM as I do not see the value of memory here. How does caching of Django level server helps in my situation? Imagine SalesForce.com/or Gmail on Django. (I will serve static files on another Http Server). Appreciate any comment. Sia --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Clean Up your Operating System
Optimize your operating system, minimize background activities, repair registry base, uninstall unnecessary components, get rid of boring errors and make your operating system safer. http://windowsxpsp2pro.blogspot.com --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django-cart integration?
If I remember this correctly, Talk is the item being sold in the store, and it has a foreignkey relationship with Teacher... so that's where you're getting your error. You don't need Talks (unless that's what you're selling). Where it says from eshop.talks.models import Talk, you need to change that to import the thing you're going to sell. On Aug 16, 1:12 pm, MikeHowarth <[EMAIL PROTECTED]> wrote: > Importing other bits of code is still fairly new to me, I only started > looking at django last week. > > I basically took the files out of subversion and created a dir > structure like so: > > /eshop/shop > /eshop/cart <- django cart installed here > /eshop/talks <- additional django cart files > > Within my settings.py my installed apps looks like this: > > INSTALLED_APPS = ( > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.admin', > 'django.contrib.flatpages', > 'django.contrib.sitemaps', > 'eshop.shop', > 'eshop.cart', > 'eshop.talks', > ) > > I've snipped the contents to keep it a readable length. All imports > happen at the top of the page so hopefully this should give you an > idea of whats going on. > > Models follow: > > eshop/shop/models.py > > from django.db import models > from django.contrib.sitemaps import Sitemap > > import datetime > > #more model logic snipped contents > > eshop/cart/models.py > > from eshop.talks.models import Talk > > PRICE=12 # All units have a price of $12 for now. > > class Item: > > #snipped contents > > eshop/talks/models.py > > from django.contrib.sites.models import Site > from django.db import models > from django.conf import settings > > class Talk(models.Model): > > #snipped contents > > On Aug 16, 5:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > I've got it set up, but it's not plug and play... it's tied fairly > > closely to a model you don't have. > > It's trying to import Teacher from that model. You need to import your > > stuff from your models. > > > On Aug 16, 3:02 am, "Jon Atkinson" <[EMAIL PROTECTED]> wrote: > > > > On 8/15/07, MikeHowarth <[EMAIL PROTECTED]> wrote: > > > > > Does anyone have experience of integrating django-cart in to an app? > > > > > I've tried adding this to my project, however soon as I use runserver > > > > I get issues with the models: > > > > > name 'Teacher' is not defined > > > > > Anyone any idea? > > > > Could you paste the output of ./manage.py validate, and your models.py > > > file for each of your apps? It sounds like you're just missing an > > > import statement somewhere. > > > > --Jon --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: mysql/pkg_resources problem
On 8/16/07, Greg Donald <[EMAIL PROTECTED]> wrote: > I have a new Django setup I'm trying to finish up the install for. > I'm getting this error: > > Error loading MySQLdb module: No module named pkg_resources I figured it out. I built my MySQL from source but forgot to add an entry into my /etc/ld.so.conf. # cat /etc/ld.so.conf /usr/local/lib /usr/local/mysql/lib/mysql -- Greg Donald http://destiney.com/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using queryset values() spanning relationships
That works perfectly, thanks. I was going about it the wrong way with values(). On Aug 14, 7:16 pm, Collin Grady <[EMAIL PROTECTED]> wrote: > Author.objects.filter(book__publisher__id=1).distinct() doesn't work? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
mysql/pkg_resources problem
I have a new Django setup I'm trying to finish up the install for. I'm getting this error: Error loading MySQLdb module: No module named pkg_resources I can load pkg_resources on the command line with no problems. > ipython In [1]: import sys In [2]: sys.path Out[2]: ['', '/usr/local/bin', '/usr/local/lib/python2.5/site-packages/setuptools-0.6c5-py2.5.egg', '/usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg', '/usr/local/lib/python2.5/site-packages/simplejson-1.7.1-py2.5-linux-i686.egg', '/usr/local/lib/python2.5/site-packages/boto-0.9b-py2.5.egg', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/python2.5/plat-linux2', '/usr/local/lib/python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/PIL', '/usr/local/lib/python2.5/site-packages/IPython/Extensions', '/root/.ipython'] Seem like the paths are sufficient. I'm using Django -r 5833 from svn if that helps any. I've tried rebuilding and install MySQL_python a couple times. I've rebuilt Python 2.5 from source a couple times. Any idea what else I might try? Thanks, -- Greg Donald http://destiney.com/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django-cart integration?
Importing other bits of code is still fairly new to me, I only started looking at django last week. I basically took the files out of subversion and created a dir structure like so: /eshop/shop /eshop/cart <- django cart installed here /eshop/talks <- additional django cart files Within my settings.py my installed apps looks like this: INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', 'django.contrib.sitemaps', 'eshop.shop', 'eshop.cart', 'eshop.talks', ) I've snipped the contents to keep it a readable length. All imports happen at the top of the page so hopefully this should give you an idea of whats going on. Models follow: eshop/shop/models.py from django.db import models from django.contrib.sitemaps import Sitemap import datetime #more model logic snipped contents eshop/cart/models.py from eshop.talks.models import Talk PRICE=12 # All units have a price of $12 for now. class Item: #snipped contents eshop/talks/models.py from django.contrib.sites.models import Site from django.db import models from django.conf import settings class Talk(models.Model): #snipped contents On Aug 16, 5:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've got it set up, but it's not plug and play... it's tied fairly > closely to a model you don't have. > It's trying to import Teacher from that model. You need to import your > stuff from your models. > > On Aug 16, 3:02 am, "Jon Atkinson" <[EMAIL PROTECTED]> wrote: > > > On 8/15/07, MikeHowarth <[EMAIL PROTECTED]> wrote: > > > > Does anyone have experience of integrating django-cart in to an app? > > > > I've tried adding this to my project, however soon as I use runserver > > > I get issues with the models: > > > > name 'Teacher' is not defined > > > > Anyone any idea? > > > Could you paste the output of ./manage.py validate, and your models.py > > file for each of your apps? It sounds like you're just missing an > > import statement somewhere. > > > --Jon --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Site Map template required?
Malcolm Thanks for your comments, indeed changing to use the sitemap view, then returns a template does not exist error. If I create a sitemap.xml file in my templates directory I then bypass this. What I'm struggling with is that the documentation suggests that the feed is automatically generated. Is it then down to me to mark up a template and output the objects and if so whats the naming of the object thats passed? This is something that seems to have been skipped totally in the docs. Regards Mike On Aug 16, 5:47 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-08-15 at 12:52 -0700, MikeHowarth wrote: > > I've read through the site maps documentation, and seem to have > > followed it to the letter, however I've getting a NoReverseMatch at / > > sitemap.xml error. > > Where are you getting this error from? It's not really enough to report > the error without the location. The traceback will tell you the > location. The only place I can see it might be occurring is in > contrib/sitemaps/views.py and that suggests you URL setup isn't correct: > > [...] > > > urlpatterns = patterns('', > > (r'^sitemap.xml$', 'django.contrib.sitemaps.views.index', > > {'sitemaps': sitemaps}), > > ) > > The docs I'm looking at (in the subversion source) say to add a line > that says > > (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', > {'sitemaps': sitemaps}) > > if you are creating one file or, if you are using the index version, you > need to have two URLconf entries, the second one looking something like > (again, from the docs): > > (r'^sitemap-(?P.+).xml$', > 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}) > > In both cases, the import thing is that > django.contrib.sitemaps.views.sitemap appears in your URL conf. This si > not the case with the example you've given. > > Regards, > Malcolm > > -- > Depression is merely anger without > enthusiasm.http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: 'dict' object has no attribute 'rindex'
Sorry about that. I figured out what the problem was. It seems like that usually happens AFTER I post to a newsgroup. Anyway, thanks! On Aug 16, 12:19 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 8/16/07, Ryan K <[EMAIL PROTECTED]> wrote: > > > I am using Django 0.96 and I am getting this error. Any ideas as to > > why? > > No, because we're not mind-readers ;) > > In order to help you track down an error, we need to know: > > 1. What you were trying to do. > 2. How you were trying to do it (e.g., paste in some code). > 3. Exactly what error you were getting (e.g., paste in the traceback). > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: (1040, 'Too many connections')
Hi guys! First of all, thanks for all help, I was busy on a project last week and could not dig into the problem. Let me remeber the thread, I having a problem, sometimes my server stuck and goes down, just before it happens, I receive many messages telling "Too many connections". I use apache + mod_python combination on a Suse server, the version of my package is: apache2-mod_python-3.1.3-60 apache2-prefork-2.2.0-21.7 mysql-5.0.18-20.8 python-2.4.2-18.10 django-0.96-pre MySQLdb-1.2.1_p2 [*] [*] the version of MySQLdb is an older version that do not get messy with my character set I didn´t get any other stuck after august, 8 (my last message) but I´m disabling traceback email messages on fridays and re-enabling on mondays. The RAM usage oscilate between 1GB and 3GB during these period, I think it is ok. I don´t use MaxRequestPerChild directive, is it a good practise? I read recomendations to change from apache+mod_python to apache +mod_wsgi, this way I will have just one instance of python (am I right?), reather than n instances created by apache/mod_python. Thanks for all help! I wrote the traceback bellow: Traceback (most recent call last): File "/usr/lib64/python2.4/site-packages/django/core/handlers/ base.py", line 74, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib64/python2.4/site-packages/django/utils/ decorators.py", line 20, in _wrapped_view response = view_func(request, *args, **kwargs) File "/home/mrape/django/portal/common/views.py", line 56, in home context['sponsored'] = (sponsored and sponsored[0]) or None File "/usr/lib64/python2.4/site-packages/django/db/models/query.py", line 100, in __len__ return len(self._get_data()) File "/usr/lib64/python2.4/site-packages/django/db/models/query.py", line 430, in _get_data self._result_cache = list(self.iterator()) File "/usr/lib64/python2.4/site-packages/django/db/models/query.py", line 170, in iterator cursor = connection.cursor() File "/usr/lib64/python2.4/site-packages/django/db/backends/mysql/ base.py", line 100, in cursor self.connection = Database.connect(**kwargs) File "/usr/local/lib64/python2.4/site-packages/MySQLdb/__init__.py", line 75, in Connect return Connection(*args, **kwargs) File "/usr/local/lib64/python2.4/site-packages/MySQLdb/ connections.py", line 164, in __init__ super(Connection, self).__init__(*args, **kwargs2) OperationalError: (1040, 'Too many connections') --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: 'dict' object has no attribute 'rindex'
On 8/16/07, Ryan K <[EMAIL PROTECTED]> wrote: > I am using Django 0.96 and I am getting this error. Any ideas as to > why? No, because we're not mind-readers ;) In order to help you track down an error, we need to know: 1. What you were trying to do. 2. How you were trying to do it (e.g., paste in some code). 3. Exactly what error you were getting (e.g., paste in the traceback). -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django-cart integration?
I've got it set up, but it's not plug and play... it's tied fairly closely to a model you don't have. It's trying to import Teacher from that model. You need to import your stuff from your models. On Aug 16, 3:02 am, "Jon Atkinson" <[EMAIL PROTECTED]> wrote: > On 8/15/07, MikeHowarth <[EMAIL PROTECTED]> wrote: > > > > > Does anyone have experience of integrating django-cart in to an app? > > > I've tried adding this to my project, however soon as I use runserver > > I get issues with the models: > > > name 'Teacher' is not defined > > > Anyone any idea? > > Could you paste the output of ./manage.py validate, and your models.py > file for each of your apps? It sounds like you're just missing an > import statement somewhere. > > --Jon --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
'dict' object has no attribute 'rindex'
I am using Django 0.96 and I am getting this error. Any ideas as to why? Thanks, Ryan --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Clash of related_names among two tables
On 8/16/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > So - you can use the same related name multiple times - BUT - the same > related name can't be added to a single model more than once. I see - each reference to the same model from different models has to have an unique related_name which may not clash with any attribute's name of referred model including self-reference if any. > Hope this clarifies things a bit. Yes, it does. Thank you very much for prompt and detail explanation. Peter --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Nesh Thumbnail - Not displaying correct dimensions
Kenneth, I renamed the image to 'abc' and it still didn't work. I added 'auto_rename=False' to the ImageWithThumbnailField' and it still doesn't display the image correctly. When the image gets uploaded the name of the image is myphototest- photo-none (without auto_rename attribute). Isn't none supposed to be the object pk. Shouldn't that be a 1,2,3 etc instead of none? Thanks On Aug 16, 12:06 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 16-Aug-07, at 8:05 AM, Greg wrote: > > > The file I uploaded was called 'IMG_0090'. When I looked in the site- > > media folder it has been renamed to 'myphototest-photo-none' > > try an image without '_' or spaces or special characters in the name > > -- > > regards > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Multiple Edit
Christopher, In your case, I would create a custom view/form extending the templates of admin and would set the url of that view to something like r'^/admin/obj_list/$'. Regards, Aidas Bendoraitis [aka Archatas] On 7/21/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 21-Jul-07, at 4:42 PM, Christopher wrote: > > > Can no one out there help me with this or is this just a really stupid > > question? > > you should be patient and wait for an answer - I personaly try never > to ask questions on a friday as the reply may only come on > tuesday ;-) As for your question, it cant be done without hacking > admin. However, it just takes a few lines of code to do it outside > admin. > > -- > > regards > kg > http://lawgon.livejournal.com > http://nrcfosshelpline.in/web/ > > > > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Changing database structue
On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Oh. That's a real ouch. I really hoped I can avoid that. Well, consider this: Anything which *isn't* SQL and which is used to do this job must -- in order to cover all the necessary use cases -- be as complex as SQL, or evolve to the point where it is. At which point I personally wonder why people bother with replacements for it; ALTER TABLE is not that hard to learn, but for some reason a lot of folks would rather be set on fire than have to use it... -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Clash of related_names among two tables
On 8/16/07, Peter Melvyn <[EMAIL PROTECTED]> wrote: > > Hi all, > > please, could anybody confirm my experience with related_names. I > tried to find-out some information about it and found invalid model > example. > > If my understanding is correct, then it is not possible to have the > same related_names in two different models. Is it correct? Put it this way: When you define a model, you specify a bunch of field names. For (obvious) Python reasons, the field names must all be unique. When you have a ForeignKey or ManyToManyField, you have the option of adding a 'related_name' argument; the name use specify effectively gets added to the model that the related field is pointing at. However, even though the 'related_name field' isn't actually present in the model definition, the same uniqueness rules apply - a model can't have multiple fields with the same name. So: This is legal: class FirstModel(Model): name = CharField() class SecondModel(Model): name = CharField() class ThirdModel(Model): field1 = ForeignKey(FirstModel, related_name='foo') field2 = ForeignKey(SecondModel, related_name='foo') because FirstModel will get a 'foo' attribute, and SecondModel will get a 'foo' attribute, but neither causes a name clash. However: class FirstModel(Model): field1 = ForeignKey(ThirdModel, related_name='foo') name = CharField() class SecondModel(Model): field2 = ForeignKey(ThirdModel, related_name='foo') class ThirdModel(Model): name = CharField() is NOT legal, because ThirdModel would need to have two fields called 'foo'. So - you can use the same related name multiple times - BUT - the same related name can't be added to a single model more than once. Hope this clarifies things a bit. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Logout with TestClient
On 8/16/07, eXt <[EMAIL PROTECTED]> wrote: > > Ok, I've got a logout method that should (IMHO) be added to client.py. > I can generate patch from it. But what form should have a test and a > documentation? * Test: add a test case to /tests/modeltests/test_client that validates that logout works. The existing tests for the login function should give you an idea of what sort of thing is required. * Documentation: /docs/testing.txt will require a short description of the new logout function. Again, follow the lead of the login function. The whole lot - code changes, test and docs should all be wrapped up in the same diff you produce with svn diff. Also, don't forget to open a ticket to track the change, and provide somewhere to store your patch. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
## Great 2nd Income from Home- $500 per processed FHA refund - NET DETECTIVE @@ only $20 as a Bonus, a 33% savings!!
## Great 2nd Income from Home- $500 per processed FHA refund - NET DETECTIVE @@ only $20 as a Bonus, a 33% savings!! Great Work at Home Opportunity: Earn up to $500 for each refund you process. The Federal Government originated this opportunity. We just updated the FHA refund records with more than 700,000 unclaimed refunds!! CA over 60,000 FL over 50,000 IL more than 39,000 OH over 20,000 NY more than 25,000 TX over 50,000 Our program offers the most comprehensive 10 chapter Manual with FREE entire state lists of unclaimed FHA refunds. NEW American Refund Services now can supply the current address and phone number for any FHA refund recipient, as well as, for anyone else you might wish to locate or contact. The current address & phone number is GUARANTEED!!! IN ORDER TO CONTACT the FHA refund recipient to increase your PROFITS. For details visit: http://www.AmericanRefundServices.com and read http://ezinearticles.com/?The-Truth-Behind-Processing-FHA-Insurance-Refu nds=24002 Never pay a 25%+ fee to claim your lost or unclaimed Property. Visit the web's premier site with over 175 online databases with over 125 million unclaimed accounts. http://www.Unclaimed-Databases.com http://ezinearticles.com/?id=59698 http://ezinearticles.com/?id=59713 Or, for the most thorough reports and search for a specific type of Lost Asset. Visit: http://www.Asset-Recovery-Service.com --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Formatting Errors
Hello, I have searched high and low and have not been able to find a way to get the form errors to display the label/verbose_name. As of now the {{ GeneralForm.errors }} prints a of the field name and errors listed for the field. This output is fine but I would like the label/ verbose_name to be displayed and not the name of the DB field. Here is my current model: class Generic(models.Model): CaseNumber = models.CharField(verbose_name='Case Number', maxlength=50) User = models.ForeignKey(User, editable=False) Fname = models.CharField(verbose_name='First Name', maxlength=100, null=True, blank=True) Lname = models.CharField(verbose_name='Last Name', maxlength=100, null=True, blank=True) Mname = models.CharField(verbose_name='Middle Name', maxlength=100, null=True, blank=True) View: def generic_form(Request, CaseID = 0): data_content = {} data_content['CaseID'] = CaseID if CaseID == 0: oGenericForm = form_for_model(Generic, formfield_callback=generic_callback) else: oGeneric = Generic.objects.get(id=CaseID) oGenericForm = form_for_instance(oGeneric, formfield_callback=generic_callback) if Request.method == 'POST': if Request.POST.has_key('frmSaveGeneral'): oForm = oGenericForm(Request.POST) if oForm.is_valid(): oGeneric = oForm.save(commit=False) if CaseID == 0: oGeneric.User_id = Request.user.id Request.user.message_set.create(message="The new case was sucessfully saved.") oGeneric.save() return HttpResponseRedirect('/system/case/%i/' % oGeneric.id) else: Request.user.message_set.create(message="The case details were sucessfully saved.") oGeneric.save() else: oForm = oGenericForm() else: oForm = oGenericForm() data_content['GeneralForm'] = oForm return render_to_response('system/case/general.htm', data_content, context_instance=RequestContext(Request)) Template (small section): {% if messages %} {% for message in messages %} {{ message }} {% endfor %} {% else %} {% if GeneralForm.errors %} The following error occurred: {{ GeneralForm.errors }} {% endif %} {% endif %} Any ideas would be most appreciated. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Webcool24.com : Biggest worldwide Asian free Video multi language web , Travel, Sports, Racing cars , Massages techniques, Games , Fashions, Jokes , Top models , Free online IT learning , 5000 li
Hi , I'd like to introduce you a biggest Asian free Video multi language entertainment website: http://www.webcool24.com/ Best regards. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Clash of related_names among two tables
Hi all, please, could anybody confirm my experience with related_names. I tried to find-out some information about it and found invalid model example. If my understanding is correct, then it is not possible to have the same related_names in two different models. Is it correct? Thanks, Peter --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
ANN: simple home accounting at madatidal.cz
Hello, we just launch Madatidal.cz site, which is Django powered application for simple home accounting. Madatidal.cz is targeted to all people, which need to evidence personal income/outcome in simply manner. You could enter records with any number of tags, note, amount and date. All of this is realized in nice design, with many Javascript helpers. For now there is only czech variant, but we have plan to release it in some other languages in the future. If you have taste, register your own account at http://www.madatidal.cz/ucet/registrace/ English translation of registration form fields: * Název účtu: Name of the account * E-mail: Your email address * Heslo: Password * Heslo znovu: Same password again After filling form, you will receive email with activation URL. At activation page you must put your password. Any suggestion are welcome. Regards Michal --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Changing database structue
It might be worth reading the wiki page on the Schema Evolution [1], and if you're not using SVN, there is a patch [2] against Django 0.96 which implements schema evolution. Other than that, you might want to look into dmigrate [3] (which I've not personally used, so I'm not sure how mature it is), and this [4] snippet might help, too. --Jon [1] http://code.djangoproject.com/wiki/SchemaEvolution [2] http://kered.org/blog/2007-07-19/django-schema-evolution/ [3] http://code.google.com/p/dmigrate/ [4] http://www.djangosnippets.org/snippets/167/ On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Oh. That's a real ouch. I really hoped I can avoid that. > > Thanks anyhow. > > > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Logout with TestClient
On 16 Sie, 01:52, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: (...) > No, there isn't a logout method. However, if there were to be one, > resetting the cookie is about all it would need to do. Deleting the > old session would be another possible action, although it isn't > absolutely required. You mean something like: Session.objects.get(session_key=c.cookies['sessionid'].value).delete() c.cookies = SimpleCookie() > This issue should probably be logged, so that it isn't forgotten. If > you want to try your hand at a patch (including tests and docs), it > should be a fairly easy fix. Ok, I've got a logout method that should (IMHO) be added to client.py. I can generate patch from it. But what form should have a test and a documentation? regards Jakub Wiśniowski --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Datetimefield error using form_as_model
Hi, I am using a form_as_model with newforms and when I do a save I get the following error message on the form: format is %Y-%m-%d %H:%M:%S. This occurs with the event_date field. Can you someone point me in the right direction to help me resolve this issue. Here are snippets of my models and views models.py # Events class Events(models.Model): city_name = models.ForeignKey(Cities) event_name = models.CharField(maxlength=250) event_details = models.TextField() event_date = models.DateTimeField() contact_name = models.CharField(maxlength=100, null=True, blank=True) contact_phone = models.PhoneNumberField(null=True, blank=True) contact_url = models.CharField(maxlength=100, null=True, blank=True) location = models.CharField(maxlength=100, null=True, blank=True) address = models.CharField(maxlength=255, null=True, blank=True) city = models.CharField(maxlength=100, null=True, blank=True) state = models.ForeignKey(States, null=True, blank=True) zip = models.CharField(maxlength=12, null=True, blank=True) owner = models.ForeignKey(User,related_name="owner",blank=True, editable=False) views.py AddEventFormClass = forms.form_for_model(Events) if request.method == 'POST': # If data was POSTed, we're trying to create a new Event. form = AddEventFormClass(request.POST) # Check for errors. print 'errors is ', form.errors if form.is_valid(): form.save() return HttpResponseRedirect("/tct/events/%s/" % city_id) The errors occur before the form.is_valid check Thanks, Jeff --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
MAKE BIG $$$ PROMOTING OUR WEBSITE!!!
Promote our site and you will be paid The fastest way to get paid is our popular Pay Per Click program. Pay Per Click earns you up to $1.00 per unique visitor per day, counted by a unique IP address and tracked with your account number (GPID). Earning cash is a no-brainer with our per member order program. Every premium member sign-up earns you a $85.00 payout. The only question is - how many memberships will you drive today? Sign up now for this speedy and simple way to earn today! For moRE INFO JUST CLICK HERE: http://adultfriendfinder.com/go/g885672-brk --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Changing database structue
Oh. That's a real ouch. I really hoped I can avoid that. Thanks anyhow. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Wrong return value when sending mail with test framework
On 8/16/07, Michael <[EMAIL PROTECTED]> wrote: > > Adding: > return len(messages) > to the TestSMTPConnection's send_messages method fixes the issue, but > maybe there's a reason I'm not aware of for not doing so in the test > framework? No particular reason. I dummied up the interface, but didn't consider the return values (since I can't say I personally have ever used the return value). I've just fixed this in [5899]. Thanks for the suggestion! Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Tagcloud for *all* TaggedItems
Hi, I thought I'll post my problem here too. Maybe someone had the same problem. I tried to add the usage_for_models()-function Era gave me into django-tagging(into .../site-packages/django_tagging/managers.py). I inserted it before the usage_for_model() -function and restartet the dev-server and the shell. I see the function in the manager (with ipython and tab completion) but I cannot call it on a Tag object: In [4]: Tag.objects.[tab] ... Tag.objects.usage_for_model ... In [4]: Tag.objects.usage_for_models() : 'TagManager' object has no attribute 'usage_for_models' As I said above, I already restarted the devserver, restartet the shell and deleted the old managers.pyc file. I also checked the file for the tab-vs-spaces issue but it should be ok (http://dpaste.com/16968/, line 53). Have someone an idea on what's going wrong? Kai --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Wrong return value when sending mail with test framework
I just wanted to check that what I'm seeing is actually an error before submitting a ticket: The SMTPConnection's send_messages method in django.core.mail returns the number of mails sent on success, whereas the TestSMTPConnection class in django.test.utils.py does not: def send_messages(self, messages): "Redirect messages to the dummy outbox" mail.outbox.extend(messages) If your view actually uses the value of Email.send() (to which the SMTPConnection.send_messages return value is propagated), then it will work fine normally, but not through the test framework. Adding: return len(messages) to the TestSMTPConnection's send_messages method fixes the issue, but maybe there's a reason I'm not aware of for not doing so in the test framework? -Michael --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: production instance on windowsxp
On Aug 16, 3:40 pm, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > Ask I have successfully try to run django apps on apache/mod_python/ > winxp, I learn that apache for winxp only support worker_mpm Actually, it only supports 'winnt' MPM, although that is effectively 'worker' with only one process. > oppose to > what django is suggesting (prefork_mpm). > > Should I worry about this? I'd simply suggest that you try it, but test your application thoroughly to ensure your application as a whole is thread safe. Whether one should use worker or prefork has been a partly contentious issue in the past, often because of me taking issue with the recommendation. What didn't make too much sense to me was that prefork was suggested over worker, yet there was never any warning that Windows couldn't be used, which is effectively worker as well. I can't find the post in the archives now, but end result of one of the discussions was that couldn't be 100 percent sure that there weren't some multithreading issues with Django, but there weren't any obvious ones known about. It is quite possible that some of the concerns about worker derived from problems with existed with multithreading in older versions of mod_python. Thus, as long as you use the latest version of mod_python and make sure any third party modules you use are also up to date, you may well have no problems. As I said though, important to make sure you test your application. Graham --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Tagcloud for *all* TaggedItems
I have thought about it. Both functions must be reimplemented completely: The same actions can be made in one single line of code, using Tag.objects.extra(select = ) construction with subquery. On 15 авг, 15:12, "Kai Kuehne" <[EMAIL PROTECTED]> wrote: > Thanks Era! > > On 8/15/07, Eratothene <[EMAIL PROTECTED]> wrote: > > > [Code] > > I think I will create a ticket. Maybe Jonathan can integrate > such a function directly into django-tagging. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django-cart integration?
On 8/15/07, MikeHowarth <[EMAIL PROTECTED]> wrote: > > Does anyone have experience of integrating django-cart in to an app? > > I've tried adding this to my project, however soon as I use runserver > I get issues with the models: > > name 'Teacher' is not defined > > Anyone any idea? Could you paste the output of ./manage.py validate, and your models.py file for each of your apps? It sounds like you're just missing an import statement somewhere. --Jon --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: CacheMiddleware and middleware orders matters
I have looked at the link you have given me. But I totally disagree, it looks like to me that the best order is ConditionalGet CacheMiddleware SessionMiddleware GZipMiddleware But django dies and it is a bug in django. I have made bug report with a patch http://code.djangoproject.com/ticket/5176 On 16 авг, 02:46, "Kai Kuehne" <[EMAIL PROTECTED]> wrote: > Hi Erarothene, > > On 8/16/07, Eratothene <[EMAIL PROTECTED]> wrote: > > > > > I am totally confused with CacheMiddleware docs and middleware docs. > > > I want to use such middlewares in project: > > ConditionalGetMiddleware > > GZipMiddleware - addes Vary on Accept-Encoding > > SessionMiddleware - addes Vary on Cookie > > CacheMiddleware - > > Fredrik Lundh wrote about it. If I recall correct, he had the same > problem:http://effbot.org/zone/zone-django-notes.htm --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---