Re: Sort by foreignkey values

2009-01-05 Thread Patrick
On 5 jan, 01:38, Daniel Roseman wrote: > On Jan 4, 11:24 pm, Malcolm Tredinnick > wrote: > > > > > On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote: > > > [...] > > > > I don't know why you say filtering Equipamento based on the value in > > > Model 'seems to be not possible'. On the co

Re: FileSystemStorage content vs PIL Image

2009-01-05 Thread Donn
On Monday, 05 January 2009 09:44:37 Malcolm Tredinnick wrote: > Basically, hang in there and be prepared to experiment a bit and > possibly read some source code. Take notes as you go Heh -- thanks for that! It does lift my spirits somewhat. I have been planning to write a short tut on how to ma

Do you recommend "Practical Django Projects"?

2009-01-05 Thread HB
Hey, I'm reading "The Definitive Guide To Django" but it is too out dated. Do you recommend "Practical Django Projects" instead? It seems to me that "The Definitive Guide To Django" is more organized and covers a lot of materials. What do you think? Thanks. --~--~-~--~~~---

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread James Bennett
On Jan 5, 2:21 am, HB wrote: > Hey, > I'm reading "The Definitive Guide To Django" but it is too out dated. > Do you recommend "Practical Django Projects" instead? > It seems to me that "The Definitive Guide To Django" is more organized > and covers a lot of materials. > What do you think? As th

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread HB
I'm trying to learn Django, what to do right now? :p On Jan 5, 10:27 am, James Bennett wrote: > On Jan 5, 2:21 am, HB wrote: > > > Hey, > > I'm reading "The Definitive Guide To Django" but it is too out dated. > > Do you recommend "Practical Django Projects" instead? > > It seems to me that "Th

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread David Zhou
On Mon, Jan 5, 2009 at 3:27 AM, James Bennett wrote: > > On Jan 5, 2:21 am, HB wrote: >> Hey, >> I'm reading "The Definitive Guide To Django" but it is too out dated. >> Do you recommend "Practical Django Projects" instead? >> It seems to me that "The Definitive Guide To Django" is more organize

How can i use "Django Admin" part sortable in my project?

2009-01-05 Thread jai_python
Hi frenz, i want to use sortable in my project for sorting datas. already django admin part has one sortable. can we use(extend) admin part sortable in our project. if possible, can you please tel me how can i do it? Would be thankful for reply. Jayapal --~--~-~--~~~---

Re: File upload failing occasionally

2009-01-05 Thread ppdo
The failure does not depend on the file size: I manage to upload files bigger than 60 MB and fail on 30 kB files. I tried with Safari and Firefox and I got the same results, though I got the *impression* (but given the randomness of the problem I am not sure this is a real observation) that it fa

Overriding Model's save method: error propagation

2009-01-05 Thread David Fokkema
Hi group, I have overridden a Model's save() method. In my method, I update another database on another server with a simple password. My question is: when that database is somehow not available and I have catched an exception, how do I propagate that to the django-admin model form I was editing?

Backward relation to a subclass in multi-table inheritance

2009-01-05 Thread Carsten Reimer
Dear all, I ran into a problem with the following situation: Given are three models as follows: class A(models.Model): # some sensible fields an methods here class B(models.Model): fk = models.ForeignKey(A) # some more stuff here class C(B) # some sensible different fie

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 10:01 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > I appear to be having the same trouble as explained in a previous > thread [1] (and for some reason cant find the button to reply to the > last thread ???) > > The other thread points to a bug that was fixe

Re: Inheritance question

2009-01-05 Thread carlopires
Ok looks reazonable. But be something like: p = Person(name='test') s = Student(person=p, course='test course') or s = Student(parent=p) is desirable and easy to implement a copy data from Person instance to Student. On Jan 3, 1:02 am, Malcolm Tredinnick wrote: > On Fri, 2009-01-02 at 16:29

Re: Dynamic OR statements

2009-01-05 Thread Ronny Haryanto
On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake wrote: > for category in category_list: >results = results.filter(categories__slug = category.slug) How about results.filter(category__in=category_list)? Ronny --~--~-~--~~~---~--~~ You received this message bec

Re: Dynamic OR statements

2009-01-05 Thread Ronny Haryanto
On Mon, Jan 5, 2009 at 11:59 PM, Ronny Haryanto wrote: > On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake > wrote: >> for category in category_list: >>results = results.filter(categories__slug = category.slug) > > How about results.filter(category__in=category_list)? Whoops. Never mind. Repli

Re: Django-like PHP framework?

2009-01-05 Thread Masklinn
On 5 Jan 2009, at 14:31 , thi.l...@gmail.com wrote: > Hi, > > I have a hard time getting Django adopted as web framework in the > office. > Mostly because the boss paid for PHP-based trainings, and our current > infrastructure leaves little room for mod_python/wsgi/fastcgi... > > I was wondering i

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread Eric Abrahamsen
On Jan 5, 2009, at 7:47 PM, Donn wrote: > > On Monday, 05 January 2009 00:51:03 Donn wrote: >> I am stuck on the interface between a PIL Image and a >> FilesystemStorage 'content' object. >> >> I can: img = Image.open(content) >> But how do I pass 'img' back to Django for saving? > > I have some

Re: Unable to login (cookies not enabled?)

2009-01-05 Thread Deniz Dogan
On 5 Jan, 10:47, Deniz Dogan wrote: > Hi > > I'm having trouble when using the AuthenticationForm in Django. It > tells me that I haven't enabled cookies, even though I'm completely > sure that I have. I get this error: > > "Your Web browser doesn't appear to have cookies enabled. Cookies are > r

Dynamic OR statements

2009-01-05 Thread Bluemilkshake
Hello. Django noob here, pretty much. I understand how one can use Q objects to construct OR statements within a QuerySet, but (how) is it possible to do this dynamically? I have a list of categories, and I want to find items that match ANY of those categories. The current solution doesn't work

IOError: request data read error

2009-01-05 Thread Chunlei Wu
Hi, We have a web app running on Django 1.0 / modwsgi 2.0 / Apache 2.2.3. Sparsely, about 2~3 times a week, I receive emails about IOError as below: Traceback (most recent call last): File "/projects/prod/python/2.5.1/lib/python2.5/site-packages/django/ core/handlers/base.py", line 86,

Unable to login (cookies not enabled?)

2009-01-05 Thread Deniz Dogan
Hi I'm having trouble when using the AuthenticationForm in Django. It tells me that I haven't enabled cookies, even though I'm completely sure that I have. I get this error: "Your Web browser doesn't appear to have cookies enabled. Cookies are required for logging in." I've tried restarting Dja

Why Django doesn't force testing?

2009-01-05 Thread HB
Hey, One nice thing about JBoss Seam and Rails is they encourage unit testing from the very beginning. Django as an agile web framework, why doesn't follow the same philosophy? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Kenneth Gonsalves
On Monday 05 Jan 2009 2:05:16 pm HB wrote: > I'm trying to learn Django, what to do right now? :p use the onsite tutorial -- regards KG http://lawgon.livejournal.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Kenneth Gonsalves
On Monday 05 Jan 2009 2:10:34 pm David Zhou wrote: > >> and covers a lot of materials. > >> What do you think? > > > > As the author, I recommend waiting a couple months. > > Are you planning to update Practical Django Projects to 1.0? isnt that obvious from the answer? -- regards KG http://law

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
2009/1/5 Karen Tracey : > First, I would try 1.0.2 release or current trunk or 1.0.X branch instead of > 1.0. There have been additional fixes in this area that you may need, > depending on what you are doing. > Just upgraded now - no difference > If that doesn't fix it, please post some specifi

Re: Django-like PHP framework?

2009-01-05 Thread Peter Bailey
You might want to have a look at CakePHP. It follows the MCV pattern I believe, although I have not looked closely because it is PHP not Python. http://cakephp.org/ Peter On Jan 5, 8:31 am, "thi.l...@gmail.com" wrote: > Hi, > > I have a hard time getting Django adopted as web framework in the

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread brad
On Jan 5, 2:21 am, HB wrote: > Do you recommend "Practical Django Projects" instead? I got this book as soon as it came out, and very soon after Django hit 1.0. It's a good book, and I learned a few "big picture" ideas from the sample apps, but I really had to read the docs to figure out how t

Re: File upload failing occasionally

2009-01-05 Thread Graham Dumpleton
Sorry, some more questions. How big are the files you are trying to upload? What browser/client are you using to do the uploads? What do you have Timeout directive set to in Apache configuration? Graham On Jan 5, 6:24 pm, ppdo wrote: > Hi, > > Thanks for looking into this. I used embedded mo

Re: Redirect parent from within iframe without losing session

2009-01-05 Thread Berco Beute
The iFrame is from a different domain, which is likely causing the problem. I can see that the session is lost since the logged in user is suddenly logged out. 2B On Jan 5, 1:15 am, Daniel Roseman wrote: > Personally, I can't see how that redirect could be causing a session > to be 'lost'. As l

Re: Comments Framework and Authentication

2009-01-05 Thread Tim
Maybe a little brevity is in order - how do I grant temporary privileges to a user to delete a comment rather than keeping that power fully in the hands of a comments moderator? - Tim On Jan 3, 7:23 pm, Tim wrote: > Hi all - > > I am having a bit of difficulty with the Django comments framework

StringList Field Type

2009-01-05 Thread Tiago S.
Hi, I'm porting a app from GAE, which uses the StringList[1] property to store choices(simple strings) in the Poll model. I've read the django tutorial and there they make use of two models with a relationship between Choices and Polls. With my app, I don't see the need of an extra model, as a s

Re: Migrating MySQL -> Postgre, any working solutions?

2009-01-05 Thread Szymon
On 4 Sty, 20:23, tofer...@gmail.com wrote: > On 03.01-02:10, Szymon wrote: > 3.      you will need to substitute quotation marks, mysql uses "" > and postgresql uses \".  good old 'sed' to the rescue here. This is not only difference - MySQL uses 0/1 for BooleanField, Postgres t/f. After two day

Re: Why Django doesn't force testing?

2009-01-05 Thread Manuel Schmidt
Why should django encourage? Django offers everything one needs to do it so if you want to unit test your code, you can just do it. And if you dont care, you can either. HB schrieb: > Hey, > One nice thing about JBoss Seam and Rails is they encourage unit > testing from the very beginning. > Dja

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Peter Herndon
"Practical Django Projects" is a bit dated at the moment -- Django has been moving very quickly. However, there's a lot to learn from it, particularly regarding structuring your applications to be reusable, and lots of other best practices. I'm in the middle of "Python Web Development with Djang

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Benjamin Buch
I agree, Practical Django Projects is a great book! Altough I would only recommend it if you've read the docs and worked you way through the tutorial (which are both excellent as someone mentioned earlier...) It's full of best practices and a lot of bits and pieces that are not covered by th

Re: Why Django doesn't force testing?

2009-01-05 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-01-05, o godz. 12:27, przez HB: > One nice thing about JBoss Seam and Rails is they encourage unit > testing from the very beginning. > Django as an agile web framework, why doesn't follow the same > philosophy? Because it's a "web framework", not "agile framework"

Re: to understand MEDIA_URL

2009-01-05 Thread Mark Jones
Are you closing the file after you write to it and before you try to send it? Why do you have to write it to a file to deliver it as a static file, why not just render it to a response directly? On Jan 5, 4:13 am, Alan wrote: > Hi List, > Because I couldn't find any idea better I am using "MEDI

Re: Why Django doesn't force testing?

2009-01-05 Thread HB
I'm a Java guy playing around Django so what I will say may not be valid. When I say "encourage testing" I mean generating tests cases whenever we create a Django entity (like model for example). Creating integration testing (like Seam application tests). Include code coverage tool. Include code c

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
2009/1/5 Alistair Marshall : Upgraded to 1.0.2 I'll try and create a cut down version-that may take some time (it is getting to be a large project) Thanks -- Alistair Marshall www.thatscottishengineer.co.uk --~--~-~--~~~---~--~~ You received this message becau

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread Donn
On Monday, 05 January 2009 14:00:16 Eric Abrahamsen wrote: > content.write(o.getvalue()) > super(CustomImageStorage,self).save(name, content) That gives: 'InMemoryUploadedFile' object has no attribute '_mode' Exception Location: /usr/lib/python2.5/site-packages/django/core/files/base.py in

Re: Why Django doesn't force testing?

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 03:27 -0800, HB wrote: > Hey, > One nice thing about JBoss Seam and Rails is they encourage unit > testing from the very beginning. > Django as an agile web framework, why doesn't follow the same > philosophy? Your assumption seems to be mistaken. Djang does encourage testin

Re: File upload failing occasionally

2009-01-05 Thread Graham Dumpleton
On Jan 5, 8:33 pm, ppdo wrote: > The failure does not depend on the file size: I manage to upload files > bigger than 60 MB and fail on 30 kB files. > > I tried with Safari and Firefox and I got the same results, though I > got the *impression* (but given the randomness of the problem I am not

Re: Dynamic OR statements

2009-01-05 Thread alex.gay...@gmail.com
You need to build up the Q object and then filter on it so: results = RelatedModel.objects.all() q = Q() for category in category_list: q |= Q(categories__slug = category.slug) results = results.filter(q) On Jan 5, 10:52 am, Bluemilkshake wrote: > Hello. Django noob here, pretty much. > > I

Re: Access Control Lists implementation for Django?

2009-01-05 Thread Ramdas S
Perhaps this will give you some ideas http://www.b-list.org/weblog/2008/dec/24/admin/ On Mon, Jan 5, 2009 at 3:25 PM, Mir Nazim wrote: > > Hello Guys > > I was wondering that is there any 3rd party ACL implementation for > django. Django's permission system is a bit limited for the app we are

Distinct users ordered by remote field

2009-01-05 Thread coan
I have a model that looks something like this: class Collection(models.Model): user = models.ForeignKey(User) item = models.ForeignKey(Items) date = models.DateTimeField() I'm trying to retrieve a list of unique users ordered by the last time they added something to their collection. I would

Re: unbalanced parenthesis

2009-01-05 Thread mangamonk
thank you! On Jan 5, 4:32 pm, "Alex Koshelev" wrote: > You've forgotten ")" after `(?P\d{4}` > > On Mon, Jan 5, 2009 at 7:30 PM, mangamonk wrote: > > > I'm trying to complete the practical django applications tutorial.. > > > error at /weblog/ > > unbalanced parenthesis > > Request Method:    

Re: Run sql query as read only user

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 11:18 +0100, Matias Surdi wrote: > Hi, > > For some reports, I need to allow the users to enter a sql query.It is > required for this query (a sql SELECT) to be run as a read only database > user. > > > Any idea how to implement this with django? Set the DATABASE_USER s

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 11:33 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > 2009/1/5 Karen Tracey : > > First, I would try 1.0.2 release or current trunk or 1.0.X branch instead > of > > 1.0. There have been additional fixes in this area that you may need, > > depending on what yo

Re: Backward relation to a subclass in multi-table inheritance

2009-01-05 Thread Torsten Bronger
Hallöchen! Carsten Reimer writes: > [...] > > This resulted in instances of class B being returned (which is > probably logical) but I wanted to get the class C-instances. What > I might be able to do, given the instances of class B as shown > before, I might loop over them and get the related c

Re: Why Django doesn't force testing?

2009-01-05 Thread HB
> Your email client apparently failed to generate tests for your > message, resulting in a misunderstanding. Which leads us to that we should be forced to write tests, not encouraged :) On Jan 5, 3:30 pm, James Bennett wrote: > On Jan 5, 6:04 am, HB wrote: > > > Sure, I mean encourage not force

Re: Why Django doesn't force testing?

2009-01-05 Thread HB
Sure, I mean encourage not force :) On Jan 5, 1:53 pm, Malcolm Tredinnick wrote: > On Mon, 2009-01-05 at 03:27 -0800, HB wrote: > > Hey, > > One nice thing about JBoss Seam and Rails is they encourage unit > > testing from the very beginning. > > Django as an agile web framework, why doesn't fol

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread David Zhou
On Mon, Jan 5, 2009 at 3:57 AM, Kenneth Gonsalves wrote: > > On Monday 05 Jan 2009 2:10:34 pm David Zhou wrote: >> >> and covers a lot of materials. >> >> What do you think? >> > >> > As the author, I recommend waiting a couple months. >> >> Are you planning to update Practical Django Projects to

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread Donn
On Monday, 05 January 2009 00:51:03 Donn wrote: > I am stuck on the interface between a PIL Image and a > FilesystemStorage 'content' object. > > I can: img = Image.open(content) > But how do I pass 'img' back to Django for saving? I have some kind of working example now. I won't say I savvy it

Re: Permissions: is something wrong with them?

2009-01-05 Thread Artem Skvira
Can I get Russell's comment on that? On Jan 2, 6:26 pm, Artem Skvira wrote: > Well, > > it's not the usage I'm not clear on but rather architecture. > Would anyone be able to comment on the issues raised? > > Thanks > > On Jan 2, 2:20 pm, Jeff Anderson wrote: > > >ArtemSkvira wrote: > > > Is it

Re: Dynamic OR statements

2009-01-05 Thread Enrico
Hi Mark, I think you could use the Q object like this: q_filter = Q() for category in category_list: q_filter = q_filter | Q(categories__slug=category.slug) results = RelatedModel.objects.filter(q_filter) Best regards, Enrico --~--~-~--~~~---~--~~ You receive

to understand MEDIA_URL

2009-01-05 Thread Alan
Hi List, Because I couldn't find any idea better I am using "MEDIA_URL = '/static/'" as a repository for the output of my application so I can see the results in the web interface and download them. However, I noticed for a particular case where I open and read a file content to be viewed in a web

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Margie
I was a total web framework newbie and got started with the SAMS book. I think it's called "learn Django in 24 hours" or something like that. It has a ton of errors and from that standpoint, it not a good book. However, it is the only book I've found that really leads you step by step through c

Access Control Lists implementation for Django?

2009-01-05 Thread Mir Nazim
Hello Guys I was wondering that is there any 3rd party ACL implementation for django. Django's permission system is a bit limited for the app we are working on. Actually, a per object access control is needed. Thank you in advance for any suggestions. -- Mir Nazim Cell: +91 9469071855 Blog: ht

inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
I appear to be having the same trouble as explained in a previous thread [1] (and for some reason cant find the button to reply to the last thread ???) The other thread points to a bug that was fixed before django 1.0 (which is what I am running) I am not (intentionally) doing anything funny wit

Re: Why Django doesn't force testing?

2009-01-05 Thread James Bennett
On Jan 5, 6:04 am, HB wrote: > Sure, I mean encourage not force :) Your email client apparently failed to generate tests for your message, resulting in a misunderstanding. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Access Control Lists implementation for Django?

2009-01-05 Thread bruno desthuilliers
On 5 jan, 10:55, "Mir Nazim" wrote: > Hello Guys > > I was wondering that is there any 3rd party ACL implementation for > django. Django's permission system is a bit limited for the app we are > working on. > Actually, a per object access control is needed. There's a granular_permissions app, bu

django and database views

2009-01-05 Thread drakkan
Hi all, I mapped a database view in django model as a normal database table, all seems fine and I'm able to follow foreign key too, here is a sample class databaseview(models.Model): field1= user=models.ForeignKey(User) however if i delete an user with re

Re: unbalanced parenthesis

2009-01-05 Thread Alex Koshelev
You've forgotten ")" after `(?P\d{4}` On Mon, Jan 5, 2009 at 7:30 PM, mangamonk wrote: > > I'm trying to complete the practical django applications tutorial.. > > error at /weblog/ > unbalanced parenthesis > Request Method: GET > Request URL:http://127.0.0.1:8000/weblog/ > Exception

Is there an easy way to test ssl protected pages in development server??

2009-01-05 Thread madhav
Is there an easy way to test ssl protected pages in development server? Normally I will be doing the testing by accessing the same urls with http and not https in dev server. Is this the only way? --~--~-~--~~~---~--~~ You received this message because you are subsc

Django-like PHP framework?

2009-01-05 Thread thi.l...@gmail.com
Hi, I have a hard time getting Django adopted as web framework in the office. Mostly because the boss paid for PHP-based trainings, and our current infrastructure leaves little room for mod_python/wsgi/fastcgi... I was wondering if some fo you know about competitor PHP frameworks that "look like

Re: Why Django doesn't force testing?

2009-01-05 Thread Russell Keith-Magee
On Mon, Jan 5, 2009 at 9:04 PM, HB wrote: > > Sure, I mean encourage not force :) Ok, then - what could we do to encourage testing? We have a test framework; it is documented, there are plenty of blog entries around that discuss how to use it, and there are some utilities in the community (such

Re: StringList Field Type

2009-01-05 Thread bruno desthuilliers
On 5 jan, 19:25, "Tiago S." wrote: > Hi, > > I'm porting a app from GAE, which uses the StringList[1] property to > store choices(simple strings) in the Poll model. > > I've read the django tutorial and there they make use of two models > with a relationship between Choices and Polls. This is th

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread A Melé
Donn, take a look at django-thumbs source code, it integrates PIL and SotrageBackend: http://code.google.com/p/django-thumbs/source/browse/trunk/thumbs.py I hope the code helps you. Regards, Antonio Melé http://django.es/blog/ On 5 ene, 13:30, Donn wrote: > On Monday, 05 January 2009 14:00:

Run sql query as read only user

2009-01-05 Thread Matias Surdi
Hi, For some reports, I need to allow the users to enter a sql query.It is required for this query (a sql SELECT) to be run as a read only database user. Any idea how to implement this with django? Thank you very much. --~--~-~--~~~---~--~~ You received thi

Re: Outdated data in django page rendering w/ cacheing disabled

2009-01-05 Thread Malinka Rellikwodahs
On Fri, Jan 2, 2009 at 09:56, Rajesh Dhawan wrote: >> >> As far as I can tell there is no reason for this data to be outdated >> on browser refresh, I've tried looking through the documentation and >> other places to find what could be causing this > > You didn't include a code snippet of how you

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread Donn
On Monday, 05 January 2009 17:50:09 A Melé wrote: > Donn, take a look at django-thumbs source code Many thanks -- it looks familiar now :) \d --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Same form with dropdown on all pages

2009-01-05 Thread ydjango
Thanks I will look into that. I am thinking may decorators can also help. having 2 html forms on one page is turning out to be very tricky. On Jan 4, 3:16 pm, Justin Myers wrote: > It sounds like you're after a custom template > tag:http://docs.djangoproject.com/en/dev/howto/custom-template-

Re: Why Django doesn't force testing?

2009-01-05 Thread alex.gay...@gmail.com
Take a look at Django test utils(formerly test maker) (http:// github.com/ericholscher/django-test-utils/tree/master ), this features some of what you're talking about, helping generate test cases for the user. Ultimately it comes down to the developer knowing more about their application than Dj

Re: Why Django doesn't force testing?

2009-01-05 Thread Емил Иванов / Emil Ivanov
As Russell Keith-Magee suggested having a tutorial on how to do testing is a good way to go. Modifying the django tutorial in the docs to include testing in it should help new-commers get used to testing. Also, having tests in the docs should help convince people that testing is the right way to

Re: Django-like PHP framework?

2009-01-05 Thread Tirta K. Untario
I haven't found an MTV framework like Django on PHP and Django has a very unique concept behind it. But if you want and MVC framework like Rails or Pylons, I recommend you Kohana framework - http://www.kohanaphp.com. Originally based on CodeIgniter, it has evolved a lot, and I vote it as the be

unbalanced parenthesis

2009-01-05 Thread mangamonk
I'm trying to complete the practical django applications tutorial.. error at /weblog/ unbalanced parenthesis Request Method: GET Request URL:http://127.0.0.1:8000/weblog/ Exception Type: error Exception Value:unbalanced parenthesis /home/mark/django_projects/coltrane

Re: Dynamic OR statements

2009-01-05 Thread bruno desthuilliers
On 5 jan, 18:09, "alex.gay...@gmail.com" wrote: > You need to build up the Q object and then filter on it so: > results = RelatedModel.objects.all() > q = Q() > for category in category_list: > q |= Q(categories__slug = category.slug) > results = results.filter(q) Or create a sequence of Q

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread waltbrad
On Jan 5, 3:21 am, HB wrote: > Hey, > I'm reading "The Definitive Guide To Django" but it is too out dated. > Do you recommend "Practical Django Projects" instead? > It seems to me that "The Definitive Guide To Django" is more organized > and covers a lot of materials. > What do you think? > Th

request.FILES always empty

2009-01-05 Thread Glimps
I'm using ModelForm to render my form. I have a FileField in my model that shows up as a type="file" on my page. Thing is, even if I select a file to upload Django always complains about the field being empty and my form never validates. Here's my model: class IOs(models.Model): name

django discarding MySQL results for "in" operator

2009-01-05 Thread JonUK
Apologies as this is a repost, but I'm completely stuck! I'm using django 1.0.2 and the tagging app to retrieve a tag via a database "in" query, and something is causing the query results to be discarded. In particular, this line of code from tagging.utils.get_tag_list() executes: return Tag.ob

Re: request.FILES always empty

2009-01-05 Thread Alex Koshelev
You don't set proper `enctype` to the form [1] [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Mon, Jan 5, 2009 at 11:34 PM, Glimps wrote: > > I'm using ModelForm to render my form. I have a FileField in my model > that shows up as a type="file" on

Re: Django-like PHP framework?

2009-01-05 Thread HB
My PHP friend is really happy with CodeIgnite but I know nothing about it... On Jan 5, 4:11 pm, Peter Bailey wrote: > You might want to have a look at CakePHP. It follows the MCV pattern I > believe, although I have not looked closely because it is PHP not > Python. > > http://cakephp.org/ > > P

Re: Django-like PHP framework?

2009-01-05 Thread Емил Иванов / Emil Ivanov
Welding together Zend Framework, Doctrine and PHPUnit can give you a very good stack to work with. All 3 frameworks are very advanced. You won't get stuff like automatic model forms and the admin for example. Doctrine is a very advanced ORM tool (and a big a complex one as well). ZF is sort of th

Re: request.FILES always empty

2009-01-05 Thread Marc Boivin
Thank you On Mon, Jan 5, 2009 at 3:39 PM, Alex Koshelev wrote: > > You don't set proper `enctype` to the form [1] > > [1]: > http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form > > > On Mon, Jan 5, 2009 at 11:34 PM, Glimps wrote: > > > > I'm using ModelForm to r

Re: manage.py test without using a database?

2009-01-05 Thread Bo Shi
Thanks Russell, the former works great (I was hoping, in my infinite laziness, that there was an undocumented command line switch :-P). Regards, Bo On Jan 1, 1:50 am, "Russell Keith-Magee" wrote: > On Wed, Dec 31, 2008 at 7:08 AM, Bo Shi wrote: > > > Hi, > > > One of our django applications do

exception while rendering: 'utf8' codec can't decode byte 0x92 in position 2911

2009-01-05 Thread adrian
I'm getting this message on line 1 of the template: {% extends "site_base.html" %} Which looks ok to me. I got this while refactoring things. Pretty sure the template was working as is in another location. Any idea how I can debug this, I have no clue. --~--~-~--~~~

Re: StringList Field Type

2009-01-05 Thread Tiago S.
Hi Bruno, > > Then how do you store the number of votes per choice ? > My app is really a quiz with 5 answers per Question and multiples Question per Quiz. I used the Poll analogy to make easier to explain what I really need, as the django tutorial is about a Poll app. > > Overkill, nope. But ho

birth date in a model form

2009-01-05 Thread DragonSlayre
Hi, I've got a ModelForm, and the model for it contains a birth date field (as a DateField): class FiremanForm(ModelForm): class Meta: model = Fireman Currently a single text box is rendered to enter the date, but I'd like to have a drop down list for day, month, year. I'm guessing

Re: exception while rendering: 'utf8' codec can't decode byte 0x92 in position 2911

2009-01-05 Thread adrian
Answering myself, there was an illegal character in site_base.html . On Jan 5, 3:30 pm, adrian wrote: > I'm getting this message on line 1 of the template: > > {% extends "site_base.html" %} > > Which looks ok to me.   I got this while refactoring things. > Pretty sure the template was working a

Re: birth date in a model form

2009-01-05 Thread Brot
Hello, I have the same issue in my app and there is a widget. You can find it here: http://code.djangoproject.com/browser/django/trunk/django/forms/extras/widgets.py But for me this widget misses a few features and there are open tickets with patches, but they are not in trunk yet :-( http://cod

Re: File upload failing occasionally

2009-01-05 Thread ppdo
I tried to monitor the interface using WireShark and the communication just hangs during a data transfer: Apache is just acknowledging the receipt of some packets and then just seems to hang. The suspicious bit is a fairly long series of http RST about 20ms before the server hangs. Though I'm not

Does PhoneNumberField for models exist?

2009-01-05 Thread DragonSlayre
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ This lists PhoneNumberField as being a field type, but in the models documentation, http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields there is no such field. Does anybody know if this field exists? I'd quite l

Re: Port large webapp from PHP to Django: tips, experiences, links needed

2009-01-05 Thread Berco Beute
Still looking for some feedback. :) In the meantime I've collected a few links that might be useful for others with the same questions: http://www.egenix.com/library/presentations/EuroPython2008-Designing-Large-Scale-Applications-in-Python/ http://highscalability.com/ebay-architecture http://high

Shouldn't blank=True imply null=True?

2009-01-05 Thread Mike
Hi. Hopefully this has a quick answer; I tried searching the list but didn't come up with an answer. Context: I'm extending django.contrib.auth.models.User with some extra fields, for instance IntegerField() and ForeignKey(). For non-string fields, whenever you use blank=True you also currently

Newb needs help with tracking variables in Templates

2009-01-05 Thread django_fo...@codechimp.net
I have a pretty simple template that needs to print some data in a bunch of table rows. I have done something like this: {% if my_art_list %} {% count = 0 %} {% for art in my_art_list %} {% if count%3 = 0 %} {% endif %}

Redirect User on First Log In

2009-01-05 Thread Aruna
I'm trying to redirect a user on their first log in, to a special welcome page. Subsequent logins will go to a regular page. Is there a way to do that in the templates? Does Django have a way to check if it's a users first login? --~--~-~--~~~---~--~~ You received

license problem

2009-01-05 Thread Sebastian Bauer
Hello, i want to release some code, but i have one problem: how impel peoples to send me back patches? Any suggestions are welcome :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Newb needs help with tracking variables in Templates

2009-01-05 Thread bruno desthuilliers
On 5 jan, 23:39, "django_fo...@codechimp.net" wrote: > I have a pretty simple template that needs to print some data in a > bunch of table rows. I have done something like this: > > > {% if my_art_list %} > {% count = 0 %} This just won't work > {% for art in my_art_list %} >

Re: Redirect parent from within iframe without losing session

2009-01-05 Thread Berco Beute
This one still has me flabbergasted. It may be a browser restriction (firefox 3), but there is no way I can have the iFrame redirect the parent page to another page in the same domain (as the previous parent page) without invalidating the session. Is there maybe another common solution for iFrames

Re: StringList Field Type

2009-01-05 Thread bruno desthuilliers
On 5 jan, 22:52, "Tiago S." wrote: > Hi Bruno, > > > Then how do you store the number of votes per choice ? > > My app is really a quiz with 5 answers per Question and multiples > Question per Quiz. I used the Poll analogy to make easier to explain > what I really need, as the django tutorial is

Re: django and database views

2009-01-05 Thread Russell Keith-Magee
On Mon, Jan 5, 2009 at 11:31 PM, drakkan wrote: > > Hi all, > > I mapped a database view in django model as a normal database table, ... > there is a know workaround for this? any way to declare read only the > model? In short, no. Django doesn't currently provide any support for database views.

  1   2   >