Tests in files other than tests.py and models.py

2008-06-24 Thread Andrew Fong
A quick browse of a few other posts on the list tell me this question has been asked before but the previous answers didn't exactly work for me. I created my own solution, but given that I'm very much a Django (and Python) newbie, if there are any glaring errors in my approach, please point them o

Re: django template rendering

2008-06-24 Thread Alessandro Ronchi
2008/6/25, Djangofan <[EMAIL PROTECTED]>: > > When rendering a django template on an HTML page, I can use: > > Field Name: "myFieldName" > Value: {{ row.myFieldName }} > > and it works just fine. However, I can't find a way to make it work > with a dynamic variable for the field name: > > F

Re: Damn unicode error

2008-06-24 Thread Alessandro Ronchi
2008/6/24, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > The unicode stuff continues to give me no end of headaches. This > morning I keep getting the error below. As near as I can tell, when I > call AddManipulator it's getting the related fields, and there's a bad > character somewhere in there.

Some Model SQLite3 related questions/problems

2008-06-24 Thread haifischjunge
Ive set up the latest svn (because the stable had template problems on 10.5) and ran into a couple of problems. most annoying problem is that if I rename or delete fields in the model - even after a db sync - they are obviously present in the sqlite3 db. for example Ive created a field "username

Re: How to get ManyTomManyField‘s value?

2008-06-24 Thread [EMAIL PROTECTED]
Not ManyToManyFieldTags !!! Flowing: class Test(models.model): . tags = ManyToManyField(Tag) . def save(self): super(Test,self).save() print self.tags.count() # value is the last saved How can I get the value after the Test

How to get ManyTomManyField‘s value?

2008-06-24 Thread [EMAIL PROTECTED]
Flowing: class Test(models.model): . tags = ManyToManyFieldTags(Tag) . def save(self): super(Test,self).save() print self.tags.count() # value is the last saved How can I get the value after the Test object saved ??? --~--

django template rendering

2008-06-24 Thread Djangofan
When rendering a django template on an HTML page, I can use: Field Name: "myFieldName" Value: {{ row.myFieldName }} and it works just fine. However, I can't find a way to make it work with a dynamic variable for the field name: Field Name: "{{ x }}" <== where x='myFieldName' Value: {{ row.x

Django custom middleware question

2008-06-24 Thread csmith
How can I add an attribute or variable? to the request object in middleware, where I can use it in other views via the request object. This is my custom middleware code so far: class AliasMiddleware(object): def process_request(self, request): assert hasattr(request, 'session'), "The

Re: many to many field

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 thanks for the advice. great stuff. i'll follow the ticket. best regards, Ramiro Morales wrote: | On Tue, Jun 24, 2008 at 3:40 PM, Stephan Jäkel <[EMAIL PROTECTED]> wrote: |> -BEGIN PGP SIGNED MESSAGE- |> Hash: SHA1 |> |> OK. I hoped, there

Re: Data truncated for column change_message

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, the Data truncated error is thrown for a django table. my models are ok, i think. as i've written, the affected table is "django_admin_log" and the raw query is valid and works. i dont know why, but python-mysql throws this error. Peter Rowell w

problem with select_related?

2008-06-24 Thread bob84123
I'm having a problem with select_related; I'm not sure if it's a bug or a problem with my understanding of how it's supposed to work. Here's some code: from django.db import models class Occurrence(models.Model): start_time = models.OneToOneField('TimeRepresentation', null = True, relat

Re: Is it possible not to use RequestContext in Generic Views?

2008-06-24 Thread pength
I have tried something like: d = dict(queryset=cities, page=start_page, paginate_by=USUAL_PAGINATE, context_processors=None) return django.views.generic.list_detail.object_list(request, **d) but I see the codes in the TEMPLATE_CONTEXT_PROCESSORS are still executated. ;( On Jun 25, 11:06

Is it possible not to use RequestContext in Generic Views?

2008-06-24 Thread pength
As Generic Views are using RequestContext by default, in most cases it's quite good. But I have some special generic views, which will populate the result via Ajax, so, to make it more effecient, I don't want the views to use RequestContext. but how to "disable" RequestContext in generic views? T

Book announcement: The standard Django textbook (Japanese)

2008-06-24 Thread Yasushi Masuda
Dear Djangonauts, Yasushi Masuda, Ryosuke Nakai, Makoto Tsuyuki and Yutaka Matsubara are proud to annouce the first Japanese book dedicated to Django, titled "Hyo-jun Django" (means "The standard Django textbook"). Book url: http://www.ascii.co.jp/books/books/detail/978-4-04-867209-2.shtml Amazo

Re: psycopg2

2008-06-24 Thread Tim Chase
> The problem with SQL injections shouldn't IMHO be solved at > driver level, but is an application level problem. The SQL driver is responsible for accuracy in the implementation of safe methods for escaping and/or parameter substitution, and the application is responsible for making proper us

Re: error in starting app

2008-06-24 Thread Alex Slesarev
Hello! > I am at the stage > > << > It worked! > Congratulations on your first Django-powered page. How did you start site? python manage.py runserver? > I then issue the command > > python manage.py startapp books If "python manage.py runserver" command is worked, then "startapp" command also

Re: Data truncated for column change_message

2008-06-24 Thread Peter Rowell
I don't know if this is the problem, but I've noticed that inspectdb can generate wrong max_length for CharFields. Check the lengths in the database vs. the lengths in your models. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: How do I add the user ID to a template?

2008-06-24 Thread Eric Abrahamsen
If you do go the RequestContext route, you can wrap the standard render_to_response function in a custom render function that adds the RequestContext automatically, as per here: http://www.djangosnippets.org/snippets/3/ and then use the custom function in your views, instead of render_to_r

Re: Regression tests and TestCase method

2008-06-24 Thread Alex Slesarev
Hello! > I guess that the test runner tries to call "test_bla()" automatically. > How can I prevent that? Is it possible to move tast_bla() method to other class? You can create an instance of this class in the setUp() method of SomeTest and use it in all test cases. --~--~-~--~~

Re: Regression tests and TestCase method

2008-06-24 Thread Russell Keith-Magee
On Wed, Jun 25, 2008 at 8:55 AM, Julien <[EMAIL PROTECTED]> wrote: > > I guess that the test runner tries to call "test_bla()" automatically. > How can I prevent that? You can't. This is by design of unittest.TestCase - any method starting with 'test_' is found an executed as a test case. The wo

Re: Need some help with form implementation.

2008-06-24 Thread Alex Slesarev
Hello! > I know I shall need a lot of javascript magic.. any hints as to go > about the django forms, fields and javascript stuff would be much > appreciated. You can use jQuery magic. You have to redefine admin change form template for your model (this file should be named as templates/admin/ /

Re: Need some help with form implementation.

2008-06-24 Thread Alex Slesarev
Hello! > I know I shall need a lot of javascript magic.. any hints as to go > about the django forms, fields and javascript stuff would be much > appreciated. You can use jQuery magic. Redefine admin's change_form template for required model (it should be located at path templates/admin// /chang

Regression tests and TestCase method

2008-06-24 Thread Julien
Hi, I'm making some regression tests for Django, and there's a problem I can't get around. Here's the code: class SomeTest(TestCase): def test_bla(self, an_argument): def test_something(self): self.test_bla("blablabla") self.test_bla("foo") Whe

Re: Support for MS SQL Server

2008-06-24 Thread Chatchai Neanudorn
http://www.feedfrog.net/blog/2008/may/29/using-ms-sql-django/ Hope this help, Chatchai 2008/6/25 Russell Keith-Magee <[EMAIL PROTECTED]>: > > On Wed, Jun 25, 2008 at 7:03 AM, Nagu <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > After doing some search on Google, Django has some kind of backend >

Re: Overriding the JOIN type in contrib.admin's search forms?

2008-06-24 Thread Paul Winkler
On Jun 23, 11:30 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > It's a leap from no response to nobody cares. Yes, sorry for that, I didn't mean to be rude. > One thing, though, which may have made a lot of people pass over it is that > you are reporting a problem with they way queries are cons

Re: Support for MS SQL Server

2008-06-24 Thread Russell Keith-Magee
On Wed, Jun 25, 2008 at 7:03 AM, Nagu <[EMAIL PROTECTED]> wrote: > > Hi, > > After doing some search on Google, Django has some kind of backend > support for MS SQL server. But when I type ado_mssql in my setting.py > file while creating a simple application, it says ad_mssql is not an > avaliable

How do you identify hidden form fields in a template

2008-06-24 Thread davenaff
In a template, I'm using the equivalent of: {% for field in form %} {{ field.label_tag }}{{field}} {% endfor %} However, the labels of my hidden fields appear. Is there an easy way to test if the field is using the HiddenInput widget (or an alternate solution)? Thanks! --~--~-~--~~-

Support for MS SQL Server

2008-06-24 Thread Nagu
Hi, After doing some search on Google, Django has some kind of backend support for MS SQL server. But when I type ado_mssql in my setting.py file while creating a simple application, it says ad_mssql is not an avaliable option. Do I need any special patch or something to enable this? Please advic

error in starting app

2008-06-24 Thread gandalf
I am at the stage << It worked! Congratulations on your first Django-powered page. Of course, you haven't actually done any work yet. Here's what to do next: * If you plan to use a database, edit the DATABASE_* settings in myproject/settings.py. * Start your first app by running python

Re: Join two different querysets

2008-06-24 Thread Rajesh Dhawan
If you want to do something fancier than the queryset -> list -> merge -> sort, you could create a base model class with just the creation date in it since the creation date is being used to sort across the two types of objects. Then, derive the Comment and Trackback classes from this base class.

Re: Join two different querysets

2008-06-24 Thread Rajesh Dhawan
Hi Florian , > A Blog has Comments and Trackbacks. Trackbacks should be shown like > comments but they get a div class="Trackback" instead of > class="Comment" in HTML. > > My idea was to join all Trackbacks and Comments and use a an > additional attribute to tell them apart in HTML: > > def

Re: Do you code django with Komodo?

2008-06-24 Thread Tye
(Winblows) Notepad and (OpenBSD) vi :-) I don't like colors or auto-complete. Just another example of what André said: "editors and IDEs are a very personal choice..." On the front-end: Firebug to notepad. Semi-off-topic: Does anybody know how to get notepad to save as UTF-8 by default? It keep

Re: Do you code django with Komodo?

2008-06-24 Thread ristretto . rb
I'm on Linux; I'm looking in the gEdit pluggins - looks very promising and simple, I never knew gEdit could be extended so much. I'm also looking at wingware's wingIDE now, which is not free at all, but looks very much worth the money from the marketing videos. On Wed, Jun 25, 2008 at 6:17 A

Re: global variable issue

2008-06-24 Thread csmithmaui
Ok...guys...I think I understand what you are saying. It gives me much relief to understand this better. I didn't realize that the server would run multiple instances of django to serve my requests. It seems I had a fundamental misunderstanding of how things work on the server. I will try to do so

Re: memchached issue on ubuntu

2008-06-24 Thread Alex Ezell
On Tue, Jun 24, 2008 at 11:01 AM, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 9:29 PM, Michael Wieher <[EMAIL PROTECTED]> > wrote: >> >> now I would just run the same test you ran earlier, try to set data in >> the cache, now that the cache itself exists > > The memcached se

Re: global variable issue

2008-06-24 Thread Norman Harman
[EMAIL PROTECTED] wrote: > If I hit Ctrl-R again it puts my name back, and so on. It's like there > there are two copies of the global that I am accessing. I can't figure > this out. Any ideas? Thanks so much! Rule 1: Don't use globals. Rule 2: Don't try to store state in a stateless server, use

Re: global variable issue

2008-06-24 Thread Rajesh Dhawan
Hi, > So, this all works fine on the development server on my laptop using > the latest django trunk, but on webfactions server it doesn't work all > of the time.  Sometimes when I access my object_detail( by the way I > also wrote my own freeform.html in templates/comments and modified it > to u

Re: Hooking up Users and Profiles

2008-06-24 Thread radioflyer
On Jun 24, 4:05 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 2:53 PM, radioflyer <[EMAIL PROTECTED]> wrote: > > I continue to struggle with what I see as some real limitations of the > > User/UserProfile paradigm used by Django. > > Well, it doesn't cover every concei

Need some help with form implementation.

2008-06-24 Thread Adi
Hi, I have a form where I display a multiple select field (using ModelMultipleChoiceField). This consists a list of track and field events that the user can participate in. The user can select upto a pre-determined number of events to particpate in. Now when the user selects an event from that sel

global variable issue

2008-06-24 Thread csmithmaui
Hi, I have an error that is stumping me. It may be a django or python issue and nothing to do with webfaction butI have been working on it for a while now and don't know where else to turn. I am fairly new to Python and Django so it might be obvious to someone more experienced. I have a globa

Re: psycopg2

2008-06-24 Thread Will
Thanks for taking the time to write that, Federico. My worries stemmed from my not being able to find any clear information on psycopg, but I feel a lot happier now. Cheers Will --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: Problem logging in to admin using Safari

2008-06-24 Thread Emil Styrke
It certainly looks to me like it is a client and not a server problem. Have you tried running the development server on the mac and accessing it with that exact same install of Safari? Have you tried accessing the site from a different mac with safari? As a next step in tracing the error I'd ins

Re: Hooking up Users and Profiles

2008-06-24 Thread James Bennett
On Tue, Jun 24, 2008 at 2:53 PM, radioflyer <[EMAIL PROTECTED]> wrote: > I continue to struggle with what I see as some real limitations of the > User/UserProfile paradigm used by Django. Well, it doesn't cover every conceivable thing you might want to do, which is to be expected; out of the box,

Hooking up Users and Profiles

2008-06-24 Thread radioflyer
I continue to struggle with what I see as some real limitations of the User/UserProfile paradigm used by Django. The recommended policy of setting AUTH_PROFILE_MODULE works alright for situations where the applications in your site only have need of a single user type. I've been working on a pro

Re: Pulling ManyToMany fields in a template?

2008-06-24 Thread nobody
Ah, I figured as much. Just figured Django would have some magic way of doing it since everything else seems magic. Thanks! On Jun 24, 12:47 pm, jonknee <[EMAIL PROTECTED]> wrote: > On Jun 24, 3:35 pm, nobody <[EMAIL PROTECTED]> wrote: > > > I'm sure this is very common knowledge but for the lif

Re: Pulling ManyToMany fields in a template?

2008-06-24 Thread jonknee
On Jun 24, 3:35 pm, nobody <[EMAIL PROTECTED]> wrote: > I'm sure this is very common knowledge but for the life of me I can't > find it in the documentation or the djangobook. > > I have a ManyToManyField in my model. Categories to Articles. > > In my template I try to pull it out like so: > {{art

Pulling ManyToMany fields in a template?

2008-06-24 Thread nobody
I'm sure this is very common knowledge but for the life of me I can't find it in the documentation or the djangobook. I have a ManyToManyField in my model. Categories to Articles. In my template I try to pull it out like so: {{article.categories }}: {{ article.title }} and my output is: : Mauri

Join two different querysets

2008-06-24 Thread Florian Lindner
Hello, I have the following situation: A Blog has Comments and Trackbacks. Trackbacks should be shown like comments but they get a div class="Trackback" instead of class="Comment" in HTML. My idea was to join all Trackbacks and Comments and use a an additional attribute to tell them apart

Re: Some Django unit tests fail...

2008-06-24 Thread Peter Melvyn
> On Fri, Jun 20, 2008 at 1:07 AM, Peter Melvyn <[EMAIL PROTECTED]> wrote: > > Yes, it is the intention. If Django requires test database with > > charset UTF8, IMHO it should create it using related clause. as well > > as proper engine should be choosen if we care about reference > > integri

Re: many to many field

2008-06-24 Thread Ramiro Morales
On Tue, Jun 24, 2008 at 3:40 PM, Stephan Jäkel <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > OK. I hoped, there is a possibility to use ManyToManyField. Well, the > Model-way is already implemented but i would like to use > ManyToManyField. Anyway, it works. >

Re: psycopg2

2008-06-24 Thread Federico Di Gregorio
Just to shed a bit of light: On Jun 24, 4:28 pm, Will <[EMAIL PROTECTED]> wrote: > Is that substitute for a full suite of regression tests?  What about > buffer overflow attacks? There's probably loads of other attacks I > don't even know about. > It doesn't even sound as if psycopg gets tested b

Re: psycopg2

2008-06-24 Thread Will
On Jun 24, 7:06 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 12:20 PM, Will <[EMAIL PROTECTED]> wrote: > > I really didn't want to turn this into a fight, and I apologise if my > > posts have seemed inflammatory. I'd just like to be able to trust all > > my stack. >

Re: many to many field

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 OK. I hoped, there is a possibility to use ManyToManyField. Well, the Model-way is already implemented but i would like to use ManyToManyField. Anyway, it works. joshuajonah wrote: | You need to define your many-to-many table in the model, and then u

Re: Django - Apache - mod_python setup

2008-06-24 Thread Nagu
Karen: Thank you a million Karen. I changed the curly quotes to ordinary quotes and restarted Apache. It works fine. I was elated when I accessed the http://cobra.mycompany.com/petview and saw it working from another machine. This is my first toy with web application. Karen, thank you very much

Re: Do you code django with Komodo?

2008-06-24 Thread Andre Meyer
hi i am using Komodo IDE 4.4 (out today) and like it a lot (switched from eclipse/pydev). Komodo works very well and has a lot of very nice features. the syntax checking of Python and DTL are very nice, just like the autocomplete and code browser. of course, editors and IDEs are a very personal c

Re: non-ascii DjangoUnicode Decode error-- best strategies

2008-06-24 Thread Ramdas S
I thought I was religiously following the document. But thanks for making me read it again, I know where all have I goofed up Thanks Karen RS On Tue, Jun 24, 2008 at 11:33 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 1:39 PM, Ramdas S <[EMAIL PROTECTED]> wrote: > >> What

Re: psycopg2

2008-06-24 Thread James Bennett
On Tue, Jun 24, 2008 at 12:20 PM, Will <[EMAIL PROTECTED]> wrote: > I really didn't want to turn this into a fight, and I apologise if my > posts have seemed inflammatory. I'd just like to be able to trust all > my stack. Well, this is the thing: are you going to this level of detail on *every*

Re: non-ascii DjangoUnicode Decode error-- best strategies

2008-06-24 Thread Karen Tracey
On Tue, Jun 24, 2008 at 1:39 PM, Ramdas S <[EMAIL PROTECTED]> wrote: > What is the best strategy to get django read non-ascii characters? Or at > least stop it from displaying the horrible error claiming DjangoUnicode > Decode error? > Don't put non-ASCII data into bytestrings. Rather use Unicod

Re: many to many field

2008-06-24 Thread joshuajonah
You need to define your many-to-many table in the model, and then use the "db_column" option to name the fields in that table. http://www.djangoproject.com/documentation/models/custom_columns/ On Jun 24, 1:43 pm, Stephan Jäkel <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Has

Re: many to many field

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi, joshuajonah wrote: | You should use the 'db_table' option for any given model. This will | allow you to use a specific table name and it also works on many-to- | many relational tables if you define them specifically in your | models.py. yes, db

non-ascii DjangoUnicode Decode error-- best strategies

2008-06-24 Thread Ramdas S
What is the best strategy to get django read non-ascii characters? Or at least stop it from displaying the horrible error claiming DjangoUnicode Decode error? I usually end up cleaning the content. I do not think that is a great idea, if I am letting thousands of users access and write content ont

Re: ImageField

2008-06-24 Thread Molly
I just looked it over and it seems as though this is all I need to do: === class PhotoDocumentation(models.Model): image = models.ImageField(upload_to='/media/images') caption = models.CharField(max_length=100) def _

Re: Django Popups?

2008-06-24 Thread phillc
however you would do it without django, is how you would do it with django On Jun 24, 9:51 am, RossGK <[EMAIL PROTECTED]> wrote: > I'm a recent Python/Django inductee and trying to get a small project > going. > Is there a good way to do a pop-up window from Django or should I use > java-script.

Re: Django - Apache - mod_python setup

2008-06-24 Thread Karen Tracey
On Tue, Jun 24, 2008 at 12:38 PM, Nagu <[EMAIL PROTECTED]> wrote: > > Karen: > > I followed the instructions at > http://www.djangoproject.com/documentation/modpython/ > . > > Here are the settings I added to the httpd.conf file: > > >SetHandler python-program >PythonHandler django.core.h

Re: psycopg2

2008-06-24 Thread Will
I really didn't want to turn this into a fight, and I apologise if my posts have seemed inflammatory. I'd just like to be able to trust all my stack. Will --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Django Popups?

2008-06-24 Thread Michael Newman
Hi Ross; The key here is to realize that there is a difference between server side and client side code. Django is server side meaning that it handles requests and returns them as a HTTPresponse object (generally HTML). HTML and javascript are client side, meaning that it is rendered by the clien

Re: ImageField

2008-06-24 Thread joshuajonah
Have you read the djangobook.com documentation? It's a great cross reference to the django documentation, written by the same person aswell, for some reason. On Jun 24, 1:10 pm, Molly <[EMAIL PROTECTED]> wrote: > I was wondering if anyone could explain ImageField to me or know of a > good website

Re: Django Popups?

2008-06-24 Thread Juanjo Conti
I think there is no built-in functionality for that. I use jquery for this kind of stuff. -- Juanjo Conti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: many to many field

2008-06-24 Thread joshuajonah
You should use the 'db_table' option for any given model. This will allow you to use a specific table name and it also works on many-to- many relational tables if you define them specifically in your models.py. You can get the info on them (scattered everywhere) in this doc: http://www.djangoproj

ImageField

2008-06-24 Thread Molly
I was wondering if anyone could explain ImageField to me or know of a good website to explain it.. I have been trying and can't get it to work. I have read through the documentation but no luck. Thanks :) Molly --~--~-~--~~~---~--~~ You received this message bec

Re: Django - Apache - mod_python setup

2008-06-24 Thread joshuajonah
since you are accessing a subdomain, there may be a vhost for your machine with an apache install for the whole domain... Are you the admin of the domain? if not you may want to have a chat with them. On Jun 24, 12:38 pm, Nagu <[EMAIL PROTECTED]> wrote: > Karen: > > I followed the instructions at

Re: psycopg2

2008-06-24 Thread Christian Joergensen
Will wrote: >> You're not asking it to do a whole hell of a lot. > > In terms of security, perhaps this is the most critical part of the > stack? SQL injection is one of the nastiest security vulnerabilities > IMHO. The problem with SQL injections shouldn't IMHO be solved at driver level, but i

Re: psycopg2

2008-06-24 Thread James Bennett
On Tue, Jun 24, 2008 at 11:28 AM, Will <[EMAIL PROTECTED]> wrote: > All I'm asking for is some reason to trust the integrity of psycopg, > and all I'm getting from you is sarcasm. Perhaps you could provide me > with some links? psycopg is used, happily, by everyone from hobbyists to Fortune 500 c

Re: psycopg2

2008-06-24 Thread Tye
Django is known for and designed to be *flexible.* If you don't like how a certain stack is made, make it better. It's one of Django's core philosophies. Sent from my iPhone On Jun 24, 2008, at 9:28, Will <[EMAIL PROTECTED]> wrote: > > Michael, > >>> In terms of security, perhaps this is the

many to many field

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi list, i'm currently implementing django as management interface for an existing project. until now, nearly everything worked as expected, but i've got a problem. is there a way to override the join_table, source_col_name and target_col_name in ma

Re: Unable to upload PNG's

2008-06-24 Thread jurian
Thanks for that! I think there might be a link missing in your message. I did that search and it didn't bring up anything really useful. I tried linking to the 'zlib' headers in the 'setup.py' manually as one post suggested, but it had no effect after a rebuild and install. The installation mess

Re: Django - Apache - mod_python setup

2008-06-24 Thread Nagu
Karen: I followed the instructions at http://www.djangoproject.com/documentation/modpython/ . Here are the settings I added to the httpd.conf file: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE petinfosite.settings Python

Re: psycopg2

2008-06-24 Thread Michael Wieher
>> You don't have time to write 2-3 bad SQL queries and attempt >> injection? We're talking 5 lines of python, and that includes import >> statements. > It doesn't even sound as if psycopg gets tested before release. > All I'm asking for is some reason to trust the integrity of psycopg, > and a

Re: psycopg2

2008-06-24 Thread Will
Michael, > > In terms of security, perhaps this is the most critical part of the > > stack? SQL injection is one of the nastiest security vulnerabilities > > IMHO. > > You don't have time to write 2-3 bad SQL queries and attempt > injection? We're talking 5 lines of python, and that includes imp

Re: memchached issue on ubuntu

2008-06-24 Thread Amit Upadhyay
On Tue, Jun 24, 2008 at 9:29 PM, Michael Wieher <[EMAIL PROTECTED]> wrote: > > now I would just run the same test you ran earlier, try to set data in > the cache, now that the cache itself exists The memcached server was already running. I tried the test again anyways, same result. -- Amit Upa

Re: memchached issue on ubuntu

2008-06-24 Thread Michael Wieher
now I would just run the same test you ran earlier, try to set data in the cache, now that the cache itself exists On Tue, Jun 24, 2008 at 10:57 AM, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 9:19 PM, Michael Wieher <[EMAIL PROTECTED]> > wrote: >> >> I don't know how djano

Re: memchached issue on ubuntu

2008-06-24 Thread Amit Upadhyay
On Tue, Jun 24, 2008 at 9:19 PM, Michael Wieher <[EMAIL PROTECTED]> wrote: > > I don't know how djano uses memcached, but have you like, looks to me > as if you need an instance of memcached running locally, listening on > its default port. Thanks, I just checked and I do, I started it thus: >

Re: psycopg2

2008-06-24 Thread Michael Wieher
> In terms of security, perhaps this is the most critical part of the > stack? SQL injection is one of the nastiest security vulnerabilities > IMHO. You don't have time to write 2-3 bad SQL queries and attempt injection? We're talking 5 lines of python, and that includes import statements. I can

Re: Problem logging in to admin using Safari

2008-06-24 Thread Pieter Claerhout
Anyone an idea? I've also disabled PHP on the server as that might cause some troubles, but that didn't make a difference. pieter 2008/6/23 Pieter Claerhout <[EMAIL PROTECTED]>: > Absolutely, that was the first thing I checked ;-) > > pieter > > 2008/6/23 TiNo <[EMAIL PROTECTED]>: >> >> >>> Look

Re: Getting the name of a class

2008-06-24 Thread J. Cliff Dyer
Maybe you're looking for MyModel.__name__ >>> from apps.myapp import models as m >>> m.Display.__name__ 'Display' >>> Cheers, Cliff On Mon, 2008-06-23 at 12:57 -0700, mwebs wrote: > Hi, > > thanks for your answer but I already tried this and it returns > something like this: > > But I only

Distinct values from a manytomany field?

2008-06-24 Thread mbdtsmh
How do I get a distinct list of values from a manytomany field Using a foreign key it is straightforward: RA_CHOICES = DesignSet.objects.values('project__RA').distinct() project is a foreignkey field. but trying the same on a m2m field raises an error: Designer_CHOICES = DesignSet.object

Re: psycopg2

2008-06-24 Thread Will
>You're not asking it to do a whole hell of a lot. In terms of security, perhaps this is the most critical part of the stack? SQL injection is one of the nastiest security vulnerabilities IMHO. >Seriously, though, psycopg2 is an open source library with a history of >working pretty well for what

Re: memchached issue on ubuntu

2008-06-24 Thread Michael Wieher
I don't know how djano uses memcached, but have you like, looks to me as if you need an instance of memcached running locally, listening on its default port. memcached is a program outside of django, and would (usually?) be started independently of anything else. so be sure you actually have an

memchached issue on ubuntu

2008-06-24 Thread Amit Upadhyay
Hi, Am trying get django working with memcached. I am running a few month old trunk. Start memcached: $ memcached -v settings.py contains: CACHE_BACKEND = "memcached:///127.0.0.1:11211/" shell: $ python manage.py shell [EMAIL PROTECTED] mcm_server_add3():2087: unable to lookup/resolve host: No

Re: Do you code django with Komodo?

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, i used Komodo long time ago but now i'm using notepad++ on windows and gedit on linux (but i work most time on linux, i need windows for c# development at work). both are easy to use and have a great syntax highlighting. i write the code on my lo

Re: Deciding where I am in the template hierarchy

2008-06-24 Thread Norman Harman
3xM wrote: > Inside a template, is there a way to decide whether it has any parent > template(s) or it is the root template? > > I've got some templates including each other, but also want to be able > to view them individually. But i still want the root template to > extend my base template. >

Re: Do you code django with Komodo?

2008-06-24 Thread joshuajonah
I use Komodo, however i cant seem to make the built in interpreter use the same version of python that i develop on. Not a big deal, i love the program, especially the forced anal-retentive tabbing. On Jun 24, 5:56 am, ristretto.rb <[EMAIL PROTECTED]> wrote: > Hello, > > Do you code python/djan

Re: Do you code django with Komodo?

2008-06-24 Thread Jökull
What OS are you running? I'm on Windows and use e-texteditor which has support for TextMate bundles. You can get some pretty nice Django bundles which will do a lot of autocompleting and such tasks. Komodo seems to have a couple of nice things going for it - mainly SVN support. In my setup I'm do

Data truncated for column change_message

2008-06-24 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi list, i'm using django for a while now for new projects. today, i started to implement django's admin interface for managing a existing project (mysql). i used inspectdb do generate the basic models and did some changes to fix foreign keys an some

Re: dynamic value of a ModelChoiceField

2008-06-24 Thread [EMAIL PROTECTED]
thanks v sergeyev. the above suggestion worked.. the initial dictionary was expecting the "recipe.cooking_method.id" value..wonder why just the "recipe.cooking_method" wouldnt work ? thnx, -p On Jun 24, 10:13 am, "V.Sergeyev" <[EMAIL PROTECTED]> wrote: > You need to pass initial dictionary toR

Re: How do I add the user ID to a template?

2008-06-24 Thread Huuuze
I understand that. However, I was hoping that the Django FRAMEWORK would provide some easy mechanism for plucking that information out of the session (rather than the request). Many frameworks provide easy methods for doing so and, guessing by your response, Django does not provide not provide t

Re: How do I add the user ID to a template?

2008-06-24 Thread Richard Dahl
The 'core' problem as you say, is essentially the core problem of all programming: programs don't write themselves. You have to write appropriate code for what you are trying to do, what does it matter if someone forgets to add the username to the render call, or if someone forgets to add the tag

Re: Damn unicode error

2008-06-24 Thread Etienne Robillard
On Tue, 24 Jun 2008 07:33:14 -0700 (PDT) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > The unicode stuff continues to give me no end of headaches. This > morning I keep getting the error below. As near as I can tell, when I > call AddManipulator it's getting the related fields, and there's

Re: How do I add the user ID to a template?

2008-06-24 Thread Huuuze
Correct me if I'm wrong, but I'm not sure this resolves the core problem. In your example, I still need to add something (in this case, 'context_instance=RequestContext(request)') to my "render_to_response" statements. I'd like to eliminate that completely since it requires a developer to add so

Re: psycopg2

2008-06-24 Thread Michael Wieher
> Why should we trust psycopg2 to be a high quality piece of software? > You're not asking it to do a whole hell of a lot. No computation. Simply "take A and put it in B" or "get B from A." I don't know why you'd expect this little connection piece to have a large team of support behind it. Th

  1   2   >