Re: template loading and generic views

2007-10-20 Thread Leo Shklovskii
Does anyone have any thoughts on this? is there a recommended way to lay out the templates on a per-application basis? does it make sense to change either of the two defaults to be consistent with each other? -- --Leo Leo Shklovskii wrote: > I've got a question about the templates that the

Re: Anyone running mod_python for Python 2.5 on Mac OS X?

2007-10-20 Thread Leo
I had a the same symptom when getting Mac OS X 10.4 (comes with Python 2.3) + Python 2.4.3 + mod_python 3.3.1 + apache 2.2.6 going (and in fact, got help from Graham). I ended up having to explicitly point to the right Python framework in my LD_FLAGS line: LDFLAGS= -Wl,-F/Library/Frameworks -u

Re: importing on models.py breaks somethings

2007-10-20 Thread james_027
hi, > "Doesn't work" is not very informative. Does it raise an error? Do > nothing? What is the difference between "works" and "doesn't work" in > this case. > What I mean by "doesn't work" is the in my forms.py it is giving an error that doesn't recognize the objects I have in my models.py

Re: importing on models.py breaks somethings

2007-10-20 Thread james_027
hi, > I can understand why your forms.py is importing models.py, but the > real question is: why is models.py importing forms.py? > I have a custom validation in some of my forms which need some of the object in my models.py. And I don't have my model.py importing forms.py. james

Re: importing on models.py breaks somethings

2007-10-20 Thread Malcolm Tredinnick
On Sun, 2007-10-21 at 00:18 +, james_027 wrote: > hi, > > i have made myself a module name utilities.py and shortcuts.py and > place them in the root folder of my django app. > > When I use them in views.py or forms.py I just put a > > from app_name.shortcut import * > from

make ££££ this is the real deal

2007-10-20 Thread Rich money maker
MAKE MONEY USING PAYPAL Paypal opportunity featured on paypal I'm sure you've read these letters asking you to send £1 to six different addresses. Putting your home address or mailing address on the internet can be risky, but through PayPal all you have to provide is your email address. It's safe

Re: Programming Error: Can't find table from another application ...

2007-10-20 Thread Malcolm Tredinnick
On Sat, 2007-10-20 at 16:51 +, dbee wrote: > Can anyone explain this behaviour to me ? > > When I try to work with the admin panel on 'Myapp', i get this error > telling me that it can't find an entry in the 'Otherapp' table ? > > Myapp and Otherapp are two completely different

Re: importing on models.py breaks somethings

2007-10-20 Thread Marty Alchin
On 10/20/07, james_027 <[EMAIL PROTECTED]> wrote: > but when I try to use it on my models.py in my forms.py it seems that > the from app_name.XXX.models import * doesn't work anymore. It sounds like you have a circular import problem. models.py is importing forms.py, which is in turn importing

importing on models.py breaks somethings

2007-10-20 Thread james_027
hi, i have made myself a module name utilities.py and shortcuts.py and place them in the root folder of my django app. When I use them in views.py or forms.py I just put a from app_name.shortcut import * from app_name.utilities import * but when I try to use it on my models.py in my forms.py

Re: Anyone running mod_python for Python 2.5 on Mac OS X?

2007-10-20 Thread Graham Dumpleton
Ulf Kronman wrote: > Hi Graham, > thanks for your answer. Here some replies to your comments. > > > A few quick comments, although you may have so mucked up your > > installations you might be better reinstalling everything, include the > > OS from scratch. :-) > > Uh-uh. So this implies that

Re: Custom middleware for logging

2007-10-20 Thread Steve Potter
On Oct 19, 8:43 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 10/19/07, Steve Potter <[EMAIL PROTECTED]> wrote: > > > > > I would like to put together a piece of code that will test the > > referer for each request and if it matches a predefined pattern it > > would log that request as

Re: Getting the right data to the template

2007-10-20 Thread Mikkel Høgh
Thank you for your input, Malcolm. I've made up something based on your suggestions in revision 56: http://codebrowse.launchpad.net/~mikl/kaplan/kaplan.dev/revision/56 Sorry for missing your last name in the commit message, but I was off- line when I committed this (7 hour train journey, what

Re: Custom Validator inside of a Custom Manipulator

2007-10-20 Thread Michael Newman
Now that I am moving forward, I am beginning to wonder about the automatic (Free) validation that is supplied in those docs I mentioned above. The profanity filter for example is a great tool. Will that stay in the 1+ versions of Django? I could use them in a BaseForm as: clean_textfield(self):

random seed with multiple processes

2007-10-20 Thread Tomas Kopecek
Hello, We are using django with FastCGI deployment and got the following problem. Inside is used module random which is imported before forking parent process. It means, that each of children processes have same sequence of pseudo-random numbers. Is there any simple way to re-seed random

Re: RESTful Geodjango

2007-10-20 Thread Jeremy Dunck
On 10/20/07, Ariel Mauricio Nunez Gomez <[EMAIL PROTECTED]> wrote: > POINT ( 31.00892404 ... > That NoField type, is it ok? Well, it depends what you're going to do with it. :) That 'NoField' comes from django.db.models.fields.Field.get_internal_type. It was originally used during

Re: RESTful Geodjango

2007-10-20 Thread Ariel Mauricio Nunez Gomez
That restapi is as easy to configure as promised. The address /xml/mymodel now presents an xml list that looks like: XX-83-297 2007-07-27 14:59:18 POINT (31.00892404 - 82.71686560) 71 1 3 That NoField type, is it ok? Ariel PS: Thanks Andreas, and thanks to the geodjango

Re: Custom Validator inside of a Custom Manipulator

2007-10-20 Thread Michael Newman
Thanks for the help. I finally put two and two together. I was following this tutorial http://www.djangoproject.com/documentation/forms/ and somehow got myself all messed up. Thanks for the reply and back to the code. On Oct 20, 4:02 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Well...

Re: python mvc framework and java mvc framework

2007-10-20 Thread M
In the java world, one of the more interesting approach is grails. Http://grails.codehaus.org It uses proven java technology such as hibernate for ORM and spring for MVC. And glue everything together using a jvm dynamic language called groovy. It's worth checking out if you want to explore

Re: Programming Error: Can't find table from another application ...

2007-10-20 Thread dbee
Just in addition to the above. Myapp works fine and I have absolutely no problems running it day-to-day. It's just the admin panel that's dodgy. I have another app that I built in much the same way and I get the exact same error ... can't find table 'Otherapp' whenever I try to access the admin

Programming Error: Can't find table from another application ...

2007-10-20 Thread dbee
Can anyone explain this behaviour to me ? When I try to work with the admin panel on 'Myapp', i get this error telling me that it can't find an entry in the 'Otherapp' table ? Myapp and Otherapp are two completely different applications. I used some of the same code for both of them though -

Programming Error: Can't find table from another application ...

2007-10-20 Thread dbee
Can anyone explain this behaviour to me ? When I try to work with the admin panel on 'Myapp', i get this error telling me that it can't find an entry in the 'Otherapp' table ? Myapp and Otherapp are two completely different applications. I used some of the same code for both of them though -

Programming Error: Can't find table from another application ...

2007-10-20 Thread dbee
Can anyone explain this behaviour to me ? When I try to work with the admin panel on 'Myapp', i get this error telling me that it can't find an entry in the 'Otherapp' table ? Myapp and Otherapp are two completely different applications. I used some of the same code for both of them though -

Programming Error: Can't find table from another application ...

2007-10-20 Thread dbee
Can anyone explain this behaviour to me ? When I try to work with the admin panel on 'Myapp', i get this error telling me that it can't find an entry in the 'Otherapp' table ? Myapp and Otherapp are two completely different applications. I used some of the same code for both of them though -

Re: RESTful Geodjango

2007-10-20 Thread Ariel Mauricio Nunez Gomez
Thanks Justin, I'll try later and let you know. Ariel. On 10/20/07, Justin Bronn <[EMAIL PROTECTED]> wrote: > > > I quickly glanced at the django-rest-interface code and I don't see > any reason why it shouldn't work. There are no plans to combine yet, > though it would be nice to have GeoJSON

Re: RESTful Geodjango

2007-10-20 Thread Justin Bronn
I quickly glanced at the django-rest-interface code and I don't see any reason why it shouldn't work. There are no plans to combine yet, though it would be nice to have GeoJSON serializers for the GEOS/OGR geometry objects. The best way to confirm compatibility is experiment yourself! -Justin

Re: loaddata without pk

2007-10-20 Thread Ariel Mauricio Nunez Gomez
Thanks Malcolm, I just use it to load data for a single model that does not have any relation to others. I generate the data.json with a script but I don't (know)/(want to set) the pk keys in advance. Should I modify loaddata to look for the last pk at the start and fill the gaps? Ariel. On

Re: loaddata without pk

2007-10-20 Thread Malcolm Tredinnick
On Sat, 2007-10-20 at 10:15 -0500, Ariel Mauricio Nunez Gomez wrote: > Is it possible to use loaddata without a pk field and let database set > the proper value? No. The difficulty here is that you wouldn't ever be able to have relations between models, since they refer to each other using the

loaddata without pk

2007-10-20 Thread Ariel Mauricio Nunez Gomez
Is it possible to use loaddata without a pk field and let database set the proper value? Ariel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: datetime field < year 1900

2007-10-20 Thread Tim Chase
> I'm working on a brithdate/deathdate table and am having problems with > this limitation. Realize this is a result of python's datetime > strftime() issue but was wondering if anyone figured out a django > workaround that wasn't a total hackfest. Since I haven't noticed much feedback on this,

Re: two block template tags on after another

2007-10-20 Thread Karen Tracey
Well, if you have gotten it to work, you may not want to revisit it, but for future reference what you describe could more easily have been handled with a simple filter tag. If you just need to remove the dashes and commas, there's a built in "cut" tag provided with Django, which you would use

Re: {{ MEDIA_URL }} empty in templates?

2007-10-20 Thread jkossen
Ah right. With RequestContext() it works. Thanks for the quick reply guys! Much appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

[gis] RESTful Geodjango

2007-10-20 Thread Ariel Mauricio Nunez Gomez
Is it possible/planned to use django-rest-api [1]in geodjango [2] ? Ariel [1] http://code.google.com/p/django-rest-interface/ [2] http://code.djangoproject.com/wiki/GeoDjango

Re: {{ MEDIA_URL }} empty in templates?

2007-10-20 Thread Kristinn Örn Sigurðsson
You need to use RequestContext when you finish your view functions.For example: from django.template import RequestContext from django.shortcuts import render_to_response def myview(request): return render_to_response('base/index.html', {}, context_instance = RequestContext(request))

Re: Anyone running mod_python for Python 2.5 on Mac OS X?

2007-10-20 Thread Ulf Kronman
Hi Graham, thanks for your answer. Here some replies to your comments. > A few quick comments, although you may have so mucked up your > installations you might be better reinstalling everything, include the > OS from scratch. :-) Uh-uh. So this implies that there may be some settings tucked

Re: {{ MEDIA_URL }} empty in templates?

2007-10-20 Thread Malcolm Tredinnick
On Sat, 2007-10-20 at 06:21 -0700, jkossen wrote: > Hi guys, > > While i've read in django-developers that MEDIA_URL should now be > accessible in templates, it doesn't seem to work for me. I'm using > django from svn, currently at revision 6568. > > I've set MEDIA_URL in settings.py,

{{ MEDIA_URL }} empty in templates?

2007-10-20 Thread jkossen
Hi guys, While i've read in django-developers that MEDIA_URL should now be accessible in templates, it doesn't seem to work for me. I'm using django from svn, currently at revision 6568. I've set MEDIA_URL in settings.py, TEMPLATE_CONTEXT_PROCESSORS is not overridden in my code, and

Re: Painful deployment | shared hosting | Need your advice

2007-10-20 Thread Kenneth Gonsalves
On 20-Oct-07, at 3:07 PM, Justin Lilly wrote: > I believe the answer will be no. The main reason being #3 as I > think most other obstacles can be overcome. I would suggest > webfaction as an alternative (from word of mouth, not personal > experience). +1 from personal experience -

Re: Painful deployment | shared hosting | Need your advice

2007-10-20 Thread Kenneth Gonsalves
On 20-Oct-07, at 2:34 PM, erick wrote: > Is it possible to deploy Django in this environment? If yes, any > suggestions? dont even try - change your hosting -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~

Re: Error when I use datetime.now()

2007-10-20 Thread Dirk Eschler
On Samstag, 20. Oktober 2007, Greg wrote: > Hello, > I have a class called Orders that tries to add the current date to > > it's comments field when it's saved. Here is my code: > >from datetime import datetime > > class Order(models.Model): > comments = models.TextField("Comments",

Re: apache2 + mod_python vhosts conflict

2007-10-20 Thread simonbun
Yes, apache needs that line for virtualhosting to work at all. If it is not provided, apache just picks the first virtualhost it finds and sends requests its way, regardless of Host header. regards, Simon On Oct 20, 11:36 am, Wiley <[EMAIL PROTECTED]> wrote: > Graham, > > I am not to my

Re: Anyone running mod_python for Python 2.5 on Mac OS X?

2007-10-20 Thread Graham Dumpleton
A few quick comments, although you may have so mucked up your installations you might be better reinstalling everything, include the OS from scratch. :-) 1. Why are you using Apache 2.1. The Apache 2.1 stream was a developmental version stream, it should not be used for production use. You

Re: Painful deployment | shared hosting | Need your advice

2007-10-20 Thread Justin Lilly
I believe the answer will be no. The main reason being #3 as I think most other obstacles can be overcome. I would suggest webfaction as an alternative (from word of mouth, not personal experience). On 10/20/07, erick <[EMAIL PROTECTED]> wrote: > > > Heres my scenario: > 1. shared hosting. > 2.

Re: apache2 + mod_python vhosts conflict

2007-10-20 Thread Wiley
Graham, I am not to my knowledge using mod_cache...I certainly never set it up, but as far as I can tell, the definitive factor was that single NameVirtualHost * line Please let me know if there's any further testing I can do to help you Wiley On Oct 20, 5:33 pm, Graham Dumpleton <[EMAIL

Re: apache2 + mod_python vhosts conflict

2007-10-20 Thread Graham Dumpleton
Huh. I'll have to do some experimentation now, but I don't quite understand why at the level of mod_python at least, that would make a difference. Are you using any Apache caching system, mod_cache etc? Graham On Oct 20, 7:22 pm, Wiley <[EMAIL PROTECTED]> wrote: > Sorry - further

Re: apache2 + mod_python vhosts conflict

2007-10-20 Thread Wiley
Sorry - further experimentation revealed the following: it was not the python eggs line that made the difference, it was the fact that i had not put the NameVirtualHost * line in my apache2.conf file this is covered in the documentation, thanks again for everyones help On Oct 20, 4:00 pm,

Painful deployment | shared hosting | Need your advice

2007-10-20 Thread erick
Heres my scenario: 1. shared hosting. 2. no official django support. 3. no command/shell access. 4. server runs Apache version 1.3.37 (Unix) 5. database is MySQL version 4.1.22-standard 6. mod_fastcgi is enabled 7. no mod_python 8. my WWW directory is located in /home/<>/public_html Is it

Re: Custom Validator inside of a Custom Manipulator

2007-10-20 Thread [EMAIL PROTECTED]
Well... Your code looks like a crazy mixture of newforms and oldforms :) Now it is much wiser to use newforms. They don't have validators, nor manipulators. The information on newforms can be found in django documentation. --~--~-~--~~~---~--~~ You received this

Re: apache2 + mod_python vhosts conflict

2007-10-20 Thread Wiley
Update on this issue, things seemed to work themselves out when I commented out the python eggs line in each of the virtual hosts settings and re-enabled the virtual hosts using the a2ensite in apache... I hope that this might be a help to any other web dev newbies out there :) Thanks to

Re: py2app & py2exe

2007-10-20 Thread johan de taeye
Marcio, >>What is the status of this issue now? Anyone found a solution? Yes, using py2exe for packaging a django application sure is possible. Based on my py2exe+django experience with frePPLe [1]: 1) py2exe is an excellent way to package a django application in a simple and straightforward