Django admin multi layour

2008-07-11 Thread Christian Kortenhorst (Forum)
Hey All

Just been messing around with django and found that can not seam to get
admin to work how, it does not support multilayer input I want it I know
there is some way of writing your own "view", but wondering would it be
possible to write a multilayer setup or what is the wok around or what
should i be looking for?

my setup is


class Faculty(models.Model):
class Admin: pass
name = models.CharField(maxlength=200)
director = models.CharField(maxlength=200)
web_url = models.CharField(maxlength=200)

def __str__(self):
return self.name

class School(models.Model):
class Admin: pass

faculty = models.ForeignKey(Faculty)
name = models.CharField(maxlength=200)

def __str__(self):
return self.name

class Programme(models.Model):
class Admin: pass

duration_choices = (
('Years', 'years'),
('Days', 'days')
)

school = models.ForeignKey(School)
name = models.CharField(maxlength=200)
description = models.CharField(maxlength=1000)

def __str__(self):
return self.name

class Stream(models.Model):
class Admin: pass
programme_code = models.ForeignKey(Programme,
edit_inline=models.TABULAR, num_in_admin=3)
stream_number = models.IntegerField(core=True)

.



Want to be able to click in and keep adding programs to a school and when i
do that a new box is created and a steam is created.

e.g.

add a Faculty
-> input for school is shown
-> add a school
-> -> input for Programme is shown
-> -> add a programme
-> -> -> etc..

also the option to add new school and program so can have a one to many
relationship.

Thanks
Christian K

-- 
Christian Kortenhorst
mod: +353-(0)87-6183349
home: +353-(0)1-4966287
--
http://mail.python.org/mailman/listinfo/python-list

cron popen xen-create-image

2008-03-03 Thread Christian Kortenhorst
Hey just wondering could anyone help me

Have script that runs through cron but seams to run but xen-create-image
goes to end but shoes up errors because some stuff it not being passed.
./grabJob.py
# RUN all the Create ENVIRONMNET commands here
run="/usr/bin/xen-create-image --hostname=%s --ip=%s" %
(hostname, ipadd[0])
print run;
try:
fs=os.popen(run)
for file in fs:
error = error + file

If run just ./grabJob.py it works ok and outputs
en:/var/www/apache2-default# ./grabJob.py
Grabbing Jobs
running create
Jobs runnning
Creating environment ckortenhorst1
/usr/bin/xen-create-image --hostname=ckortenhorst1 --ip=192.168.0.111
DONE

Can anyone help

-- 
Christian Kortenhorst
+353-(0)87-6183349
+353-(0)1-4966287
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Backup Script over ssh

2008-02-27 Thread Christian Kortenhorst
But there is no rsync for windows without using cygwin

On 2/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>
> En Thu, 21 Feb 2008 09:32:23 -0200, Christian Kortenhorst
> <[EMAIL PROTECTED]> escribió:
>
>
> > I am new to python and the list.
>
>
> Welcome?
>
>
> > I want to create backup script for my windows PC and upload to Linux
> > server
> > over ssh but whats the best way to go about this.
>
>
> rsync? No need to reinvent the wheel...
>
> --
> Gabriel Genellina
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
CK Computer Solutions
Christian Kortenhorst
+353-(0)87-6183349
+353-(0)1-4966287
-- 
http://mail.python.org/mailman/listinfo/python-list

Backup Script over ssh

2008-02-21 Thread Christian Kortenhorst
Hey all

I am new to python and the list.
I want to create backup script for my windows PC and upload to Linux server
over ssh but whats the best way to go about this.
Just want to copy the modified and new files up to server in folder that has
Month/Year so every month new sync is created, but every day new files at
midnight are uploaded.

Can anyone help?

Thanks

-- 
Christian Kortenhorst
-- 
http://mail.python.org/mailman/listinfo/python-list