Re: HTTP Response POST

2005-12-13 Thread PythonistL
I would use a HTTP sniffer and check what is normally send( from a browser).Then I would try to do the same with Django Regards, L.

Re: Migrating existing data into Django models

2005-12-13 Thread tonemcd
I found that any field with primary_key=True leads to a field name with _id appended. So your field will look like user_id_id in the database. Try dropping the '_id' suffix perhaps?

Re: HTTP Response POST

2005-12-13 Thread Jeroen Ruigrok van der Werven
On 12/13/05, PythonistL <[EMAIL PROTECTED]> wrote: > > I would use a HTTP sniffer and check what is normally send( from a > browser).Then I would try to do the same with Django If you use Firefox check out the LiveHTTPHeaders or Tamper Data extensions. These allow you to view the HTTP headers and

Re: question about FieldPathFiled

2005-12-13 Thread Jeroen Ruigrok van der Werven
On 12/13/05, Fat <[EMAIL PROTECTED]> wrote: > I add a FieldPathFiled in my code > fp = meta.FilePathField(path="c:/windows", match="*.gif", recursive=True) > but in admin mode , I got error message. > > . > File "C:\Python24\lib\pprint.py", line 291, in _safe_repr > rep = repr(object) > >

Caching partial templates

2005-12-13 Thread oron
coming from ROR where it's easy to cache partials (parts of templates) I couldn't find a way to cache just parts of my template easily without going back to the cache low level API. What's the suggested strategy for caching for example the home page which will be hit lots of times, in case where

Re: Calling templates within templates - a'la Mason

2005-12-13 Thread oron
so how would you hook Mygthy to Django ?

Can two templates' names in "templates" directory under different apps be same ?

2005-12-13 Thread ashutux
I tried Django for creating a "configuration application". It seemed pretty cool and reduced a lot of my work. I felt frustrated once , while creating two apps under one project , probably I missed few obvious settings. I tried creating two apps under 1 project. This is what I assumed, Django by

Re: Migrating existing data into Django models

2005-12-13 Thread Grigory Fateyev
Hello tonemcd! On Tue, 13 Dec 2005 10:27:30 - you wrote: > > I found that any field with primary_key=True leads to a field name > with _id appended. So your field will look like user_id_id in the > database. > > Try dropping the '_id' suffix perhaps? > Nop, Traceback (most recent call las

[NOOB] ImportError: No module named django.core

2005-12-13 Thread patrick kranzlmüller
i just wanted to create a new app using django-admin.py startapp manage and i get the error ImportError: No module named django.core by the way, i already created an app last week, which worked fine. patrick

Re: [NOOB] ImportError: No module named django.core

2005-12-13 Thread Cheng Zhang
On Dec 13, 2005, at 9:43 PM, patrick kranzlmüller wrote: i just wanted to create a new app using django-admin.py startapp manage and i get the error ImportError: No module named django.core by the way, i already created an app last week, which worked fine. patrick This is due to old *.py

Modeling a category entity which has parent-child structure

2005-12-13 Thread Cheng Zhang
I am trying to model a category entity which has parent-child structure. My model is: class Category(meta.Model): parent = meta.ForeignKey(Tag, related_name="parent_category") child = meta.ForeignKey(Tag, related_name="child_category") class META: admin

Re: Modeling a category entity which has parent-child structure

2005-12-13 Thread Alex Bondarenko
On 12/13/05, Cheng Zhang <[EMAIL PROTECTED]> wrote: > I am trying to model a category entity which has parent-child > structure. My model is: ... > If parent is as same as child, this is considered as top-level Maybe just use "parent == None" condition? And child field. as ForeignKey... Your pare

Re: [NOOB] ImportError: No module named django.core

2005-12-13 Thread patrick kranzlmüller
On Dec 13, 2005, at 9:43 PM, patrick kranzlmüller wrote: i just wanted to create a new app using django-admin.py startapp manage and i get the error ImportError: No module named django.core by the way, i already created an app last week, which worked fine. patrick This is due to old *.py

Re: [NOOB] ImportError: No module named django.core

2005-12-13 Thread Richie Hindle
[patrick] > ImportError: No module named django.core By a weird coincidence I hit this just last night, and eventually worked out that it was because I'd added a source file called "site.py". (My site.py was being imported in place of Python's own site.py, which is partly responsible for settin

Re: [NOOB] ImportError: No module named django.core

2005-12-13 Thread patrick kranzlmüller
[patrick] ImportError: No module named django.core By a weird coincidence I hit this just last night, and eventually worked out that it was because I'd added a source file called "site.py". (My site.py was being imported in place of Python's own site.py, which is partly responsible for se

save_or_update() method on models?

2005-12-13 Thread Benjamin Reitzammer
Hi there, are there any plans on providing something like a save_or_update() method for model objects? I haven't found any ticket or other information regarding this. Maybe this is considered bad practice, but then I would be very interested to know why, if it's the case. Thanks for your help Be

Django screencast

2005-12-13 Thread Tom Dyson
I've made a short screencast which introduces some of Django's key concepts: http://www.throwingbeans.org/django_screencasts.html It's intended as a demonstration, rather than a tutorial, and in the course of building a simple CMS in seven minutes, it covers quite a lot of ground. I'd be gratef

Re: Django screencast

2005-12-13 Thread Afternoon
On 13 Dec 2005, at 17:18, Tom Dyson wrote: http://www.throwingbeans.org/django_screencasts.html +32,768 Nice work! Afternoon, man about the Internet -- http://aftnn.org/

Re: Django screencast

2005-12-13 Thread Adam
I thought the music was an especially nice touch.

Re: Django screencast

2005-12-13 Thread Jeremy Dunck
On 12/13/05, Tom Dyson <[EMAIL PROTECTED]> wrote: > On the other hand, I can upload differently encoded versions fairly > promptly, if H.264 is a problem for too many people. I've still got QT 6, due to hair-brained corporate content filtering. But I imagine I'm the exception, not the rule.

Re: Django screencast

2005-12-13 Thread EspenGrindhaug
Really nice Tom, hope you can make some more of these.

Re: Django screencast

2005-12-13 Thread David Ascher
On 12/13/05, Tom Dyson <[EMAIL PROTECTED]> wrote: I've made a short screencast which introduces some of Django's keyconcepts:Great first step!1) the musical background is a very nice touch.2) in the interactive shell session, I first had the impression because it went by fast that accessing the dat

Re: Calling templates within templates - a'la Mason

2005-12-13 Thread ToddG
I don't know that one would want to hook them together -- I just thought if the OP wanted to develop in a similar style to Mason but using Python, Myghty would be the obvious path to take. Myghty has lots of parts, which might be usable with other frameworks, I honestly don't know it well enough

Re: Django screencast

2005-12-13 Thread Robert Wittams
Great! Shame we're going to break the apis ;-) So a couple of points - * the app template loader would probably have seemed less tedious than the full path thing. Ie just 'templates' in the app directory. Things that might be worth showing in a slightly longer screencast: Templates: * T

Re: Django screencast

2005-12-13 Thread Gábor Farkas
Jeremy Dunck wrote: On 12/13/05, Tom Dyson <[EMAIL PROTECTED]> wrote: On the other hand, I can upload differently encoded versions fairly promptly, if H.264 is a problem for too many people. I've still got QT 6, due to hair-brained corporate content filtering. But I imagine I'm the exception

Re: Can two templates' names in "templates" directory under different apps be same ?

2005-12-13 Thread kmh
ashutux wrote: > I tried creating two apps under 1 project. > ... > Now,I tried calling a template named "login.html" from second apps' > view (second in the sense it was written at second position in > "INSTALLED_APPS" ) but since "login.html" was also present under > templates directory of first

Re: Django screencast

2005-12-13 Thread Rock
Nicely done. Really nice actually. Now since you asked for feedback: Perhaps 8 1/2 minutes would have been better as some of the operations toward the end flew by too quickly to easily comprehend. (I know the show seems slow to the producer who knows the content well, but the first time viewer

Re: Django screencast

2005-12-13 Thread Gábor Farkas
Tom Dyson wrote: I've made a short screencast which introduces some of Django's key concepts: http://www.throwingbeans.org/django_screencasts.html It's intended as a demonstration, rather than a tutorial, and in the course of building a simple CMS in seven minutes, it covers quite a lot of gro

Re: Django screencast

2005-12-13 Thread Adrian Holovaty
On 12/13/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > So a couple of points - The screencast is great. Tom, thanks for taking the time to make it! Here are a few other things, in addition to what Robert said, that could go in the next iteration of the screencast -- * Use the brand-new (and u

Re: Django screencast

2005-12-13 Thread Afternoon
On 13 Dec 2005, at 19:29, Rock wrote: At the very beginning it would be nice to know the precise state of things. (I presume that Django was installed but completely uninitialized, but it would have been nice to be more explicit about that and perhaps to point out which operations were "one ti

Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread braver
I was reading http://www.loudthinking.com/arc/000545.html and it has an emphasis on Ruby's "beauty", and parsimony, as demonstrated by the code excerpt (David: "I was more surprised to learn that someone would actually prefer something like"): class Project(meta.Model): project_manager = meta

Re: Django screencast

2005-12-13 Thread Rock
"Django" is pronounced correctly in the screencast.

is Django too powerful?

2005-12-13 Thread Chris Ryland
As a somewhat burned-out old-time Zope user, Django looks like nirvana for my needs (fairly simple: mostly static "brochureware" web site, plus blog, plus discussion groups, and, eventually, a simple customer database with customer assets and an integrated online store). >From investigating for a

Re: is Django too powerful?

2005-12-13 Thread Rock
Wrong I think. There are already several Djangoids looking at making a discussion forum together as an open project. I expect there will be plenty of similar activities. The problem is that Django is changing fast right now without regards to backwards compatability. Wait until 1.0 hits and soon

Re: is Django too powerful?

2005-12-13 Thread Jacob Kaplan-Moss
On Dec 13, 2005, at 3:58 PM, Rock wrote: Wrong I think. There are already several Djangoids looking at making a discussion forum together as an open project. I expect there will be plenty of similar activities. Yes. The major thrust after 1.0 will be to build up a "standard Django library"

Re: is Django too powerful?

2005-12-13 Thread Ian Holsman
personally I'm all for ease of use, and multiple versions of things, and I'm REALLY happy if it is easy for someone to go and write their own blog software. for example.. I've been slowly getting a phpBB-like forum software up and running for my own uses. and was planning to 'announce/release' ne

Re: Django screencast

2005-12-13 Thread Gábor Farkas
Tom Dyson wrote: I've made a short screencast which introduces some of Django's key concepts: http://www.throwingbeans.org/django_screencasts.html btw. isn't it funny, that virtually all web-app screencasts (ruby on rails, turbogears, django) are done on mac osx? :) i sometimes wonder if

Re: is Django too powerful?

2005-12-13 Thread Eugene Lazutkin
"Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > (Simon has cool ideas about one-click installs of these apps...) Could Simon or you share them with us? Thanks, Eugene

Re: Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread Jeroen Ruigrok van der Werven
Alexy, although I am not Adrian, I still felt compelled to comment. :) On 12/13/05, braver <[EMAIL PROTECTED]> wrote: > class Project(meta.Model): > project_manager = meta.ForeignKey(ProjectManager) > milestones = meta.OneToOneField(Milestone) > categories = meta.ManyToManyField(Category) >

Re: is Django too powerful?

2005-12-13 Thread Jeroen Ruigrok van der Werven
Hi Ian, On 12/13/05, Ian Holsman <[EMAIL PROTECTED]> wrote: > - captcha (text or images based) > - spam and XSS protection Have you seen/read http://www.w3.org/TR/turingtest/ already? Especially the automated circumvention of CAPTCHAs is very interesting. -- Jeroen Ruigrok van der Werven / asm

Re: Django screencast

2005-12-13 Thread Jeremy Dunck
On 12/13/05, Gábor Farkas <[EMAIL PROTECTED]> wrote: > btw. isn't it funny, that virtually all web-app screencasts (ruby on > rails, turbogears, django) are done on mac osx? :) > > i sometimes wonder if this also means that the majority of the > users/devels use macs... It's been the case for a w

Re: is Django too powerful?

2005-12-13 Thread Ian Holsman
it is more about raising the bar and making it more time consuming than the other guys ;-) but yeah..hugo already told me to use text-based captcha (and he has implemented a version of it I think which uses a set of questions that the human needs to answer. oh.. the link reminded me of another i

Re: is Django too powerful?

2005-12-13 Thread James Bennett
On 12/13/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > The major thrust after 1.0 will be to build up a "standard Django > library" of apps so that it's trivial to install a blog app, or a > discussion forum, or a wiki, or... Part of this process will indeed > be to figure out the best pract

Re: Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread James Bennett
On 12/13/05, braver <[EMAIL PROTECTED]> wrote: > and it has an emphasis on Ruby's "beauty", and parsimony, as > demonstrated by the code excerpt (David: "I was more surprised to learn > that someone would actually prefer something like"): Except David glosses over an awful lot in that example; be

Re: Django screencast

2005-12-13 Thread Eugene Lazutkin
"Gabor Farkas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > btw. isn't it funny, that virtually all web-app screencasts (ruby on > rails, turbogears, django) are done on mac osx? :) Because it looks good. Admit it. > i sometimes wonder if this also means that the majority of

Re: is Django too powerful?

2005-12-13 Thread Afternoon
On 13 Dec 2005, at 22:23, Ian Holsman wrote: captcha (text or images based) Working on an image based system right now as it happens :-). It's an implementation of the captchas.net stuff for Django. Really simple but enough to prevent the blight of comment spam I've been getting I hope

Re: is Django too powerful?

2005-12-13 Thread Adrian Holovaty
On 12/13/05, James Bennett <[EMAIL PROTECTED]> wrote: > That would be very cool... I'd been looking at the idea of writing > things like standardized store components (views that could hook into > things like the Paypal direct payment API, etc.), and it's be neat to > have a way to distribute thos

Re: is Django too powerful?

2005-12-13 Thread Afternoon
On 13 Dec 2005, at 23:59, Adrian Holovaty wrote: Of course, once we get an app repository, the distinction between what goes in contrib and what goes in the app repository, becomes even more subjective. Agreed, but in the meantime, I think it's great to stick it all in there. It's a great

Re: Modeling a category entity which has parent-child structure

2005-12-13 Thread Cheng Zhang
On Dec 13, 2005, at 10:53 PM, Alex Bondarenko wrote: On 12/13/05, Cheng Zhang <[EMAIL PROTECTED]> wrote: I am trying to model a category entity which has parent-child structure. My model is: ... If parent is as same as child, this is considered as top-level Maybe just use "parent == None"

Re: Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread braver
OK, can someone please explain to a pythonista what exactly does a phrase like has_many :milestones mean, and what in python prevents us from mimicking it more closely?

Re: Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread James Bennett
On 12/13/05, braver <[EMAIL PROTECTED]> wrote: > OK, can someone please explain to a pythonista what exactly does a > phrase like > > has_many :milestones > > mean, and what in python prevents us from mimicking it more closely? It's expressing a many-to-many or many-to-one relationship. For examp

Re: Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread braver
Um, I guess I wonder what it "means" in terms of syntactic sugar -- the semantics is clear, and that's the claimed ruby's hallmark. I don't yet have a handle on those "symbol" things like :poll ("they're like strings" --huh?), and what's belongs_to? I wonder what would be the closest pythonic sy

Re: Can two templates' names in "templates" directory under different apps be same ?

2005-12-13 Thread ashutux
kmh wrote: > No. Rather, the convention is to put application specific templates in > a subdirectory of the application templates folder with the same name > as the application. That way you can refer to 'app1/login' and > 'app2/login'. See: > > http://code.djangoproject.com/wiki/DosAndDontsFor

sqlobject vs. django

2005-12-13 Thread braver
Now that my appetite is whetted by the cris-py fresh Object-Relational Managers, I keep collecting and comparing them. So far I've found that ruby's ActiveRecord is separable from RoR, and I found SQLobject.org, a totally pythonic ORM (but no cigar... i.e., web). So it begs the question -- what

Re: Comments on Ruby code slides from Snakes and Rubies?

2005-12-13 Thread Jeremy Dunck
On 12/13/05, braver <[EMAIL PROTECTED]> wrote: > > Um, I guess I wonder what it "means" in terms of syntactic sugar -- the > semantics is clear, and that's the claimed ruby's hallmark. I don't > yet have a handle on those "symbol" things like :poll ("they're like > strings" --huh?), and what's be

Re: Can two templates' names in "templates" directory under different apps be same ?

2005-12-13 Thread kmh
ashutux wrote: > I find it a bit unconventional though.. Why have a separate apps_name > ("apps1" for example) directory under template directory of the same > app, since those templates are anyways going to be used by the only > app? > Has this convention appeared just because the way django code