Re: Django or TurboGears for a new survery application?

2006-11-05 Thread iain duncan

On Sun, 2006-05-11 at 14:27 -0600, Adrian Holovaty wrote:
> On 11/5/06, Matt Culbreth <[EMAIL PROTECTED]> wrote:
> > So, based on this, my initial leaning had been to go to TurboGears.  My
> > thoughts were that the application is not interested in content
> > management or display, and that I'd like to use a bit of AJAX goodies
> > here and there.
> >
> > Any different take on this?  Is Django a fit here and I'm not seeing
> > it?

I like both approaches ( Gears and Django's ) but for what you describe
I would go with Django. If you need a simple admin interface, then
Django shines in that regard, and further Django uses a Poll as an
example in the tutorials so you'd probably have a really easy time
getting going!

Iain



--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Admin problems when object is created by a view

2006-11-03 Thread iain duncan

If I create a new instance of a database object from a view, this item
appears fine in the database and even in the changelist view of the
admin, but clicking on the item ( as if going to delete or edit it )
just gets a template error. Anyone know why this is?

Ie in the the view method we have

hit = Hit()
save.hit()

And in the model:

class Hit( models.Model ):
date_time  = models.DateTimeField( auto_now_add="True" ) 
   
class Admin: 
pass


The hits appear as a list in the admin but can't be clicked on.

Thanks
Iain


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: OT: MySQL to SQLite?

2006-11-03 Thread iain duncan

I do this kind of thing a lot, and find it's much much easier to have
MySQL on both machines and use mysqldump. A big advantage of two mysql
specific installs is that you can use mysqldump with the field name
option and it will still work fine even if you are changing models. I
write little bash scripts that dump everything, drop the tables, call
manage.py syncdb to create the new tables, and then refill the tables.

I would honestly say it will take much less time for him to get mysql
running on the laptop ( which is simple with fink ) than to figure out a
nice porting system.

Iain



--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Is Django the right tool for the job?

2006-11-03 Thread iain duncan

On Fri, 2006-03-11 at 13:17 +, elake wrote:
> Thanks. Thats what I thought. I think that we are going to put up a
> site that is all from a WYSIWYG and in the background I am going to
> work on a Django powered site. Would you recommend Postgres over MySQL
> or the other way around?

I think that is a wise choice. You could use something static or do a
Drupal install, and then you won't be trying to learn Django under
deadline. If I can't get a client to bite for a custom CMS in Django,
Drupal is the off-the-shelf cheap solution I recommend because it is at
least well documented, cleanly coded ( though in PHP ) and easy to
install and maintain. Sometimes a client is determined to muck around
with the CMS themselves and I can trust them more with Drupal than with
Django code. ( It's dead easy to break a django site if you don't know
what you're doing! )

Django makes web dev much much faster, but does not really make it
*easier* for a beginner, in that you do have to understand and wrap your
head around a fair bit of coding to get it going. For an experienced
coder on the other hand, it makes building a complex CMS far easier.

For what you are doing I don't think it will matter which RDBMS you use.
I personally use MySQL because I never do anything complicated with a
database ( where Postgres would shine ) and MySQL is IMHO better
documented for the beginner and more widely available on cheap hosting.
Django will talk to both just fine so go with whatever looks easiest to
get up and running. You may even want to use SQLite to lower hosting
costs.

Hope that is useful,
Iain



--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Is Django the right tool for the job?

2006-11-02 Thread iain duncan

> I am working with a small team to create a new web site for our
> church.
> We have found a site (http://www.prestonwood.org) that we would like
> to
> use as a model and I am wondering if django is the right tool for the
> job. I looked at other django powered sites (http://www.ljworld.com/,
> http://www.lawrence.com/) and they have some of the same features.
> What
> I am wanting to do is give login access to the pastors and other 
> leaders to update the pages that go with their ministries.
> 
> OK, so now to the questions (assuming that django is the right tool to
> use).
> 
> 1. Would it be best to do this all as one app or a separate app for 
> each page?
> 2. Should there be one database instance or multiple (one for each
> page/app)?
> 3. Is the admin page the tool to use for the posters to use to update
> the site?
> 

Django is definitely great for that kind of project, as long as you are
expecting to write python code and not just plug stuff in. If you are
weighing it against an off the shelf CMS like Drupal, it may or may not
be the best solution. If you were planning on doing any degree of coding
and customization yourself, then I'd say it's worth the effort to learn
Django.

As to the answers:
- one app and one database will be fine and probably easiest for you to
do while learning
- yes, it's very easy to add accounts to the admin interface that have
limited privileges.

Iain


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Admin template variable reference?

2006-11-01 Thread iain duncan

Wondering if there exists somewhere some documentation listing *all* of
the template variables available in the various admin views. If not, I
think such a thing would be really really useful. 

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Changing admin template for only certain models

2006-10-31 Thread iain duncan

On Tue, 2006-31-10 at 20:19 -0600, James Bennett wrote:
> On 10/31/06, iain duncan <[EMAIL PROTECTED]> wrote:
> > I would like to change the template ( or change behaviour ) for the
> > change list view, but only for one model. Can anyone tell me how one
> > could find out in the template which model we are representing? Or
> > alternately, where in the admin code one might add extra variables to
> > render to the template?
> 
> When Django renders the list, it looks for the following templates, in
> order, and uses the first one it finds:
> 
> admin/appname/modelname/change_list.html
> admin/appname/change_list.html
> admin/change_list.html
> 
> Where 'appname' and 'modelname' are the names of the application and
> the model, respectively. To override for a specific application, make
> a directory with the name of that application, and put a
> 'change_list.html' template in it. To override for a specific model,
> make the 'appname' directory, make a 'modelname' directory and put the
> 'change_list.html' template inside it.
> 

Looking in change_list.html I find this:

{% block result_list %}
{% result_list cl %}
{% endblock %}

I'm confused by the above, as I don't know how that middle tag is
working. It's not the same block inheritance as in the tutorial. Is
there a way to change how that tag is rendered on a per model basis?

Looking forward to that book ... ;)

Iain



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Changing admin template for only certain models

2006-10-31 Thread iain duncan


> When Django renders the list, it looks for the following templates, in
> order, and uses the first one it finds:
> 
> admin/appname/modelname/change_list.html
> admin/appname/change_list.html
> admin/change_list.html
> 
> Where 'appname' and 'modelname' are the names of the application and
> the model, respectively. To override for a specific application, make
> a directory with the name of that application, and put a
> 'change_list.html' template in it. To override for a specific model,
> make the 'appname' directory, make a 'modelname' directory and put the
> 'change_list.html' template inside it.

Trying the above suggestion I've run into one snag. I can change
change_list.html and it works for only the model in question, but I
don't seem to be able to get any results out of changing a copy of
change_list_results.html in the same directory, which has the part of
the template I actually want to edit. Any clue why this might be? I can
successfully change change_list_results.html in my main admin template
directory.

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Changing admin template for only certain models

2006-10-31 Thread iain duncan

On Tue, 2006-31-10 at 20:19 -0600, James Bennett wrote:
> On 10/31/06, iain duncan <[EMAIL PROTECTED]> wrote:
> > I would like to change the template ( or change behaviour ) for the
> > change list view, but only for one model. Can anyone tell me how one
> > could find out in the template which model we are representing? Or
> > alternately, where in the admin code one might add extra variables to
> > render to the template?
> 
> When Django renders the list, it looks for the following templates, in
> order, and uses the first one it finds:
> 
> admin/appname/modelname/change_list.html
> admin/appname/change_list.html
> admin/change_list.html
> 
> Where 'appname' and 'modelname' are the names of the application and
> the model, respectively. To override for a specific application, make
> a directory with the name of that application, and put a
> 'change_list.html' template in it. To override for a specific model,
> make the 'appname' directory, make a 'modelname' directory and put the
> 'change_list.html' template inside it.

Aha, ok, so instead of actually changing what goes to the template I can
route by model.

Now, I am also however interested in hacking on the admin views/models
themselves. Is there some way of replacing those much like one does for
templates? Would I make an entire copy of the admin interface and link
to my copy through the settings file? I would like to be able to send
more info through template variables to my extended templates.

Thanks for the tip!
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Changing admin template for only certain models

2006-10-31 Thread iain duncan

I would like to change the template ( or change behaviour ) for the
change list view, but only for one model. Can anyone tell me how one
could find out in the template which model we are representing? Or
alternately, where in the admin code one might add extra variables to
render to the template?

I have been playing with what looks like the admin code, the stuff in my
/usr/local/src/django_src/django/contrib/admin
but I do not appear to be able to even break the admin interface. Is
there some sort of caching going on?

Thanks
iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Adding a button to admin view?

2006-10-31 Thread iain duncan

Hi folks, I would like to add a custom form button to the admin
interface somehow and am not sure how to go about it. 

I want to add a "download now" button the list view for some file
entries, so it needs to be a link to file. Any idea how this should be
done? 

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Smartest way to integrate pulldown menus?

2006-10-27 Thread iain duncan

Just wondering if anyone has any recos for best
toolkit/library/widget/approach to adding dynamic pull down menus to a
Django app. I am leaning towards using mochikit and dojo whenever
possible because of their adoption by python frameworks, but I am also
happy to use whatever fits. Lost in the sea of javascript toolkits!

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Dojo vs Mochikit for Django dev?

2006-10-17 Thread iain duncan

I have not dug into either Dojo or Mochikit yet and am wondering if one
is more suited to Django dev than the other for adding AJAX type bells
and whistles. Pros and Cons of either?

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Hosting on GoDaddy?

2006-10-15 Thread iain duncan

On Sun, 2006-15-10 at 08:20 +, [EMAIL PROTECTED] wrote:
> Ian,
> 
> First off congrats on the project and your good sense to do it in
> Django. :) I've not used Python CGI but I presume it follows the
> standard cgi model of having to launch a new process for each request.
> This will crawl under Django if that's the case. You're gonna need
> something that allows your process to hang around and be reused for
> each request which is what fastcgi and others do for you. **Definitely
> confirm this before acting on this advice**.
> 

They say they have Fast CGI, performance is ok with that?

Could anyone tell me exactly what I should ask GoDaddy then?

Iain



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Hosting on GoDaddy?

2006-10-14 Thread iain duncan

I just landed a job for a python CMS and custom shopping cart, but
unfortunately the client has recently purchased 5 years of hosting from
GoDaddy. Go Daddy says it supports Python CGI. 

He is prepared to switch hosts and bite the cost if need be, but
obviously would prefer not to. Can anyone on here vouch either way for
whether this is feasible?

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



How to override the admin save method?

2006-10-14 Thread iain duncan

I got some previous advice on overriding how the admin does delete which
was pretty straightforward as it does just uses a url. The Save button
doesn't seem to work that way.

I would like to save a file name not as it is given, but in an altered
format based on another field, so before the file gets uploaded I need
to save it's name. Any tips on how to approach that?

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



order respect to problem

2006-10-10 Thread iain duncan

Has anyone got this working? Or any other way of ordering items in the
admin interface by foreign key? I get error messages in the admin
interface with the example below, as far as I can tell it is like the
manual.

Example from manual:

class Answer(models.Model):
question = models.ForeignKey(Question)
# ...

class Meta:
order_with_respect_to = 'question'


My code:

 # articles, sub blocks within the sections
class Article( models.Model ):
name = models.CharField(maxlength=100)
section = models.ForeignKey(Section)
headline = models.CharField(maxlength=200, blank=True, null=True, 
default='' )
body = models.TextField( blank=True, null=True, default='' ) 
order = models.IntegerField(default=0)
date = models.DateField(blank=True, null=True, default='')
visible = models.BooleanField(default=True)
   
def __str__(self): 
return "%s - %s" % ( self.section, self.name )
class Admin: pass

class Meta:
order_with_respect_to = 'section'
ordering = [ '-date', 'order']
verbose_name_plural = 'Articles'

Thanks
Iain



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Re: What IDE do you use? (semi-OT)

2006-10-08 Thread iain duncan

On Sun, 2006-08-10 at 21:39 -0500, James Bennett wrote:
> On 10/8/06, iain duncan <[EMAIL PROTECTED]> wrote:
> > - the python interface for gvim ( allows running a python interpreter
> > within vim that can in turn call methods on the vim buffers ).
> 
> Hooray for C-c C-c in Emacs!
> 

I was mentioning it to let other people know about it, not to convert
you or continue the ridiculous holy war. Many vim users are not aware
that you can host a session within the editor and control the editor
itself from python. I don't actually care what editor you use and don't
see how the above comment really helps anyone. Am I likely to look that
up in an emacs manual just because of your zealousness? 

Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: What IDE do you use? (semi-OT)

2006-10-08 Thread iain duncan

>  
> > It's got all the "standard" features: syntax highlighting,
> > indentation, etc., but it's also got so much more. The
> > text-manipulation things it can do run circles around everything else,
> > it's got support for Subversion and WebDAV, it has an insanely
> > powerful editing file browser built-in... nothing else comes close.
> 
> Isn't there a risk of drowning if you drink as much of the Emacs
> Kool-Aid as you clearly have been doing?

Ha ha, too funny. Yup, vim all the way. YMMV. Oops, not supposed to say
that in holy wars am I? God uses vim and he is on my side! ;)

On a serious note, I use:
- fluxbox on linux
- heavily pimped out gvim ( ie much customization )
- the python interface for gvim ( allows running a python interpreter
within vim that can in turn call methods on the vim buffers ).

I find the above combo very handy because fluxbox is very easy to
re-key, as is vim, and it is also easy to run python code from within
vim and on the vim buffers. Then I leave open three windows of locked
docs, one of terminals ( pydev server, mysql client, linux filesystem ),
one of vims, and one of browser. I have a vim function mapped to do all
the typical djangoey things, resync db, restart apache, reload page on
browser etc.

I am looking into the python controlled window manager though, perhaps
that would be even quicker. And I want to add remote control of the
macintosh lappy for instant previews of all browsers ( css compatibility
and all that crap. )

Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Shopping carts with Django?

2006-09-29 Thread iain duncan

On Fri, 2006-29-09 at 12:14 -0700, alex kessinger wrote:
> http://satchmo.python-hosting.com/
> 
> is an attempt to make an ecommerce site using django

Wicked cool. I'll subscribe. When do we get name something Lester or
Prez? Guess I'd have to invent it. ;)

Thanks
Iain

Oh yeah, to the Satchmo dudes, whoever you are, the about link on the
trac page is broken. 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Shopping carts with Django?

2006-09-29 Thread iain duncan

Hi everyone. I've done a couple of few django CMS sites now and have in
the past done a complete custom ecommerce-cms-order tracking system in
php. Now I have a client that I would like to use Django with and they
need a simple but customized shopping cart system. Wondering what folks
are using to do this in Django. Any libraries or examples out there? Any
Django middleware I should take a look at? Or is it worth gluing a
Django site to another existing cart system? Myself I tend towards the
wanting to do it myself side of things, but obviously there are limits!

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: I'm so confused...

2006-09-25 Thread iain duncan

On Tue, 2006-26-09 at 07:50 +0530, Kenneth Gonsalves wrote:
> 
> On 26-Sep-06, at 2:20 AM, Julio Nobrega wrote:
> 
> > committed, and learn 2 programming languages, Javascript and Python,
> > plus HTML.
> 
> and SQL and CSS

If you are new to coding, I would suggest that you focus on the python
stuff for now. You'll be fine with a cursory knowledge of SQL as Django
hides most of the SQL drudgery from you, but it's worth at least being
familiar with the basics. And I would not say that javascript is a good
first language in the slightest! 

Get comfortable with Python and a good editor and learn your regular
expressions. I like gvim, but people will fight me to the death on that
one, ha ha.

Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: I'm so confused...

2006-09-25 Thread iain duncan

On Mon, 2006-25-09 at 20:44 +, [EMAIL PROTECTED] wrote:
> Well Iain perhaps I should shut up and try it first!
> 
> I've set up a laptop to try a clean install of python without
> corrupting my current webdev setup.

If you're willing to try it, more power to you! I'd recommend picking up
a copy of "Beginning Python" by Magnus Hetland ( Apress ). There are
also very good tutorials on learning python online linked from
python.org.

Good luck,
Iain




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: I'm so confused...

2006-09-25 Thread iain duncan

On Mon, 2006-25-09 at 20:20 +, [EMAIL PROTECTED] wrote:
> Ok,
> 
> I decided that I don't want to spend $1,000s on other people coding my
> databases etc so I thought Django looked pretty good. I read some of
> the code and it seems pretty intuitive (with a lot of hard work!)
> 
> Now my problem is understanding just what the hell is being said in all
> these setup tutorials.
> Am I right that Django is a command line based language?
> 
> This might seem a bit silly to you all but I like environments such as
> dreamweaver with GUIs and options.

I don't think you're looking for Django then. You might have better luck
with something like Drupal for PHP, or buy Ellington from the Django
guys. Django is a very powerful framework *for programming in python*.
It does assume a fair bit of programming experience and is not at all a
gui tool.

Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Fast hosting for Django

2006-09-25 Thread iain duncan

On Mon, 2006-25-09 at 03:01 -0400, David Sissitka wrote:
> With a VPS you could install mod_python, either building Apache with it or by 
> loading it dynamically. For more information, see the documentation:
> 
> http://www.modpython.org/live/current/doc-html/installation.html
> 
> I know for a fact that KnownHost would help you get things up and
> running if you're not comfortable with administering your own server.
> Hope it helps. 

Any thoughts on SliceHost? Seems like a nice way to go if I'm the
developer and the deployer.

Iain



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Fast hosting for Django

2006-09-24 Thread iain duncan

On Sun, 2006-24-09 at 23:18 -0400, David Sissitka wrote:
> I am a WebFaction customer, definitely not a bad company. A few
> thoughts about WebFaction:
> 
> 1) It's a one man show, at least, support is. Support ticket response
> times are anywhere from three hours to a day and a half. 
> 2) The control panel may be appealing but it is definitely flawed. It
> supports Firefox and Internet Explorer, but things are pretty slow
> with Opera. Their long running process monitoring (You're allowed one
> long running process at $14.50 USD a month.) is pretty bad as well,
> stopping and restarting your Apache instance leaves orphaned processes
> that you cannot monitor or kill off yourself. 
> 
> Other then that, it's not to bad. If I were in your position I would
> definitely pick up a VPS though, for $5.49 more you could join
> KnownHost or Rimuhosting.

If you are using a VPS, do you need to know that they support
mod_python, or do they allow you to install modules for your virtual
server?

Thanks
Iain
> 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Fast hosting for Django

2006-09-24 Thread iain duncan

I know this has been asked many times, but as new hosting solutions pop
up continually, just wanted to check on recommendations for good fast
shared hosting that is Django friendly and reliable for business
clients.

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Javascript image preloading problems from tempates

2006-07-17 Thread Iain Duncan

Hello fellow djangoers. I've been doing a gallery site that is too image
heavy for it's own good ( yes, I'm subcontracted by a graphic designer
... ), and am trying to find good ways to control image loading so that
the user will wait and then see all the numerous and large images at the
same time instead of seeing them pop up one at a time. I managed to get
this to work ok on the first page using a javascript loaded in the head
that preloads hard full paths to the images and delays the rest of the
page load until images will be done. However, I can't get the same
things to work properly in the rest of the site when I use dhango
templates to preload. Is there perhaps some weirdness about combing
django templates with javascript preloads that I don't know about? Any
tips on how I should go about this?

The old home page is at:
http://bmg.webfactional.com
The load controlled version that is working is at:
http://bmg.webfactional.com/test
The page that doesn't work the way I want is if you go from the above to
the artists section.

If any one has tips for this javascript newby, many thanks!
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Free video of the Jenna Jameson

2006-07-16 Thread Iain Duncan

carlito556 wrote:
> Free video of the Jenna Jameson
> 
> at http://www.rosapink.net 

Jenna Jameson and Django Reindhardt, who knew?
Those jazz players are always trouble ... ; )

Iain
"I'm all in favour of grants for jazz musicians. Or any other brand of
scotch" -- Eddie Condon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-14 Thread Iain Duncan



Andy Dustman wrote:
> On 7/14/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
> 
>>On Jul 14, 2006, at 1:18 PM, Adrian Holovaty wrote:
>>
>>>Some folks benchmarked Symfony, Ruby on Rails and Django. Django was
>>>the fastest.
>>
>>By over 30% -- hell yeah!
>>
>>Now, I've always known in my gut that Django's pretty damn fast, but
>>seeing it verified by the RoR website...
>>
>>Priceless :)
> 
> 
> And with MySQL, to boot.

This is not surprising, it was a "many small hit" benchmark, and mysql
has long outperformed PostGress in that department. I've also seen
shootouts of python vs perl vs php for backending and mod_python just
plain hauls ass. ;)

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Set up problems ( webfaction )

2006-07-13 Thread Iain Duncan


> Now my only remaining hurdle ( db migration was surprisingly easy! ) is
> those admin media files. I notice you have
> 
> alias /media/ /home2/bmg/django/django/contrib/admin/media/
> 
> and that you have loaded the alias module from
> loadmodule alias_module /etc/httpd/modules/mod_alias.so
> 
> I tried this out with no apache complaints but still no admin media. The
> docs suggest a link to the media files, but they don't say what that
> link should be ( ie I don't know where django is looking for them! )
> Any tips on that? I think maybe we should suggest to Remi to add
> mod_alias to the stock modules set up in apache2/modules.

Got it! Wound up just copying the admin media directories into my media
directory. Pipe up if there's a better way ...

Thanks for the tips and the very useful screencast.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Set up problems ( webfaction )

2006-07-13 Thread Iain Duncan


> in your apache config do something similar to
> http://svn.zyons.python-hosting.com/trunk/zilbo/conf/zyons.conf.tmpl
> 
> and that will let the apache handle the 'images' area of your site  
> instead of django.
> 
> On 14/07/2006, at 12:02 PM, Iain Duncan wrote:

Thanks Ian, got them working. I was actually thinking as I watched the (
very helpful ) screencast that it would be nice to have a link to the
files used. ;)

Now my only remaining hurdle ( db migration was surprisingly easy! ) is
those admin media files. I notice you have

alias /media/ /home2/bmg/django/django/contrib/admin/media/

and that you have loaded the alias module from
loadmodule alias_module /etc/httpd/modules/mod_alias.so

I tried this out with no apache complaints but still no admin media. The
docs suggest a link to the media files, but they don't say what that
link should be ( ie I don't know where django is looking for them! )
Any tips on that? I think maybe we should suggest to Remi to add
mod_alias to the stock modules set up in apache2/modules.

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Set up problems ( webfaction )

2006-07-13 Thread Iain Duncan

I'm setting up a sight on webfaction, and so far things are coming along
ok, but I can't figure out how to serve images. I've never used a shared
hosting setup that didn't have a directory called 'public' or 'htdocs'.
Has anyone on here used them? Any tips on where I need to put media and
what I need to put in my httpd.conf to get this working?

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: IBM Article on TurboGears (w / Django Comparison)

2006-07-12 Thread Iain Duncan

Good read Ian, thanks for the post.

Iain

Ian Maurer wrote:
> IBM has published the 2nd part in my two-part series on Web
> Development frameworks.
> 
> http://www-128.ibm.com/developerworks/linux/library/l-turbogears/
> 
> Also, at the end of this article I include my comparison of the 2
> frameworks. I tried to be as objective as possible.
> 
> Hopefully both projects will benefit from this additional exposure.
> 
> Thanks to everyone who has helped create these great projects and
> continue working on them. Special thanks to Kevin and Adrian for
> offering feedback.
> 
> If you catch any issues with this article, please send me an email and
> I will get a fix in.
> 
> regards,
> Ian
> 
> (This exact post will appear in both newsgroups, but I didn't
> cross-post since I thought that might be frowned upon...)
> 
> > 
> 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Limiting table editing in admin interface

2006-07-11 Thread Iain Duncan

Can anyone tell me if it's possible to limit which entries within a
given table can be edited in the admin?

I've made a client user account that can only edit certain models, but I
would also like to make sure within those model/tables there are some
entries that they can't change. ( ie no deleting the home page and stuff  )

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: book recommendations?

2006-07-10 Thread Iain Duncan

> Design-to-code process (HTML/CSS mostly): Designing With Web Standards
> http://www.amazon.com/gp/product/0321385551

Amazon and Indigo both say "customers also bought"
"Web Standards Solutions: The Markup and Style Handbook (Pioneering
Series)" by Dan Cederholm

Any opinions on that? Or on
"Cascading Style Sheets: The Definitive Guide 2e: The Definitive Guide
Author: Eric Meyer"

I need to find some good resources too on CSS and how I can best
integrate it with template engines. Opinions welcome

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Deploying and set up on shared hosting?

2006-07-08 Thread Iain Duncan


> They do also offer business-level accounts with SLA-style guarantees
> on uptime, though, and common sense would recommend going that route
> if it's what you really need.. I've always marveled at the number of
> people out there who claim to have "mission-critical" sites but are
> unwilling to pay more than the base $12/mo. shared plan to host
> them...

Sorry, what is SLA? And I agree, which is why I put a clause in the
signed requirement list that says that the feature list is subject to me
approving the hosting package. So I'd better make sure my approval is at
least well founded ... and I told them that they won't be getting
business quality hosting at bargain basement prices. Why companies want
to stick with their $10 a month host when they're spending thousands on
the site is beyond me, but it seems a rather common phenomena!

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Archlinux now running django!

2006-07-08 Thread Iain Duncan



Ian Holsman wrote:
> congrats Sandro.
> it looks great.
> 
> I'd be interested to hear what you (and others) think were the  
> biggest obstacles you had and how you overcame them.
> 
> regards
> Ian

Yeah, that's one of the nicest layouts I've seen (IMO) for an info-rich
site. Especially like the nav tabs on the top.

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Deploying and set up on shared hosting?

2006-07-08 Thread Iain Duncan


>>how many other hosting providers are here ;-)
> 
> 
> I don't have any formal connection with them, but TextDrive
> (http://textdrive.com/) is fairly Django-friendly by nature, and I
> wrote a (now slightly outdated, but I'll be updating it soon) manual
> for deployment there: http://manuals.textdrive.com/read/book/15/

I checked them out on a friends reco, but got the impressions that
reliable uptime for a business was not really their priority, so I don't
feel like I could in good faith put a clients site up there that is just
supposed to keep working. Correct me if I'm wrong?

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Deploying and set up on shared hosting?

2006-07-07 Thread Iain Duncan



Jay Parlar wrote:
> Probably WebFaction (formerly python-hosting.com) would be your best
> bet: http://www.webfaction.com/shared_hosting

That looks sweet. Anyone else have any feedback on these guys?

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: development/production mode

2006-07-07 Thread Iain Duncan


>>Do most shared hosting providers allow one to do that? I would have
>>thought not 
> 
> 
> not - unless you are on vps hosting with root access, mod_python is  
> not an option unless your provider is kind enough to restart apache  
> regularly with a cron job - even that may not be enough as you would  
> need to fiddle with apache conf now and then

So what should I be looking for in your opinion?

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: PostgreSQL vs. MySQL

2006-07-07 Thread Iain Duncan


> One of the big advantages of MySQL is ease of use and a choice when it comes 
> to how you store data. For example: if you need fast reads and less updates, 
> make your table MyISAM (you can even compress it making it smaller and 
> faster!). If you need high availability of your data, you can go MySQL 
> Cluster. Need a data to /dev/null, use the blackhole engine! ;)

This probably explains shoot outs I had read last year that claimed
MySQL was more appropriate in a case where your database needs are
simpler, but you expect to have the server doing a *lot* of small hits (
say a high traffic forum ), whereas PostGres shone for more
sophisticated transaction support ( say an ordering system with payment
gateway). My data may well be out of date on this, however. As with many
things, the two keep getting closer.

IMHO, if you are doing simple stuff with the DB ( say cms things ) and
you are relatively new to it all, MySQL documentation seems to be more
accessible to newbies and more prevalent on the internet. It's worth
thinking that what might be *best for you* is not necessarily *the best
product*. Ease of use and documentation are more important for db-lite
beginner cases, less so for complicated e-commerce transactions where
your going to be making damn sure you know what you're doing.

Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: development/production mode

2006-07-07 Thread Iain Duncan



Wade Leftwich wrote:
> Iain Duncan wrote:
> 
>>>>how do you handle changes on a site which is already online (talking
>>>>about changing models and/or views)?
>>>
>>>
>>>I typically maintain a duplicate setup on a testing machine (in my
>>>case, a laptop running Linux) and use that for development and
>>>testing, then when I know I've got the bugs worked out I deploy the
>>>changes in production.
>>
>>This is my first time using mod_python in production, how do you handle
>>the need to restart apache? I have to figure this stuff out for a
>>clients sight this week and don't want any surprises! =)
>>
>>Iain
> 
> 
> sudo /etc/init.d/apachectl graceful
> 
> This will restart apache after it finishes serving current requests

Do most shared hosting providers allow one to do that? I would have
thought not 

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Deploying and set up on shared hosting?

2006-07-07 Thread Iain Duncan

I'm new to Django, but have a project done that must go up live next
week for a client. However, it's just glamorized brochure ware with and
admin interface, so they likely want to use shared hosting. Can anyone
tell me:

- Recomendations for reliable shared hosting that is Django friendly
with service to the developer ( me ) being more important than price.

- How does one deal with the "restart apache" issue on a shared hosting
account? Is it even possible?

- What's likely the best setup given the above? FastCGI instead of
mod_python? Any tips for deployment?

Thanks
Iain
( I use apache 2.0 and mod_python on the home dev server )

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: development/production mode

2006-07-07 Thread Iain Duncan


>>how do you handle changes on a site which is already online (talking
>>about changing models and/or views)?
> 
> 
> I typically maintain a duplicate setup on a testing machine (in my
> case, a laptop running Linux) and use that for development and
> testing, then when I know I've got the bugs worked out I deploy the
> changes in production.

This is my first time using mod_python in production, how do you handle
the need to restart apache? I have to figure this stuff out for a
clients sight this week and don't want any surprises! =)

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Using a Django project in a python script.

2006-07-06 Thread Iain Duncan


>>As a part of the application I'm writing I need to do certain things to
> 
> the database every night. The easiest way to implement this would be a
> python script run every night by cron.
> 
> Set env DJANGO_SETTINGS_MODULE setting for the script. Then just use
> your models and template as you do this in a views.
> 
> PS: Is there a FAQ?..

Just out of curiositiy, does that make one use the database API much as
one would use SQLobject on it's own? ( new to both django and sql-object
interfaces myself )

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Code exectution and persistent object question

2006-07-05 Thread Iain Duncan


>>Ok, so we're would be smart place to do housekeeping you want to have
>>happen no matter what page is loaded? 
> 
> 
> Middleware: http://www.djangoproject.com/documentation/middleware/
> 
> You can have functions that run prior to a request being passed along,
> prior to a view function being called, after an exception and/or after a
> response has been created, with full access to the request and response.

Thanks Malcolm. Guess that's what I'll read next!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Code exectution and persistent object question

2006-07-05 Thread Iain Duncan

> Separate client hits might hit separate Python interpreter instances,
> and each of those instances will have imported the global namespace on
> their own, creating separate global namespaces.
> 
> So like Steven said, it's not safe to do anything in the global
> namespace. If you need a per-session singleton, you can store it in
> request.session. If you need a per-application singleton, then you're
> going to have trouble...
> 

Ok, so we're would be smart place to do housekeeping you want to have
happen no matter what page is loaded? Perhaps store all the housekeeping
in a per session singleton and start every view method with a call to it?

Thanks guys
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Code exectution and persistent object question

2006-07-05 Thread Iain Duncan


> Code in the global namespace is executed at module import time.
> These variables live as long as the python interpreter runs. (at least 
> thats my understanding of it)
> 
> This is great for constants and such, but you can't rely on it to store 
> state variables as, depending on the environment/server you run python 
> on, you have no or little control of how or when the interpreter is 
> restarted.
> 
> With mod_python on *NIX for example, you have multiple apache processes 
> each with it's own python interpreter. An apache process serves n 
> requests, then it's killed and a new one is started. Subsequent requests 
> from one client will not necessarily be served by the same apache process.
> 
> So no, it's not safe to store important data there. It's better to use a 
> session, database, or file based solution.

Thanks for the explanation. Does that mean that objects created in the
global namespace are shared between seperate client hits on the app too?
Specifically I'm wondering how this will affect the best way to use
singleton objects.

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Deletion of foreign key relations in admin view?

2006-07-05 Thread Iain Duncan


>>This feels more like a problem to be solved at the database level; the
>>ideal solution would be to set 'ON DELETE SET NULL' for the
>>foreign-key column (assuming -- and I don't know if this is the case
>>-- that Django is doing 'ON DELETE CASCADE'). Just make sure that
>>column will accept NULL as a value.
> 
> 
> But that's moot because apparently Django doesn't output that in the SQL.
> 
> http://code.djangoproject.com/ticket/2288 <-- for those who want to
> follow its progress.

Ok, good to know that the issue is an issue. In the meantime, I figured
I'd hack around it by making a custom delete method for the admin
interface that first changes foreign keys to nulls and then deletes the
page. I definitely want the client having to delete two things
seperately instead of being able to accidentally kill a page. Any idea
where in the docs/code I'd start looking for how to do this? I'm okay
with writing SQL myself.

Thanks
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Null values in Foreign Keys?

2006-07-04 Thread Iain Duncan

>>foo = models.ForeignKey( bar, null=True, blank=True )
> 
> 
> Give this one a go again. This is the form that should work. Perhaps
> there was another problem that got in the way? BTW there is nothing
> wrong with using a null field for your foreign key relationship in most
> schemas, from a practical perspective.
> 
>  -rob

Thanks Rob, that worked. I know I tried that one but I guess I mustn't
have properly refreshed the database or something. Working now!

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Deletion of foreign key relations in admin view?

2006-07-04 Thread Iain Duncan

One of my very few gripes with the otherwise amazing admin interface is
the way deletions are handled when foreign key relationships are there.
If you want to delete one item, it takes out any others depending on
this item. Makes sense in a way, but could be very dangerous in the
hands of a client who didn't notice the dependency.

Can anyone tell me where in the docs to look for how to overide the
deletion behaviour so that instead of dependecies and dependers getting
mutually deleted, the foreign key in question can just revert to a null
value? Concrete example is that if a webpage has a central image, and
the admin deletes the central image before changing the page, the page
should have an image of Null instead of vanishing into the ether.

Thanks
iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Code exectution and persistent object question

2006-07-04 Thread Iain Duncan

I stumbled on some behaviour that I'm sure is explained somewhere but
not in the tutorials so I haven't found it.

I made a global log object for debugging. I noticed instantiating
objects in the view global name space executes before anything else in
the views module on page load, very useful for global containers or
loggers. I also noticed that on subsequent page loads, this code does
NOT get re-executed, and the state of member variables in the global
object are preserved.

Questions: how is this accomplished? Are global objects serialized
behind the scenes in a session indexed table, and if so which one?
Is this behaviour safe to *rely* on for preserving state in an ongoing
session? IE could you safely implement a shopping cart that way? Seems
like very useful default behaviour.

Suggestion, maybe there should be a mention of this in the views
tutorial? Or was there one and I've been cramming this all in to my head
so fast it bled out the other end? ;)

Loving it all so far!
Iain
( And my tendons are sooo happy not to be reaching for [EMAIL PROTECTED]> all 
the time! )

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django & Apache 1.x

2006-07-04 Thread Iain Duncan


>>Well... Mod_python is the easiest method of running django, FastCGI
>>setup is more advanced and usually requires basic knowledge about
>>forking vs. threading, writing init scripts etc. These are things that
>>makes it harder for beginners to understand Django itself so in my
>>opinion it's good that docs encourage Apache 2 + mod_python setup.
> 
> 
> Yes, I agree with that. But by reading that line, I was confused and
> thought I understood that Django *only* supported Apache 2.x. On the
> 'Apache+FastCGI' wiki page, it does not mention something like 'this
> works on Apache 1.x and 2.x" --agreed, AFAIK listing modifications to
> httpd.conf implies Apache 1.x, but you get my point :-)
> 
> To the rest of the documentation wizards, is this worth addressing?

I am not a doc wizard, but IMHO it is *always* worth addressing doc
issues re set up that are ambiguous and make one wonder how to get
started. I think most open source projects vastly undersestimate how
important ease of entry is to their growth. This encompasses both how
easy it is to get started and how easy it is to find or make hosting
Django friendly. Witness PHP, much worse langauge ( I use it when it
pay$), incredibly easy to get started in, best documentation I've seen
anywhere, and no problem setting up. Result: staggeringly large user base.

For Django to grow, I think the most important hole in the docs right
now ( now that those tuturials are done, which are very good! ) is a
cohesive set of guidelines on getting it working on various server
platforms. Indeed we have them, but they are mixed in with a mess of
(often misleading) comments and confusion.

my two cents!
Iain


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Null values in Foreign Keys?

2006-07-03 Thread Iain Duncan

In addition, I checked my mysql table and the field in question is
implemented as an integer with Null allowed and default set to Null, so
it appears that syncdb is creating the table properly, but the admin
interface is not letting me put in a null value for some reason.

Thanks
Iain

Iain Duncan wrote:
> The Django sites related-objects documentation says:
> 
> "if a ForeignKey field has null=True set (i.e., it allows NULL values),
> you can assign None to it. Example:
> 
> e = Entry.objects.get(id=2)
> e.blog = None
> e.save() # "UPDATE blog_entry SET blog_id = NULL ...;"
> 
> But I can't figure out how to set it so that the admin interface will
> allow creation of an object with an empty foreign key field.
> 
> I have tried:
> 
> foo = models.ForeignKey( bar, null=True )
> foo = models.ForeignKey( bar, null=True, blank=True )
> foo = models.ForeignKey( bar, null=True, default=None )
> 
> They all seem to build ok, but in the admin interface you still can't
> set up an object without picking one of the 'bar' objects in the drop
> down. Anyone have any idea how to get it to work ok with null values? I
> realize this isn't great database design, but it greatly simplifies
> building the admin interface for an otherwise simple database.
> 
> Thanks
> Iain
> 
> > 
> 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Null values in Foreign Keys?

2006-07-03 Thread Iain Duncan

The Django sites related-objects documentation says:

"if a ForeignKey field has null=True set (i.e., it allows NULL values),
you can assign None to it. Example:

e = Entry.objects.get(id=2)
e.blog = None
e.save() # "UPDATE blog_entry SET blog_id = NULL ...;"

But I can't figure out how to set it so that the admin interface will
allow creation of an object with an empty foreign key field.

I have tried:

foo = models.ForeignKey( bar, null=True )
foo = models.ForeignKey( bar, null=True, blank=True )
foo = models.ForeignKey( bar, null=True, default=None )

They all seem to build ok, but in the admin interface you still can't
set up an object without picking one of the 'bar' objects in the drop
down. Anyone have any idea how to get it to work ok with null values? I
realize this isn't great database design, but it greatly simplifies
building the admin interface for an otherwise simple database.

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: A small proposal to make it easier to find things

2006-07-03 Thread Iain Duncan


> There already is one:
> http://code.djangoproject.com/wiki
> 
> Doesn't contain many full tutorials though.

Ah oops, I've been there and didn't even realize it was a wiki! Could
certainly do with more fleshed out tutorials on set up and such. Perhaps
I will find time to contribute after my current project is done.

I think one problem with the current set up on the site is that the main
tutorials have commenst, some of which are now just misleading but are
still up there.

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: A small proposal to make it easier to find things

2006-07-03 Thread Iain Duncan

What about a Django wiki for tutorial type things? Gentoo has one that
has been enormously useful to me and could serve well as a model.

Iain

James Bennett wrote:
> One of the great things about Django is that there are lots of people
> out there motivated to write about it and share things they've found
> or developed which would be useful to the Django community at large,
> but even with the community aggregator[1] and various search engines
> giving lots of love to Django bloggers, it can be difficult to keep
> track of all the new stuff people are writing.
> 
> So I'd like to propose a small convention for the community: when you
> write something about Django that you think would be useful, or when
> you spot something someone else has written, bookmark it at
> del.icio.us or ma.gnolia and tag it with "django-tips"; that way
> others can just watch that tag and see useful new things rolling in.
> 
> Who's with me?
> 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django on Debian Sarge?

2006-07-02 Thread Iain Duncan



> which would indicate that Gentoo's stable mod_python still isn't new
> enough, odd as that sounds.  It's only one patchlevel higher than
> Sarge's version.
> 
> 
>>...My home dev box is
>>gentoo, all I had to do was emerge mod_python and the mysqldb e-build (
>>can't remember name ), checkout django from svn, and follow the
>>instructions on the tutorial.
> 
> 
> OK, well, that's reassuring, and maybe indicates that that comment is
> wrong and Sarge is likely to work too.

Hey Dustin, I just checked my version numbers and I am definitely
running mod_python 3.1.4. Serving with apache2 is working fine ( also
from the gentoo ebuild ).

Powers-that-be, what should be done about misleading comments on the sites?

Thanks
iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django on Debian Sarge?

2006-07-02 Thread Iain Duncan

> Hi, I was looking at trying Django for a project and noticed that in the
> comments to the installation directions it was claimed that Debian
> Sarge's mod_python isn't recent enough to run Django.  That would be a
> big complication.  Is anyone running Django on Sarge, and can anyone
> confirm that it does/does not need something besides the bog-standard
> apache2/mod_python/postgres/etc already in the stable package pool?
> 
> Though it's much less important, I wouldn't mind knowing the same answer
> for Gentoo (with just x86 keywords) since it might be handy to do some
> development on a Gentoo laptop.

I haven't installed on Sarge, but on Gentoo it's no problem because
installing the newest stable packages is the default ( sarge's are
tested much longer with much longer release cycle ). My home dev box is
gentoo, all I had to do was emerge mod_python and the mysqldb e-build (
can't remember name ), checkout django from svn, and follow the
instructions on the tutorial. This is assuming you have apache and your
database engine set up already, but that's really just more of the same.
I didn't need to use anything except regular gentoo ebuilds.

Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Django friendly hosting in Canada?

2006-07-02 Thread Iain Duncan

Anyone have good recomendations for a canadian hosting company that
makes setting up Django sites easy? Will pay higher prices for good
service and stability.

Thanks
Iain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---