Black Box Testing Framework for Django

2008-07-08 Thread Pepsi330ml
Hi All, I am reading up on how to use external testing framework on Django Web Application. Particularly, Black Box Testing. Anybody using any particular framework on Django? Please kindly advise. Currently, i am looking into using HttpUnit on Django. Thank you.

Re: What is the fastest way to come up to speed with Django?

2008-07-08 Thread ristretto.rb
Hi Malcolm, Thanks for the reply. I just spent the day banging through the admin code down to the oldform fields to track down a problem I was having. It took a very long time because I don't know Django under the hood, and I only have just started to learn Python. I can think of some

Re: "ImportError No module named django"

2008-07-08 Thread Julien Phalip
Apparently Django is not present in the PYTHONPATH and therefore not reachable by Python. I'm not a Mac user, but some help can be found on google. Try there for example: http://antoniocangiano.com/2007/12/22/how-to-install-django-with-mysql-on-mac-os-x/

Re: In admin, unable to save many-to-many relation objects with intermediate table

2008-07-08 Thread ristretto.rb
I'm using the svn version. I updated this morning. I can't remember if I was getting the error before I updated, or not. I have spent the day tracking this down (it's taken me all day because I don't know Django or Python very well, and I haven't been able to find a comprehensive IDE that is

memcached

2008-07-08 Thread gt7658b
Hello, I tried to use memcached as follow. BTW, memcached is running as seen from top command on server. CACHE_BACKEND = 'memcached://127.0.0.1:11211/' # CACHE_BACKEND = 'dummy:///' CACHE_MIDDLEWARE_SECONDS = 60*30 CACHE_MIDDLEWARE_KEY_PREFIX ='' CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

memcached

2008-07-08 Thread gt7658b
Hello, I tried to use memcached as follow. BTW, memcached is running as seen from top command on server. CACHE_BACKEND = 'memcached://127.0.0.1:11211/' # CACHE_BACKEND = 'dummy:///' CACHE_MIDDLEWARE_SECONDS = 60*30 CACHE_MIDDLEWARE_KEY_PREFIX ='' CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

Re: newforms-admin: root() takes exactly 3 arguments (2 given)

2008-07-08 Thread furby
hmm...seems obvious now that you mention it =). Thanks for the help guys. On Jul 7, 9:25 pm, Juanjo Conti <[EMAIL PROTECTED]> wrote: > furby escribió: > [...] > > > admin.site.root() takes3arguments: self, request, url. There is no > > way to specifyargumentsin urls.py, so I have no idea how

Re: Import issues since newforms-admin

2008-07-08 Thread Julien Phalip
Ok, I've just opened a ticket and posted some code illustrating the issue: http://code.djangoproject.com/ticket/7684 Thanks, Julien On Jul 9, 2:14 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-08 at 21:10 -0700, Julien Phalip wrote: > > Thanks for the tip Malcolm. > > >

Re: Import issues since newforms-admin

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 21:10 -0700, Julien Phalip wrote: > Thanks for the tip Malcolm. > > I've prepared some very simple code to illustrate the problem. I can't > find a way to attach files in this mailing list. Should I open a > ticket and post it there? Yes. Trac is the only place where

Re: Import issues since newforms-admin

2008-07-08 Thread Julien Phalip
Thanks for the tip Malcolm. I've prepared some very simple code to illustrate the problem. I can't find a way to attach files in this mailing list. Should I open a ticket and post it there? Thanks, Julien On Jul 9, 9:50 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-08 at

Re: Django, Apache, and CSS

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 9:47 PM, foo <[EMAIL PROTECTED]> wrote: > > First, I want to thank you for your reply Milan! I just recently > joined the group and I'm impressed at how active the group is and how > helpful all of the advice I've found here has been. > > I've made the changes that you

Re: Django, Apache, and CSS

2008-07-08 Thread Colin Bean
The blank page seems suspicious, as usually you'd be getting an error message if something was wrong with your configuration. What do you see if you view the source of that page? Perhaps there's an error in your HTML, like forgetting to close a tag. It's impossible to tell without seeing at

Re: In admin, unable to save many-to-many relation objects with intermediate table

2008-07-08 Thread Karen Tracey
On Tue, Jul 8, 2008 at 9:57 PM, ristretto.rb <[EMAIL PROTECTED]> wrote: > > More details. I'm using MySQL at the moment (but with a plan to move > to Postgresql.) The association table has a number of rows loaded > through these models, but not through my Django app directly. I used > the

Re: Django, Apache, and CSS

2008-07-08 Thread foo
First, I want to thank you for your reply Milan! I just recently joined the group and I'm impressed at how active the group is and how helpful all of the advice I've found here has been. I've made the changes that you suggested and unfortunately, I'm still seeing the same behavior. What I did

Re: Django, Apache, and CSS

2008-07-08 Thread foo
First, I want to say thank you for your reply Milan! I just recently joined the group and I'm impressed at how active the group and how helpful all of the advice I've found here has been. I've made the changes that you suggested and unfortunately, I'm still seeing the same behavior. What I did

Re: "ImportError No module named django"

2008-07-08 Thread MadMax007
Ok, for the PYTHONPATH I got: >>> import sys >>> print sys.path ['', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python25.zip', '/System/Library/Frameworks/Python.framework/Versions/ 2.5/lib/python2.5', '/System/Library/Frameworks/Python.framework/

Re: What is the fastest way to come up to speed with Django?

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 19:08 -0700, ristretto.rb wrote: > I leading a project based on Django, and I come from 12 years of Java, > and 0 years of Python. You won't get any crap from me, at least. The more languages people know, the better. > I'm currently digging into the django-trunk on many

Generic delete view.

2008-07-08 Thread William
Hi, I'm having a bit of trouble using the delete generic view in Django SVN. I have the following entry in my urlpatterns: from django.views.generic.create_update import * urlpatterns = patterns('', ... (r'^calendar/delete/(?P\d+)/$','delete_object',

What is the fastest way to come up to speed with Django?

2008-07-08 Thread ristretto.rb
I leading a project based on Django, and I come from 12 years of Java, and 0 years of Python. I'm currently digging into the django-trunk on many an occasion, trying to explain things that I can't find in the docs. Because I don't understand how Django was designed, and can't guess too

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-08 Thread Peter Herndon
For a more immediate answer, ask on #django on IRC. Mailing list may not answer as quickly as you'd prefer. Or at all, if nobody has the time to answer. You should look at the model documentation for specifics, but you likely need null=True as a param in your tags=Tagfield() declaration.

Re: connection.queries - show improper SQL?

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 17:43 -0700, Peter wrote: [...] > Is this Django-MySQL 5.x specific? Is this a full-on django bug? Neither. Any quoting and escaping of parameters in the query is done by the Python database wrapper. The DB API does not expose any public function to access how each

Re: In admin, unable to save many-to-many relation objects with intermediate table

2008-07-08 Thread ristretto.rb
More details. I'm using MySQL at the moment (but with a plan to move to Postgresql.) The association table has a number of rows loaded through these models, but not through my Django app directly. I used the Model classes in a script to pre load a bunch of data. Could this be the problem? On

Re: Problems using custom sql in manager

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 17:17 -0700, AJ wrote: > Thanks for your quick reply. I have been searching for a long time > for good documentation on using IN and paramaters with no luck. When > it worked with a list I assumed that was correct. Could you clarify > an example of transforming a list of

Re: does django cache models.py?

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 6:12 PM, Daehee <[EMAIL PROTECTED]> wrote: > > i'm trying it figure out why django is not recognizing a new models.py > file for my app. even when i completely butcher the code in models.py > or change the filename and run "manage.py sqlreset" or "manage.py > syndb," it

Re: elusive Post error

2008-07-08 Thread Jeff FW
Are you getting a particular error code, like 501 (not implemented)? I would check Apache's error logs, as the issue might be happening before Django ever gets the request. If nothing useful shows up in those logs, try increasing the logging level. Oh, just a note--you may want to strip secret

Re: In admin, unable to save many-to-many relation objects with intermediate table

2008-07-08 Thread ristretto . rb
OK, I took core=True off, and added it to the reference_no field. The problem seems to go away for the case when no there are no pre-existing joins. Clearly, I don't understand what core is for. I'll read the docs again, and see if it makes sense. However, it still errors with

Re: Django, Apache, and CSS

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 7:58 PM, foo <[EMAIL PROTECTED]> wrote: > > OK, I know this has been posted in the forums before, but for some > reason, I'm still struggling to get my CSS stylesheet applied to my > django templates. I'm hoping that if I post my configuration, someone > can point out what

Re: Django + tiny_mce

2008-07-08 Thread Mario
Lloyd, There's more than one way to skin a cat. It does not matter if you are using development server or apache. I have been using Tiny MCE for about a year now and I am happy with the setup. For flatpages, if you have admin rights to the server, you need to edit your flatpages model located

In admin, unable to save many-to-many relation objects with intermediate table

2008-07-08 Thread ristretto . rb
Hello, I'm stuck. Any help will be much appreciated. I followed http://www.djangoproject.com/documentation/models/m2m_intermediary/ to make a Many-to-many relationship via an intermediary table. class LeftSide(models.Model): : class RightSide(models.Model): : class JoinTable(models.Model):

In admin, unable to save many-to-many relation objects with intermidiate table

2008-07-08 Thread ristretto.rb
Hello, I'm stuck. Any help will be much appreciated. I followed http://www.djangoproject.com/documentation/models/m2m_intermediary/ to make a Many-to-many relationship via an intermediary table. class LeftSide(models.Model): : class RightSide(models.Model): : class JoinTable(models.Model):

Django, Apache, and CSS

2008-07-08 Thread foo
OK, I know this has been posted in the forums before, but for some reason, I'm still struggling to get my CSS stylesheet applied to my django templates. I'm hoping that if I post my configuration, someone can point out what I'm missing. I have my django project at: /opt/python/django-apps/foo/

Re: Django + tiny_mce

2008-07-08 Thread Chatchai Neanudorn
Ok, Got you. Where is retrun code for /tiny_mce/tiny_mce.jsitself, Did you mean all js under /tiny_mce cannot be loadded by django? What is environment you are working on? 2008/7/9 Chatchai Neanudorn <[EMAIL PROTECTED]>: >

connection.queries - show improper SQL?

2008-07-08 Thread Peter
When I look at generated sql from connection.queries, it doesn't show any quotes around strings. For example: >>> from django.db import connection >>> from django.contrib.auth.models import User >>> User.objects.filter(username="bob") [] >>> connection.queries[-1] {'time': '0.000', 'sql':

Re: Django + tiny_mce

2008-07-08 Thread Chatchai Neanudorn
http://192.168.1.4:8000/tiny_mce/tiny_mce.js vs [08/Jul/2008 19:37:23] "GET /tiny_mce/langs/en.js HTTP/1.1" 404 1771 What is "lang" at the right side? Chatchai 2008/7/9 LRP <[EMAIL PROTECTED]>: > > Hi, > > Thanks to all for responses, but puzzle persists... > > Mathias, I added the slash.

Re: Problems using custom sql in manager

2008-07-08 Thread AJ
Thanks for your quick reply. I have been searching for a long time for good documentation on using IN and paramaters with no luck. When it worked with a list I assumed that was correct. Could you clarify an example of transforming a list of items into something mysqldb would accept then

Re: Django + tiny_mce

2008-07-08 Thread LRP
Hi, Thanks to all for responses, but puzzle persists... Mathias, I added the slash. Still can't see the tiny_mce edit bar. But it does provide a clue: Output of runserver now looks like: [08/Jul/2008 19:37:17] "GET /admin/ HTTP/1.1" 200 4851 [08/Jul/2008 19:37:20] "GET

Re: Problems using custom sql in manager

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 16:56 -0700, AJ wrote: > I've run into an issue using a manager for a model to run some custom > sql. > A dumbed down version of the code looks something like this: > > cursor = connection.cursor() > #

Problems using custom sql in manager

2008-07-08 Thread AJ
I've run into an issue using a manager for a model to run some custom sql. A dumbed down version of the code looks something like this: cursor = connection.cursor() # Get list of zipcodes zips = [zip.zipcode for zip in

Re: Import issues since newforms-admin

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 16:20 -0700, Julien Phalip wrote: > Hi, > > There's an issue that arose as I upgraded an external app of mine to > newforms-admin. > > I created the conventional admin.py, which does all the registration > business, and did "import admin" in the module's __init__.py > >

Re: streaming output

2008-07-08 Thread Joshua Jonah
Not that i know of, but you'd be surprised how easy it is to write a socket server in Python: http://www.amk.ca/python/howto/sockets/ Brogli wrote: > Hi, > Is there an easy way to get a handle to the output file stream in a > Django application? Instead of building an entire response in

Re: streaming output

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 13:31 -0700, Brogli wrote: > Hi, > Is there an easy way to get a handle to the output file stream in a > Django application? Instead of building an entire response in memory > then sending it out, I'd like to send the response in pieces. Not really (in a reliable way).

Re: "ImportError No module named django"

2008-07-08 Thread Julien Phalip
Hi, This means that Django is not in the PYTHONPATH. To check what's in that path, run the following in Python: >>> import sys >>> print sys.path On Jul 9, 9:35 am, Juanjo Conti <[EMAIL PROTECTED]> wrote: > How did you exactly install it? > Which folders are in your PYTHONPATH? > > Juanjo >

Re: "ImportError No module named django"

2008-07-08 Thread Juanjo Conti
How did you exactly install it? Which folders are in your PYTHONPATH? Juanjo -- mi blog: http://www.juanjoconti.com.ar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: How to use combined indices (esp. in fulltext queries)?

2008-07-08 Thread Malcolm Tredinnick
On Tue, 2008-07-08 at 08:13 -0700, ToSH wrote: > Hi, > > I would need to do a query like > SELECT * FROM mytable WHERE match (a) against("+AAA" in boolean mode) > and match (b against("+BBB" in boolean mode) > and match (a,b) against("+AAA +BBB" in boolean mode) > > If I would omit the last

"ImportError No module named django"

2008-07-08 Thread MadMax007
I installed Django on my iMac running Lepoard. I installed the official release and followed the instructions, but when I try to import Django to Python I get the following message: "ImportError No module named django" on top of this, I now have 2 Python folders version 2.5. Has anyone come up

Re: Django + tiny_mce

2008-07-08 Thread Mario
Easy fix. Open your models.py and in the Class Admin section of the model insert js = ['tiny_mce/tiny_mce.js', 'js/textareas.js']. For example: class Admin: list_display = ('headline', 'author', 'pub_date', 'publish') list_filter = ['pub_date'] save_as = True js

Import issues since newforms-admin

2008-07-08 Thread Julien Phalip
Hi, There's an issue that arose as I upgraded an external app of mine to newforms-admin. I created the conventional admin.py, which does all the registration business, and did "import admin" in the module's __init__.py After I did that, I got some import errors at compilation time (or say,

does django cache models.py?

2008-07-08 Thread Daehee
i'm trying it figure out why django is not recognizing a new models.py file for my app. even when i completely butcher the code in models.py or change the filename and run "manage.py sqlreset" or "manage.py syndb," it still generates the old model. any thoughts??

Re: newforms: how to make input widgets smaller

2008-07-08 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > I use newforms.ModelForm to get a form from one of my models. > However, the HTML fields are all too wide. Okay, I could > re-define all fields that need narrower s like > > class SixChamberChannelForm(ModelForm): > gas =

Re: Trying to understand project structure w/apps

2008-07-08 Thread Milan Andric
On Tue, Jul 8, 2008 at 3:53 PM, eddie <[EMAIL PROTECTED]> wrote: > > Hi guys+gals, > > I'm new to django, and I'm trying to wrap my head around a project > structure. I have a simple case that I'm thinking about, but can't > put together a reasonable mental model for it. > > I've got a site that

Re: running development server

2008-07-08 Thread Karen Tracey
Just use 0.0.0.0 and the dev server will listen on all interfaces. Karen --~--~-~--~~~---~--~~ 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

Re: dreaded FieldError (used to be KeyError) can only replicate on production, ugh!

2008-07-08 Thread Milan Andric
On Jun 30, 3:01 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > I've been wresting with this one for a couple hours now trying to > track it down, but no luck.  I'm recently updated to django trunk and > getting very odd reponses.  I could take the same page and refresh it > several times in

Re: Trying to understand project structure w/apps

2008-07-08 Thread Norman Harman
eddie wrote: > Hi guys+gals, > > I'm new to django, and I'm trying to wrap my head around a project > structure. I have a simple case that I'm thinking about, but can't > put together a reasonable mental model for it. > > I've got a site that has a schedule component (events), and a news >

Re: Calculating on generic view

2008-07-08 Thread rocco_s
Hey, it helps :-) but i have a little problem now. I try to add an attribute to each element. In the CLI ist works: >>> from mysite.myapp.models import Mymodel >>> list = Mymodel.objects.all() >>> for elem in list: ... elem.kmph = elem.distance/elem.time >>> list[0].kmph 45 But when i put

Re: Calculating on generic view

2008-07-08 Thread rocco_s
Hey, it helps :-) but i have a little problem now. I try to add an attribute to each element. In the CLI ist works: >>> from mysite.myapp.models import Mymodel >>> list = Mymodel.objects.all() >>> for elem in list: ... elem.kmph = elem.distance/elem.time >>> list[0].kmph 45 But when i put

streaming output

2008-07-08 Thread Brogli
Hi, Is there an easy way to get a handle to the output file stream in a Django application? Instead of building an entire response in memory then sending it out, I'd like to send the response in pieces. thanks, Dave --~--~-~--~~~---~--~~ You received this

Re: Calculating on generic view

2008-07-08 Thread rocco_s
Hey, it helps :-) but i have a little problem now. I try to add an attribute to each element. In the CLI ist works: >>> from mysite.myapp.models import Mymodel >>> list = Mymodel.objects.all() >>> for elem in list: ... elem.kmph = elem.distance/elem.time >>> list[0].kmph 45 But when i put

Re: AutoImageField From Custom upload and filters

2008-07-08 Thread moos3
any takers on this ? --~--~-~--~~~---~--~~ 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

Trying to understand project structure w/apps

2008-07-08 Thread eddie
Hi guys+gals, I'm new to django, and I'm trying to wrap my head around a project structure. I have a simple case that I'm thinking about, but can't put together a reasonable mental model for it. I've got a site that has a schedule component (events), and a news component (news items). So I

Re: connection.queries - show improper SQL?

2008-07-08 Thread Adam V.
>From the source for QuerySet.__str__: Returns the query as a string of SQL with the parameter values substituted in. Parameter values won't necessarily be quoted correctly, since that is done by the database interface at execution time. The __str__ method just does a naive Python % operation,

Re: newforms: how to make input widgets smaller

2008-07-08 Thread Torsten Bronger
Hallöchen! bruno desthuilliers writes: > On 8 juil, 21:06, Torsten Bronger <[EMAIL PROTECTED]> > wrote: > >> I use newforms.ModelForm to get a form from one of my models. >> However, the HTML fields are all too wide. Okay, I could >> re-define all fields that need narrower s like >> >> class

Re: Django + tiny_mce

2008-07-08 Thread Matthias Kestenholz
2008/7/8 LRP <[EMAIL PROTECTED]>: > > > Add a slash here: --~--~-~--~~~---~--~~ 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

Re: newforms: how to make input widgets smaller

2008-07-08 Thread bruno desthuilliers
On 8 juil, 21:06, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > I use newforms.ModelForm to get a form from one of my models. > However, the HTML fields are all too wide. Okay, I could > re-define all fields that need narrower s like > > class SixChamberChannelForm(ModelForm): >

Re: running development server

2008-07-08 Thread bruno desthuilliers
On 8 juil, 20:37, [EMAIL PROTECTED] wrote: > thnx, i got that, but the IP is that my machine's IP on the network, > or the network's IP? Should be your machine's IP address, of course. > i tried it with mine, made sure the port 8000 was open and did python > manage.py runserver IP:8000 and got

Re: Django + tiny_mce

2008-07-08 Thread LRP
Thanks Chatchai. Unfortunately, integration of tiny_mce still eludes me. It seems that django is not looking in the proper directory for tiny_mce.js. But I can't see why, despite generous off-list help from kind-soul Peter. 1) I've reviewed and documented my configuration below and would be

Re: Markup languages vs HTML

2008-07-08 Thread bruno desthuilliers
On 8 juil, 18:02, "Matic Žgur" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working on some project, a part of which is a small blog app. All > the blog posts are saved as HTML (using TinyMCE in admin). I was > wondering, after reading some stuff about Markdown, what are pros and > cons of each

Re: running development server

2008-07-08 Thread jorgehugoma
Chris, Are you using the IP address of your network interface? Jorge Hugo Murillo - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: Django users Sent: Tuesday, July 8, 2008 2:37:02 PM Subject: Re:

Re: running development server

2008-07-08 Thread jorgehugoma
Chris, Are you using the IP address of your network interface? Jorge Hugo Murillo - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: Django users Sent: Tuesday, July 8, 2008 2:37:02 PM Subject: Re:

Re: connection.queries - show improper SQL?

2008-07-08 Thread Matthias Kestenholz
2008/7/8 Peter <[EMAIL PROTECTED]>: > > When I look at generated sql from connection.queries, it doesn't show > any quotes around strings. > > For example: from django.db import connection from django.contrib.auth.models import User User.objects.filter(username="bob") > []

Re: determining model subclass

2008-07-08 Thread David K
Dave's method is what I also use. I was hoping someone would come up with an easier way, but I think it is a limitation of the way the database tables are created in multitable inheritance. David On Jul 8, 6:13 am, Chester <[EMAIL PROTECTED]> wrote: > André, > I'm assuming that you are using

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-08 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > > Hello, > > Despite I read a lot of time the overview.txt on the django tagging svn > repository, I still can't stand how to use it at my model's level. I'm > quite new to python and may miss some elements. > > When diving into the register part, it says it

Transitioning old webapp to Django

2008-07-08 Thread William
Hi, I'm moving an old PHP & MySQL3 application to Django SVN with mysql5, and I've run into a problem. The passwords for the old user accounts were stored in the database and used the mysql PASSWORD() function for hashing. MySql 5 changed the hashing function, but kept the old hashing function

newforms: how to make input widgets smaller

2008-07-08 Thread Torsten Bronger
Hallöchen! I use newforms.ModelForm to get a form from one of my models. However, the HTML fields are all too wide. Okay, I could re-define all fields that need narrower s like class SixChamberChannelForm(ModelForm): gas = forms.CharField(widget=forms.TextInput(attrs={"size": "10"}))

Re: connection.queries - show improper SQL?

2008-07-08 Thread Alex Koshelev
While you don't have an exception if using ORM so it isn't bug it is feature. On Jul 8, 10:07 pm, Peter <[EMAIL PROTECTED]> wrote: > When I look at generated sql from connection.queries, it doesn't show > any quotes around strings. > > For example:>>> from django.db import connection > >>> from

Re: Markup languages vs HTML

2008-07-08 Thread Ned Batchelder
The important consideration is what is the best representation for your data? Since you are talking about user-edited content, you need to think about the user experience, and what data format is best for your users. The database concerns don't really matter after that. If you users need

Re: Markup languages vs HTML

2008-07-08 Thread Ned Batchelder
The important consideration is what is the best representation for your data? Since you are talking about user-edited content, you need to think about the user experience, and what data format is best for your users. The database concerns don't really matter after that. If you users need

Re: running development server

2008-07-08 Thread mccomas . chris
thnx, i got that, but the IP is that my machine's IP on the network, or the network's IP? i tried it with mine, made sure the port 8000 was open and did python manage.py runserver IP:8000 and got the server to initially start, but immediately after it displays the "Quit the server with

Re: running development server

2008-07-08 Thread moos3
Also you could use mod_python or fastcgi so you can see how its going to act when deployed. On Jul 8, 2:30 pm, [EMAIL PROTECTED] wrote: > hey all, > > i'm trying to open up my development server to a couple of our other > staff members to help me start testing next week. to open up the >

Re: running development server

2008-07-08 Thread moos3
python manage.py runserver IP:PORT I hope that helps. On Jul 8, 2:30 pm, [EMAIL PROTECTED] wrote: > hey all, > > i'm trying to open up my development server to a couple of our other > staff members to help me start testing next week. to open up the > development server to others on our network,

running development server

2008-07-08 Thread mccomas . chris
hey all, i'm trying to open up my development server to a couple of our other staff members to help me start testing next week. to open up the development server to others on our network, do i set runserver to my IP or the network's IP? chris

connection.queries - show improper SQL?

2008-07-08 Thread Peter
When I look at generated sql from connection.queries, it doesn't show any quotes around strings. For example: >>> from django.db import connection >>> from django.contrib.auth.models import User >>> User.objects.filter(username="bob") [] >>> connection.queries[-1] {'time': '0.000', 'sql':

Re: User is in models.py

2008-07-08 Thread Juanjo Conti
You have to pass request.user from some view to the apropiate save method. views.py: def save_human(reqiest): # do some stuff human.save(request.user) models.py: class Human(Model): # ... def save(self, user): # do something with user

Re: Grouping Items In Multiple Categories

2008-07-08 Thread [EMAIL PROTECTED]
Thanks Arien, this was what I was looking for, I just couldn't figure out what the syntax needed to be, they really should add this example to the Django documentation. On Jul 8, 1:30 pm, Arien <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 11:25 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>

Re: Markup languages vs HTML

2008-07-08 Thread Norman Harman
Matic Žgur wrote: > Hi, > > I'm working on some project, a part of which is a small blog app. All > the blog posts are saved as HTML (using TinyMCE in admin). I was > wondering, after reading some stuff about Markdown, what are pros and > cons of each method, ie. saving posts with some markup

Re: How to create field not stored in database, but visible in admin?

2008-07-08 Thread Norman Harman
Marek Stępniowski wrote: > How to create a field that is not stored in database, but is visible > in Django newforms-admin? (I'm assuming there is a way) > > I would like to define a field which acts as a kind of proxy. Setting > and getting value of this field actually runs some defined

ProgrammingError: (2014, "Commands out of sync; you can't run this command now")

2008-07-08 Thread Rodrigo Culagovski
In a production site, all of a sudden while trying to edit the site via the admin interface I get: ProgrammingError: (2014, "Commands out of sync; you can't run this command now") This is when trying to access the record list: "/admin/core/pagina/" This is only while trying to edit this one

Re: Grouping Items In Multiple Categories

2008-07-08 Thread Arien
On Tue, Jul 8, 2008 at 11:25 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Does anyone know of an elegant way in Django to group database items > under 2 categories. Don't know about elegant, but something like this would work: {% regroup committees by state as committee_state_list %} {%

Re: Markup languages vs HTML

2008-07-08 Thread rui
Hi Matic, I really think that html should not be saved on your database. Markup languages are more "human readable" and can be easily converted to HTML, if needed. And really, it just don´t look right :) Cheers and good luck. -- Rui --~--~-~--~~~---~--~~ You

Re: What's the best way to simulate a request?

2008-07-08 Thread Norman Harman
Andrew wrote: > Here's the situation: > > I'm creating an RESTful internal API as an app in our project. Our > 'main' app (we'll call it main) is a client of the API app. Since > we're building the API piece by piece as we use it, the emphasis on > all of this is simple simple simple -- with our

Re: Grouping Items In Multiple Categories

2008-07-08 Thread rui
Hi Josh, Have you tried passing a tuple with the two columns to the group_by method ? Cheers. -- Rui On Tue, Jul 8, 2008 at 1:25 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Does anyone know of an elegant way in Django to group database items > under 2 categories. > > For example I

Re: Calculating on generic view

2008-07-08 Thread Gonzalo Delgado
El Tue, 8 Jul 2008 09:15:36 -0700 (PDT) rocco_s <[EMAIL PROTECTED]> escribió: > > Hi there, > > im very new at Django, and i have a little problem. > > Is there a way to do some calculation on generic views? > > Example: Ich have a table in the db with the columns "distance" and > "time", and

one to one symmetric relationship

2008-07-08 Thread Aldo
Hello, Thanks for your answer Malcom. My mistake was to suppose that one to one relationships were symmetric. Do you have an idea on how to design a symmetric one to one relationship ? I tried with ForeignKey(unique=True) but it is not symmetric. I even tried ManyToManyField(unique=True), which

Grouping Items In Multiple Categories

2008-07-08 Thread [EMAIL PROTECTED]
Does anyone know of an elegant way in Django to group database items under 2 categories. For example I have a database model that contains the following information: State Committee_Type Committee When I send it out to the template, I need to be able to group each committee under its type and

Calculating on generic view

2008-07-08 Thread rocco_s
Hi there, im very new at Django, and i have a little problem. Is there a way to do some calculation on generic views? Example: Ich have a table in the db with the columns "distance" and "time", and i want to display an html-table with "distance", "time" and "km/h" for each row. How can i

Markup languages vs HTML

2008-07-08 Thread Matic Žgur
Hi, I'm working on some project, a part of which is a small blog app. All the blog posts are saved as HTML (using TinyMCE in admin). I was wondering, after reading some stuff about Markdown, what are pros and cons of each method, ie. saving posts with some markup language vs. html. I must admit,

elusive Post error

2008-07-08 Thread Adam Fraser
I was wondering if anyone else has ever run into this problem... When filling out a form, I click submit and get a POST error claiming that the page does not support POST. However, if I refresh the error page, the request goes through, and all is happy. I don't have much experience with web

Re: Sort a list of objects by an attribute of the objects

2008-07-08 Thread Ned Batchelder
This is a bit more complicated than you need. This will work: def sort_by_attr_inplace(seq, attr): import operator seq.sort(key=operator.attrgetter(attr)) --Ned. http://nedbatchelder.com joshuajonah wrote: > Resolved. > > Answer for those interested: > > def

Re: integer form fields

2008-07-08 Thread Jonathan Buchanan
On Tue, Jul 8, 2008 at 4:28 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > I need to limit an integerfield form type to 6 digits. I've tried > max_length and max_digits but those don't work. Is there anything > that does that or will I need to do a custom validation? How about

Re: AutoImageField From Custom upload and filters

2008-07-08 Thread moos3
http://dpaste.com/61358/ here is the code. here is also the wiki page http://code.djangoproject.com/wiki/CustomUploadAndFilters some reason instance isn't getting set for some reason. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

integer form fields

2008-07-08 Thread Bobby Roberts
I need to limit an integerfield form type to 6 digits. I've tried max_length and max_digits but those don't work. Is there anything that does that or will I need to do a custom validation? --~--~-~--~~~---~--~~ You received this message because you are

  1   2   >