Re: POST to view loses POST data

2006-06-19 Thread Adrian Holovaty

On 6/17/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
> I agree 100% with James on this one. Having request.POST be an empty
> dictionary evaluating to True -- that's just too odd. I think we ought
> to bite the bullet and add request.method, which would be a shortcut
> to a normalized (all caps?) version of request.META['REQUEST_METHOD'],
> which is cumbersome to type and might not (?) always be upper case.

As of changeset [3164], I've added the attribute request.method, which
is a string such as "POST" or "GET".

I debated making request.method a magic object that would let you
check via attribute access, as some syntactic sugar:

if request.method.POST:

...but I decided that would be too magic, and it would actually get in
the way of people doing stuff like "if request.method in ('GET',
'POST')". A plain string will do.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 memory leak -- or caching?

2006-06-19 Thread Adrian Holovaty

On 6/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Yes, I was in debug. Both calling db.reset_queries() and setting debug
> = False fixed the issue.
>
> Thanks everyone!

I've added this to the FAQ because it comes up from time to time.

http://www.djangoproject.com/documentation/faq/#why-is-django-leaking-memory

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



FileField - my variable used in "upload_to" parameter

2006-06-19 Thread ciukes2

Hi!

Is there way to change "upload_to" parameter's behaviour?
I see there is hardcoded strftime replacement.

What I want to achieve is to organise uploaded files with directories
named with uploading user's name. eg. MEDIA_ROOT/uploads//

Regards,
ciukes.


--~--~-~--~~~---~--~~
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: Inline Editing in Admin Interface

2006-06-19 Thread Matthew Flanagan

On 6/20/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
>
> On 6/16/06, Tyson Tate <[EMAIL PROTECTED]> wrote:
> >
> > On Jun 16, 2006, at 3:02 PM, Joseph Kocherhans wrote:
> >
> > > Get rid of the inner Admin class on your tag object. That's what
> > > causes it to show up on the main admin page.
> > >
> > > Joseph
> >
> > If I do that, then I can't add any objects inline. Does Django not
> > allow one to do this?
>
> Odd. I swear it's worked for me before, but now that I think about it,
> the permissions wouldn't be created w/o the inner class... Anyhow, you
> can do this another way by overriding the admin/index.html template.
> It may not be as simple as you'd like, but it will work.
>
> Joseph
>

I opened a ticket a while back about permissions and content types not
being created if a class doesn't have an inner Admin class.
http://code.djangoproject.com/ticket/1856 is the one. I have a patch
attached to it as well which decouples permissions and contenttypes
from the admin.


regards

matthew

--~--~-~--~~~---~--~~
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: Many to Many Ordered List

2006-06-19 Thread Ivan Manolov

I am having a similar problem here.
having read the m2m_intermediary/  wiki page, I still cant wrap my head
around the idea of displaying a multiple select dropdown list of
related objects on the admin side.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem with overriding save() and related objects

2006-06-19 Thread [EMAIL PROTECTED]

I'm writing a simple app with a Document model and a Recipient model,
with a ManyToMany relationship between the two.  When the document is
saved, I'd like all related recipients to be sent an email.  I've tried
overriding the save() method of my Document object, but it cannot
access the related recipients; doing

self.recipient.all()

within the save() function returns an empty set because the m2m
relationship between the document and the recipients doesn't get
established until after the document object is saved.  So it appears
you can't do anything dependent upon related objects within a model's
save() function.

Now, if I set up a join table (a DocumentRecipient model with Document
and Recipient as foreign keys) and override the DocumentRecipient
save() function to send the email, that works, but that seems like a
clunky way to do things.  Is there a better way using signals or
something?


--~--~-~--~~~---~--~~
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: Many to Many Ordered List

2006-06-19 Thread yml

Here it is a link that details the solution a bit more:

   -
http://www.djangoproject.com/documentation/models/m2m_intermediary/

Yann


--~--~-~--~~~---~--~~
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: Many to Many Ordered List

2006-06-19 Thread yml

I would handle  this kind of situation by adding an intermediate class
AttributeOfTheLink. I don't know if this is a good practice but I think
it will do the tricks.

Let me know if you find something better.

Yann


--~--~-~--~~~---~--~~
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: Many to Many Ordered List

2006-06-19 Thread [EMAIL PROTECTED]


James Bennett wrote:
> On 6/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > The problem is, how can I preserve the many to many relationship, but
> > have a specific order for the bands?  Any ideas?
>
> You should be able to take the QuerySet of bands for the concert and
> tack on an 'order_by()' to sort by whatever field you like on the band
> model.

That's a good idea, except the bands will be in a different order
depending on the show they're in.  Somedays Stevie Wonder is the
headliner, other days he's just opening for Prince.

Thanks for the idea.  I think this might be a complicated thing to
handle, without an easy answer.

Chris


--~--~-~--~~~---~--~~
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: List of command-line commands?

2006-06-19 Thread James Bennett

On 6/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Is there a simple list somewhere showing all these options?

http://www.djangoproject.com/documentation/django_admin/

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Many to Many Ordered List

2006-06-19 Thread [EMAIL PROTECTED]

Hi There,

I just released my first pubic facing Django site, and have run into a
design problem.  It's a music blog / band site at
http://www.victimoftime.com

Something I didn't consider when I was building it (I'm the tech guy,
others are the content people) is that at a given concert, the bands
play in a specific order, and that order is important.

I chose to use Many to Many relationships for concerts and bands, so
that I can easily give a view of a particular concert, with the bands
involved, click on a band, and get a listing of upcoming shows, etc.

The problem is, how can I preserve the many to many relationship, but
have a specific order for the bands?  Any ideas?

If nothing else, I'm probably going to include a field for band order
that's just a string.  Then use some regexes to figure out which band
is which from the list.  

Thanks in advance.

Chris


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



List of command-line commands?

2006-06-19 Thread [EMAIL PROTECTED]
Folk,I really like SPE (Stani's Python Editor), and was thinking about adding a module which gives a simple gui interface to start/stop server, admin, etc.Is there a simple list somewhere showing all these options?
Mike

--~--~-~--~~~---~--~~
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: custom form view not keeping information

2006-06-19 Thread hotani

I'm pretty much giving up on this -- unless i find an alternative, I'm
going to end up using hidden fields with the generic update view. I
know this is far from ideal, but I can't get anything else to work.

Basically this is a bug tracker - kind of a get-my-feet-wet app to test
out Django. In order to close a bug, i have to actually show a checkbox
for the boolean field "closed" and the user has to click it to confirm
they are closing the bug. That is not at all what I wanted, but it is
the only thing that works.

In addition, since I can't seem to write a view that works, I'm having
to pass the "closed_date" and "posted_by (user)" with hidden fields -
this sucks pretty hard, but I'm out of options.


--~--~-~--~~~---~--~~
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: ForeignKey - 'xxx_id may not be NULL' question

2006-06-19 Thread Jos Yule

Dang - i just found this too:

http://www.djangoproject.com/documentation/models/many_to_one_null/

Thanks!


--~--~-~--~~~---~--~~
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: ForeignKey - 'xxx_id may not be NULL' question

2006-06-19 Thread James Bennett

On 6/19/06, Jos Yule <[EMAIL PROTECTED]> wrote:
> Via the admin interface (using the latest SVN version), i can't create
> a new Client instance without also choosing or creating a new Note
> instance. I don't need to have _every_ client have a note, just some
> (the reason i carved Note off into its own Table).

What you need is to add 'null=True' on the Client's 'other' field.
'blank' means that the value can be left unfilled in the admin (e.g.,
if you're going to calculate the value for the field based on
something else, fill in a default, whatever, before you actually try
to save it), where 'null' means that a NULL value can go into the
database. If you want to leave something blank and have it go in NULL,
you need both.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ForeignKey - 'xxx_id may not be NULL' question

2006-06-19 Thread Jos Yule

Hey, i've got a (simplified) model like this:


class Note (models.Model):
content = models.TextField(core=True)

class Client (models.Model):
other = models.ForeignKey(Note, blank=True)



Via the admin interface (using the latest SVN version), i can't create
a new Client instance without also choosing or creating a new Note
instance. I don't need to have _every_ client have a note, just some
(the reason i carved Note off into its own Table).

Is this the same for ManyToMany relationships too?

Thanks!


--~--~-~--~~~---~--~~
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: Announcing Tabblo, a Django app

2006-06-19 Thread wiz

On 5/18/06, Ned Batchelder <[EMAIL PROTECTED]> wrote:
>
>  Hey all,
>
>  We've just launched a Django-based application for story-telling, focused
> on sharing photos: Tabblo.  We'd love for you to come and try it out.
> Adrian has demonstrated his skill yet again by creating a nice tabblo about
> his visit to London: Moreno at Le Quecumbar, London.
Tabblo gets on slashdot: http://yro.slashdot.org/article.pl?sid=06/06/18/203209

Fasten seatbelts... (=

--~--~-~--~~~---~--~~
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: Existing database into django models?

2006-06-19 Thread [EMAIL PROTECTED]
NP.  Thanks guys, excellent responses!On 6/19/06, Josh Trutwin <[EMAIL PROTECTED]> wrote:
On Mon, 19 Jun 2006 14:18:54 +0100"Phil Powell" <
[EMAIL PROTECTED]> wrote:>> This ought to do the job:>> http://www.djangoproject.com/documentation/legacy_databases/
Definately - it does a decent job building a starting Model, butyou will definately have to go through it and make sure everythingis to your liking.  For one, I'm not sure if it sets up ForeignKeys if you are not using an engine like InnoDB.
Josh> -Phil>> On 19/06/06, Mike Crowe <[EMAIL PROTECTED]> wrote:> >> > Hi folks,> >> > I'm just starting looking at a django backend for a system we
> > need to redo.  The existing db is MSSQL (yes, I know it's not> > quite supported yet).  We need a system which supports most of> > the adodb classes.  We will start with supported DB's, and
> > hopefully the additional ones will be ready when we are.> >> > However, here's my question:  The existing DB is very well laid> > out. Is there a way to convert that DB Schema into django
> > models?  Doesn't have to be purely automatic, but any tool> > which would help this migration would be appreciated.> >> > TIA> > Mike> >> >> > >
> >>> >

--~--~-~--~~~---~--~~
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: Template: nested for and ManyToMany field problem - MySQL

2006-06-19 Thread Adam Hoscilo

> Then you want entry.categories.all in your template.

That was the problem. Thanks.
--
Adam Hoscilo


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Please Help with Template for django.views.generic.create_update.update_object

2006-06-19 Thread Paul Childs

I am using the Dev trunk as of Saturday with the models below:

#--
class Repair(models.Model):

tail_number = models.IntegerField(choices=AIRCRAFT_CHOICES)

location = models.CharField(maxlength=30)
damage_type = models.CharField(maxlength=50)

class Admin:
pass

Iclass Photo(models.Model):
repair = models.ForeignKey(Repair, edit_inline=models.TABULAR,
num_in_admin=1)
caption = models.CharField(maxlength=200, core=True, blank=True)
filename = models.ImageField(upload_to="tam", blank=True,
null=True)
#--

The following template works but does not handle more than one photo.

#--

  
tail number:
{{ form.tail_number }}
{% if form.tail_number.errors %}
  *** {{ form.tail_number.errors|join:", " }}
{% endif %}
  
  
location:
{{ form.location }}
{% if form.location.errors %}
  *** {{ form.location.errors|join:", " }}
{% endif %}
  
  
damage type:
{{ form.damage_type }}
{% if form.damage_type.errors %}
  *** {{ form.damage_type.errors|join:", " }}
{% endif %}
  
  
Photo Caption:
{{ form.photo.0.caption }}
{% if form.photo.0.errors %}
  *** {{ form.photo.0.caption.errors|join:", " }}
{% endif %}

Photo Filename:
{{ form.photo.0.filename_file }}
{% if form.photo.0.filename_file.errors %}
  *** {{ form.photo.0.filename_file.errors|join:", " }}
{% endif %}

{{ form.photo.0.filename }}

  




#--

Could someone please give me a push in the right direction on how I
would handle more than one photo. I tried to take a stab at it doing
this but it just failed silently...

#--
{% for photo in form.photo_set.all %}

Photo
Caption:
{{ photo.caption }}
{% if photo.caption.errors %}
  *** {{ photo.caption.errors|join:", " }}
{% endif %}

Photo Filename:
{{ photo.filename_file }}
{% if photo.filename_file.errors %}
  *** {{ photo.filename_file.errors|join:", " }}
{% endif %}

{{ photo.filename }}

{% endfor %}
#--

I looked at the contrib/admin/templates, the wiki and docs and really
didn't come up with anything that describes how to handle this
situation. Any help will be greatly appreciated.


--~--~-~--~~~---~--~~
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: Recursive delete problem

2006-06-19 Thread spacedman

Indeed! Perhaps nobody thought anyone would ever override the delete()
method...

I'm not sure why the strategy is to gather together all the related
objects and then do the SQL rather than call the delete() method on
each of them. Perhaps its more efficient. Perhaps it avoids possible
loops where two objects refer to each other, or perhaps its all done in
one transaction to keep the DB consistent.

I can't see a simple way of doing what would seem to be the 'right
thing'. What you really need is some sort of 'pre_delete' method. Oh
dear, those things seem to have disappeared with the 'magic-removal'
code...

Probably worth filing this as a bug... If its not there already, I cant
find it!


--~--~-~--~~~---~--~~
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: Existing database into django models?

2006-06-19 Thread Josh Trutwin

On Mon, 19 Jun 2006 14:18:54 +0100
"Phil Powell" <[EMAIL PROTECTED]> wrote:

> 
> This ought to do the job:
> 
> http://www.djangoproject.com/documentation/legacy_databases/

Definately - it does a decent job building a starting Model, but
you will definately have to go through it and make sure everything
is to your liking.  For one, I'm not sure if it sets up Foreign
Keys if you are not using an engine like InnoDB.

Josh

> -Phil
> 
> On 19/06/06, Mike Crowe <[EMAIL PROTECTED]> wrote:
> >
> > Hi folks,
> >
> > I'm just starting looking at a django backend for a system we
> > need to redo.  The existing db is MSSQL (yes, I know it's not
> > quite supported yet).  We need a system which supports most of
> > the adodb classes.  We will start with supported DB's, and
> > hopefully the additional ones will be ready when we are.
> >
> > However, here's my question:  The existing DB is very well laid
> > out. Is there a way to convert that DB Schema into django
> > models?  Doesn't have to be purely automatic, but any tool
> > which would help this migration would be appreciated.
> >
> > TIA
> > Mike
> >
> >
> > >
> >
> 
> > 

--~--~-~--~~~---~--~~
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: Enforcing relationships in the Admin

2006-06-19 Thread [EMAIL PROTECTED]

Malcolm Tredinnick wrote:
> You're not really providing enough information that I can make concrete
> suggestions here. How would the "focus" of the more restricted selection
> set be determined? The standard options are...
>
> (1) If it's something you can work out from other, previously filled in
> fields on the page, then you could use the 'js' option in the Admin
> class to add some custom Javascript. See [1] for some useful posts about
> this possibility.
>
> (2) If you want something more interactive and customised, such as
> clicking on a map or specifying the general area prior to entering any
> details, then you can write your own form for input. The admin interface
> provides a reasonably generic input form that works for many cases up to
> a point. But once you want custom input, particularly for slightly
> unwieldy data constructs or sizes, it often pays to just knock up a
> quick custom input form and do it yourself.
>
>
> [1] http://groups.google.com/group/django-users/search?q=Admin+js
> +option=0=d&
>
> Hope this provides you with some food for thought.

Hi Malcolm,
  I was trying to achieve option one for this project.  Essentially, I
would like to provide the user with the ability to assign a specific
location for each job by selecting a Country, State, & City.  In my
original model I was trying to manipulate the dynamically generated
Admin interface with my model so that it would allow me to filter the
options presented to the user based on the relationships in the model.
After implementing your initial suggestions I was able to create a
situation where the user could easily select a City that had a Country
and State based on there relationships in the model.  The down side of
this approach is that when I add all of the possible locations, the
user would have a list with thousands of options.  This wouldn't be
very user friendly, so I need to be able to narrow down the
possibilities as follows:

  Country: (A drop down list of countries)
 - United States
 - Canada
 - Etc.

  State: (A drop down list of states based on the previous country
selection)
 + United Sates
- Would provide: Wyoming, Colorado, Kansas, Etc.

 + Canada
- Would provide: Alberta, British Columbia, Manitoba,
Etc.

  City: (A drop down list of cities based on the previous Country and
State selections)
 + Wyoming
   - Would provide: Cheyenne, Laramie, Casper, Etc.

 + Colorado
- Would provide: Denver, Ft. Collins, Greeley, Etc.

  + Kansas
- Would provide: Lawrence, Kansas City, Salina, Etc.

  + Alberta
- Would provide: Beaumont, Bonnyville, Provost, Etc.

  + And so on...


  At this point the 'js' option in the Admin is the obvious choice for
this problem.  Here is what I currently have in mind:
- Revert my job model so that it has a column for Country, State, &
City.
- Utilized the 'js' option in the Admin with the appropriate 'js'
script to provide the functionality in my example above.

Many Thanks!
--Nick


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



custom form view not keeping information

2006-06-19 Thread hotani

My form text fields are auto-filling as they should, but drop-downs are
not. If I use a generic view they work fine - but when I do that I
can't control the fields hidden from the user.

I'm trying to do this with a custom view and manipulators but have had
nothing but trouble. Why is it so difficult to just edit a couple of
fields from a larger table? That is all I want to do.

Also, when I get bounced back to the form because of validation errors
my login info is trashed - the form no longer shows that I am logged
in. What am I missing here?

I never thought building a simple form would take several days.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Form from multiple models

2006-06-19 Thread James Mulholland

I'm trying to create an automated booking system for educational
events. Admin user creates workshops in the admin interface, then
creates a number of related accommodation options. Website visitor
signs up for workshops (ie, potentially more than one workshop) and can
also sign up for accommodation.

Given a models.py which looks like this (trimmed slightly for
conciseness):

class Workshop(models.Model):
code  = models.CharField(maxlength=30)
title = models.CharField(maxlength=60)
description   = models.TextField()
price = models.FloatField(max_digits=8,decimal_places=2)
date_start= models.DateTimeField()
date_end  = models.DateTimeField()
visible   = models.BooleanField()
contact   = models.ManyToManyField(Employee)

class Accommodation(models.Model):
name  = models.CharField(maxlength=40)
description   = models.CharField(maxlength=40)
date_start= models.DateTimeField()
date_end  = models.DateTimeField()
visible   = models.BooleanField()
price = models.FloatField(max_digits=8,decimal_places=2)
workshop  = models.ForeignKey(Workshop)

class Attendee(models.Model):
title = models.CharField(maxlength=20)
firstname = models.CharField(maxlength=30)
surname   = models.CharField(maxlength=30)
job_title = models.CharField(maxlength=60,blank=True)
organisation  = models.CharField(maxlength=60,blank=True)
address   = models.TextField()
postcode  = models.CharField(maxlength=16)
country   = models.ForeignKey(Country)
telephone = models.CharField(maxlength=30)
email = models.EmailField()

class Workshop_Booking(models.Model):
attendee  = models.ForeignKey(Attendee)
workshop  = models.ManyToManyField(Workshop,
filter_interface=True)
accommodation = models.ManyToManyField(Accommodation,
filter_interface=True)
date_booked   = models.DateTimeField()

Is there a (relatively) quick and easy way to create a form which would
allow a web user (not the admin user) to enter their details and select
workshops and accommodation options, preferably all on one screen? The
form might look like this:

Title:  ..
Firstname: ...
Lastname: ...
etc.

x Workshop event 1
o Hotel
o Campsite
o Hostel

x Workshop 2
o Hotel
o Campsite
o Hostel

My thinking so far is to add a manipulator for the "Attendee" model,
then create the details of the events myself, and check selections for
correctness using a custom validator, or checking the POST variables
"by hand". Is there a better way?

TIA.

--
James M


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Great Link for Perfect Career

2006-06-19 Thread Smith



Hello
Now, I am sharing with you 
another website that is excellent  for IT Jobs.
Currently, this website has 
6000 IT Jobs.
Please check this link and enjoy 
your dream job.
 
www.it-jse.com
 
Special thing about this website 
is, they are presenting direct links to jobs. 
They are using only Direct 
Employers and not using Staffing Companies, Contract firms, Agencies, 
recruiters.
regardsBruce 
Smith 
--~--~-~--~~~---~--~~
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: serving excel files

2006-06-19 Thread [EMAIL PROTECTED]


[EMAIL PROTECTED] escreveu:
> > >  def ficheiroExcel(request):
> > >   from pyExcelerator import *
> > >
> > >   response = HttpResponse(mimetype='application/vnd.ms-excel')
> > >   response['Content-Disposition'] = 'attachment;
> > > filename=somefilename.xls'
> > >
> > >   w = Workbook(HttpResponse) <-- this gives me an
> > > error
> >
> > You haven't really given us a lot to work with here. I did a Google
> > search for pyExcelerator and tracked down it's sourceforge page, but
> > could not find any online documentation. And you haven't said what the
> > error is (although that wouldn't help me in this case, since I don't
> > know anything about pyExcelerator, it might help somebody who was
> > familiar with the package help you).
> The project resides at http://sourceforge.net/projects/pyexcelerator
> When downloaded, there are some scripts at the examples directory that
> help.
> But I won't mind to use another excel files generator from python if an
> example is provided, since I haven't started to prepare file with
> pyExcelerator.
>
> When used as standalone, w = Workbook()  creates an instance of the
> class Workbook.
>
> Then a sheet with a formula can be added:
> ws = w.add_sheet('inicio')
> ws.write(0, 0, Formula("-(1+1)"))
>
> The file would be saved like this:
> w.save("some_file_name")
>
> >
> > Still, a few thoughts: What is pyExcelerator.Workbook() expecting to be
> > passed as a parameter? HttpResponse is a reasonably specialised Django
> > class, so I would not be too surprised it doesn't act as a proxy for
> > whatever is expected by Workbook(). Also, you are passing in the class
> > itself (HttpResponse), rather than an instance of the class (response).
> > I'm not sure that is going to do what you want.
> >
> > Malcolm
>
> That was only one of the attempts made to solve my problem, with no
> success.
>
> If you or somebody could present me an example using pyExcelerator,
> pyXLWriter or other I'd be apreciated.
>

I solved this with pyXLWriter.

Thank you.

Luis P. Mendes


--~--~-~--~~~---~--~~
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: serving excel files

2006-06-19 Thread [EMAIL PROTECTED]


[EMAIL PROTECTED] escreveu:
> > >  def ficheiroExcel(request):
> > >   from pyExcelerator import *
> > >
> > >   response = HttpResponse(mimetype='application/vnd.ms-excel')
> > >   response['Content-Disposition'] = 'attachment;
> > > filename=somefilename.xls'
> > >
> > >   w = Workbook(HttpResponse) <-- this gives me an
> > > error
> >
> > You haven't really given us a lot to work with here. I did a Google
> > search for pyExcelerator and tracked down it's sourceforge page, but
> > could not find any online documentation. And you haven't said what the
> > error is (although that wouldn't help me in this case, since I don't
> > know anything about pyExcelerator, it might help somebody who was
> > familiar with the package help you).
> The project resides at http://sourceforge.net/projects/pyexcelerator
> When downloaded, there are some scripts at the examples directory that
> help.
> But I won't mind to use another excel files generator from python if an
> example is provided, since I haven't started to prepare file with
> pyExcelerator.
>
> When used as standalone, w = Workbook()  creates an instance of the
> class Workbook.
>
> Then a sheet with a formula can be added:
> ws = w.add_sheet('inicio')
> ws.write(0, 0, Formula("-(1+1)"))
>
> The file would be saved like this:
> w.save("some_file_name")
>
> >
> > Still, a few thoughts: What is pyExcelerator.Workbook() expecting to be
> > passed as a parameter? HttpResponse is a reasonably specialised Django
> > class, so I would not be too surprised it doesn't act as a proxy for
> > whatever is expected by Workbook(). Also, you are passing in the class
> > itself (HttpResponse), rather than an instance of the class (response).
> > I'm not sure that is going to do what you want.
> >
> > Malcolm
>
> That was only one of the attempts made to solve my problem, with no
> success.
>
> If you or somebody could present me an example using pyExcelerator,
> pyXLWriter or other I'd be apreciated.
>

I solved this with pyXLWriter.

Thank you.

Luis P. Mendes


--~--~-~--~~~---~--~~
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: serving excel files

2006-06-19 Thread [EMAIL PROTECTED]


[EMAIL PROTECTED] escreveu:
> > >  def ficheiroExcel(request):
> > >   from pyExcelerator import *
> > >
> > >   response = HttpResponse(mimetype='application/vnd.ms-excel')
> > >   response['Content-Disposition'] = 'attachment;
> > > filename=somefilename.xls'
> > >
> > >   w = Workbook(HttpResponse) <-- this gives me an
> > > error
> >
> > You haven't really given us a lot to work with here. I did a Google
> > search for pyExcelerator and tracked down it's sourceforge page, but
> > could not find any online documentation. And you haven't said what the
> > error is (although that wouldn't help me in this case, since I don't
> > know anything about pyExcelerator, it might help somebody who was
> > familiar with the package help you).
> The project resides at http://sourceforge.net/projects/pyexcelerator
> When downloaded, there are some scripts at the examples directory that
> help.
> But I won't mind to use another excel files generator from python if an
> example is provided, since I haven't started to prepare file with
> pyExcelerator.
>
> When used as standalone, w = Workbook()  creates an instance of the
> class Workbook.
>
> Then a sheet with a formula can be added:
> ws = w.add_sheet('inicio')
> ws.write(0, 0, Formula("-(1+1)"))
>
> The file would be saved like this:
> w.save("some_file_name")
>
> >
> > Still, a few thoughts: What is pyExcelerator.Workbook() expecting to be
> > passed as a parameter? HttpResponse is a reasonably specialised Django
> > class, so I would not be too surprised it doesn't act as a proxy for
> > whatever is expected by Workbook(). Also, you are passing in the class
> > itself (HttpResponse), rather than an instance of the class (response).
> > I'm not sure that is going to do what you want.
> >
> > Malcolm
>
> That was only one of the attempts made to solve my problem, with no
> success.
>
> If you or somebody could present me an example using pyExcelerator,
> pyXLWriter or other I'd be apreciated.
>

I solved this with pyXLWriter.

Thank you.

Luis P. Mendes


--~--~-~--~~~---~--~~
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: serving excel files

2006-06-19 Thread [EMAIL PROTECTED]


[EMAIL PROTECTED] escreveu:
> > >  def ficheiroExcel(request):
> > >   from pyExcelerator import *
> > >
> > >   response = HttpResponse(mimetype='application/vnd.ms-excel')
> > >   response['Content-Disposition'] = 'attachment;
> > > filename=somefilename.xls'
> > >
> > >   w = Workbook(HttpResponse) <-- this gives me an
> > > error
> >
> > You haven't really given us a lot to work with here. I did a Google
> > search for pyExcelerator and tracked down it's sourceforge page, but
> > could not find any online documentation. And you haven't said what the
> > error is (although that wouldn't help me in this case, since I don't
> > know anything about pyExcelerator, it might help somebody who was
> > familiar with the package help you).
> The project resides at http://sourceforge.net/projects/pyexcelerator
> When downloaded, there are some scripts at the examples directory that
> help.
> But I won't mind to use another excel files generator from python if an
> example is provided, since I haven't started to prepare file with
> pyExcelerator.
>
> When used as standalone, w = Workbook()  creates an instance of the
> class Workbook.
>
> Then a sheet with a formula can be added:
> ws = w.add_sheet('inicio')
> ws.write(0, 0, Formula("-(1+1)"))
>
> The file would be saved like this:
> w.save("some_file_name")
>
> >
> > Still, a few thoughts: What is pyExcelerator.Workbook() expecting to be
> > passed as a parameter? HttpResponse is a reasonably specialised Django
> > class, so I would not be too surprised it doesn't act as a proxy for
> > whatever is expected by Workbook(). Also, you are passing in the class
> > itself (HttpResponse), rather than an instance of the class (response).
> > I'm not sure that is going to do what you want.
> >
> > Malcolm
>
> That was only one of the attempts made to solve my problem, with no
> success.
>
> If you or somebody could present me an example using pyExcelerator,
> pyXLWriter or other I'd be apreciated.
>

I solved this with pyXLWriter.

Thank you.

Luis P. Mendes


--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread [EMAIL PROTECTED]

djx,
  You can keep up with the Row Level/Object permissions by following
the developer mailing list for example
(http://groups.google.com/group/django-developers/browse_thread/thread/53acb7ed7783f313/36df83efcdbef1e5#36df83efcdbef1e5),
and reading the projet wiki entry here
(http://code.djangoproject.com/wiki/RowLevelPermissions).

--Nick


--~--~-~--~~~---~--~~
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: Existing database into django models?

2006-06-19 Thread Michael Radziej

Malcolm Tredinnick wrote:
> On Mon, 2006-06-19 at 13:04 +, Mike Crowe wrote:
> There is some support for this. See here:
> http://www.djangoproject.com/documentation/django_admin/#inspectdb

Hey, and let me add that you might want to check ticket 1561. Malcolm told me 
that in the meantime forward references should work, but there's more in the 
patch to get a working model faster. And you'll need the patch only for 
manage.py inspectdb, and then you can continue with a "stock django".

Have fun!

Michael



--~--~-~--~~~---~--~~
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: Existing database into django models?

2006-06-19 Thread Phil Powell

This ought to do the job:

http://www.djangoproject.com/documentation/legacy_databases/

-Phil

On 19/06/06, Mike Crowe <[EMAIL PROTECTED]> wrote:
>
> Hi folks,
>
> I'm just starting looking at a django backend for a system we need to
> redo.  The existing db is MSSQL (yes, I know it's not quite supported
> yet).  We need a system which supports most of the adodb classes.  We
> will start with supported DB's, and hopefully the additional ones will
> be ready when we are.
>
> However, here's my question:  The existing DB is very well laid out.
> Is there a way to convert that DB Schema into django models?  Doesn't
> have to be purely automatic, but any tool which would help this
> migration would be appreciated.
>
> TIA
> Mike
>
>
> >
>

--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread djx


James Bennett wrote:
> On 6/19/06, kevin evans <[EMAIL PROTECTED]> wrote:
> > I guess I was looking for a way to still use the great built-in admin.i.e.
> > be able to assign users to sites within the django generated admin.
>
> Right now that's not really possible because the permissions system
> used in the admin assigns permission at the level of an entire model
> rather than an individual object; it's possible to say "Bob can edit
> weblog entries", but not "Bob can only edit this set of weblog
> entries". There's a project underway to add per-object permissions,
> though.
>
>
> --
> "May the forces of evil become confused on the way to your house."
>   -- George Carlin

Hi, per-object permission is what i'm after as well.  Does anyone know
where i could follow news about that?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Existing database into django models?

2006-06-19 Thread Mike Crowe

Hi folks,

I'm just starting looking at a django backend for a system we need to
redo.  The existing db is MSSQL (yes, I know it's not quite supported
yet).  We need a system which supports most of the adodb classes.  We
will start with supported DB's, and hopefully the additional ones will
be ready when we are.

However, here's my question:  The existing DB is very well laid out.
Is there a way to convert that DB Schema into django models?  Doesn't
have to be purely automatic, but any tool which would help this
migration would be appreciated.

TIA
Mike


--~--~-~--~~~---~--~~
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: Triple Store / RDF

2006-06-19 Thread Malcolm Tredinnick

On Mon, 2006-06-19 at 12:35 +0100, Phil Powell wrote:
> Hi all,
> 
> Just out of pure curiosity: has anyone had any experience / know of
> any work around using RDF / triple stores with Django?

This was the "toy project" I used to get familiar with Django in about
October last year (aah.. the memories). I made up a model and some
auxilliary methods based around [1] and a simple web page so that I
could run queries. It was a "learning Django" exercise, rather than
aimed at doing anything useful, so I didn't take it very far or try to
optimise it much. Might be fun to revisit with the latest Django changes
(the original code would not run any more), because some of the more
RDF-like interfaces could be put into the model managers and the like,
making it a bit more seamless.

[1] http://www.picdiary.com/triplequerying/

There wasn't really anything specially hard about this. The model was as
simple as it gets and trying out possibilities for the API was the
interesting part.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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: serving excel files

2006-06-19 Thread [EMAIL PROTECTED]

> >  def ficheiroExcel(request):
> >   from pyExcelerator import *
> >
> >   response = HttpResponse(mimetype='application/vnd.ms-excel')
> >   response['Content-Disposition'] = 'attachment;
> > filename=somefilename.xls'
> >
> >   w = Workbook(HttpResponse) <-- this gives me an
> > error
>
> You haven't really given us a lot to work with here. I did a Google
> search for pyExcelerator and tracked down it's sourceforge page, but
> could not find any online documentation. And you haven't said what the
> error is (although that wouldn't help me in this case, since I don't
> know anything about pyExcelerator, it might help somebody who was
> familiar with the package help you).
The project resides at http://sourceforge.net/projects/pyexcelerator
When downloaded, there are some scripts at the examples directory that
help.
But I won't mind to use another excel files generator from python if an
example is provided, since I haven't started to prepare file with
pyExcelerator.

When used as standalone, w = Workbook()  creates an instance of the
class Workbook.

Then a sheet with a formula can be added:
ws = w.add_sheet('inicio')
ws.write(0, 0, Formula("-(1+1)"))

The file would be saved like this:
w.save("some_file_name")

>
> Still, a few thoughts: What is pyExcelerator.Workbook() expecting to be
> passed as a parameter? HttpResponse is a reasonably specialised Django
> class, so I would not be too surprised it doesn't act as a proxy for
> whatever is expected by Workbook(). Also, you are passing in the class
> itself (HttpResponse), rather than an instance of the class (response).
> I'm not sure that is going to do what you want.
>
> Malcolm

That was only one of the attempts made to solve my problem, with no
success.

If you or somebody could present me an example using pyExcelerator,
pyXLWriter or other I'd be apreciated.

Thanks, 

Luis P. Mendes


--~--~-~--~~~---~--~~
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: serving excel files

2006-06-19 Thread Malcolm Tredinnick

Hi Luis,

On Mon, 2006-06-19 at 04:09 -0700, [EMAIL PROTECTED] wrote:
> Hi,
> 
> I've read the csv and pdf howto at the documentation section and tried
> to adapt it to excel files.
> 
> I'm trying to use pyExcelerator to build the Excel files.
> 
>  def ficheiroExcel(request):
>   from pyExcelerator import *
> 
>   response = HttpResponse(mimetype='application/vnd.ms-excel')
>   response['Content-Disposition'] = 'attachment;
> filename=somefilename.xls'
> 
>   w = Workbook(HttpResponse) <-- this gives me an
> error

You haven't really given us a lot to work with here. I did a Google
search for pyExcelerator and tracked down it's sourceforge page, but
could not find any online documentation. And you haven't said what the
error is (although that wouldn't help me in this case, since I don't
know anything about pyExcelerator, it might help somebody who was
familiar with the package help you).

Still, a few thoughts: What is pyExcelerator.Workbook() expecting to be
passed as a parameter? HttpResponse is a reasonably specialised Django
class, so I would not be too surprised it doesn't act as a proxy for
whatever is expected by Workbook(). Also, you are passing in the class
itself (HttpResponse), rather than an instance of the class (response).
I'm not sure that is going to do what you want.

Malcolm



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Triple Store / RDF

2006-06-19 Thread Phil Powell

Hi all,

Just out of pure curiosity: has anyone had any experience / know of
any work around using RDF / triple stores with Django?

-Phil

--~--~-~--~~~---~--~~
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: Checking a birthday using datetime

2006-06-19 Thread [EMAIL PROTECTED]

Yup, that works a treat Thanks James!!!


--~--~-~--~~~---~--~~
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: Checking a birthday using datetime

2006-06-19 Thread James Bennett

On 6/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> However, this only works if the Member was actually born on this exact
> date (including year)... how can I filter so that it ignores the year
> and just looks at the day and month part of their birth_date??

d = datetime.date.today()
members_born_today = Member.objects.filter(birth_date__month=d.month,
birth_date__day=d.day)

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread James Bennett

On 6/19/06, kevin evans <[EMAIL PROTECTED]> wrote:
> I guess I was looking for a way to still use the great built-in admin.i.e.
> be able to assign users to sites within the django generated admin.

Right now that's not really possible because the permissions system
used in the admin assigns permission at the level of an entire model
rather than an individual object; it's possible to say "Bob can edit
weblog entries", but not "Bob can only edit this set of weblog
entries". There's a project underway to add per-object permissions,
though.


-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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 and Oracle

2006-06-19 Thread [EMAIL PROTECTED]

Hi,

I have seen some moves in the integration of Oracle with Django.
However, I am quite lost between Trac tickets, svn (which I
cannnot access behind my corp firewall), and the latest
changes in Django.

Is it planned to support Oracle? Are there any works done in
that direction?

Lack of Oracle support is the last step preventing me from
using Django at work.

Thanks and regards.

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




--~--~-~--~~~---~--~~
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: Recursive delete problem

2006-06-19 Thread Viktor

spacedman wrote:
  >  So I'd say you weren't doing something terribly wrong, but it might
> not be a bug either. If this behaviour is desirable (and I cant see why
> it isn't) then it needs a bit of rewriting...

Reading the documentation and this mailing list, I came to a silly idea 
that django's ORM is not about tables, columns and rows :)... It's about 
objects... So, when I delete an object from my "persistent memory" (db 
or whatever), and that object has a "destructor", I'm sure that it's 
desirable to call that "destructor"... Or I'm missing something... :)

--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread Guillermo Fernandez Castellanos

hi,

There's this info that I saw once on the list:
http://lukeplant.me.uk/blog.php?id=1107301634

I have to admit I (very) quickly tried it and could not make it
work... I'll have to spend more time over it.

If you manage to do it, please tell me.

Enjoy,

G

On 6/19/06, kevin evans <[EMAIL PROTECTED]> wrote:
> Thanks James,
>
> I guess I was looking for a way to still use the great built-in admin.i.e.
> be able to assign users to sites within the django generated admin.
>
>
> On 19/06/06, James Bennett <[EMAIL PROTECTED]> wrote:
> >
> > On 6/19/06, kevin evans <[EMAIL PROTECTED]> wrote:
> > > How would one create users that could only post to a particular
> blog/site?
> >
> > By writing views that check whether the user who's trying to post is
> > in the list of allowed users for the blog/site they're trying to post
> > to.
> >
> > --
> > "May the forces of evil become confused on the way to your house."
> >   -- George Carlin
> >
> >
>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



serving excel files

2006-06-19 Thread [EMAIL PROTECTED]

Hi,

I've read the csv and pdf howto at the documentation section and tried
to adapt it to excel files.

I'm trying to use pyExcelerator to build the Excel files.

 def ficheiroExcel(request):
  from pyExcelerator import *

  response = HttpResponse(mimetype='application/vnd.ms-excel')
  response['Content-Disposition'] = 'attachment;
filename=somefilename.xls'

  w = Workbook(HttpResponse) <-- this gives me an
error
  ws = w.add_sheet('inicio')
  ws.write(0, 0, Formula("-(1+1)"))

  #w.save(response)
  return response

How can I do it?

Luis P. Mendes


--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread kevin evans
Thanks James,I guess I was looking for a way to still use the great built-in admin.i.e. be able to assign users to sites within the django generated admin.On 19/06/06, 
James Bennett <[EMAIL PROTECTED]> wrote:
On 6/19/06, kevin evans <[EMAIL PROTECTED]> wrote:> How would one create users that could only post to a particular blog/site?By writing views that check whether the user who's trying to post is
in the list of allowed users for the blog/site they're trying to postto.--"May the forces of evil become confused on the way to your house."  -- George Carlin

--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread James Bennett

On 6/19/06, kevin evans <[EMAIL PROTECTED]> wrote:
> How would one create users that could only post to a particular blog/site?

By writing views that check whether the user who's trying to post is
in the list of allowed users for the blog/site they're trying to post
to.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



No Such Column error -- Solution

2006-06-19 Thread Guillermo Fernandez Castellanos

Just for the records:

I found the solution of my problem (posted in "No such column error +
tag question", where you can find the full problem and the code).

There seems to be a bug in django I did not find when I first googled for it:

The thing is, the admin interface seems to have some problems with the
OneToOne relations (bug #1245) but more generaly with the ORDER BY
query (bug #1547).

The solution is simply to eliminate any 'ordering' parameter. A bit
anoying, but better than nothing :-)

Enjoy,

G

--~--~-~--~~~---~--~~
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: Having many of one application.

2006-06-19 Thread kevin evans
How would one create users that could only post to a particular blog/site?On 19/06/06, limodou <[EMAIL PROTECTED]
> wrote:On 6/19/06, Frankie Robertson <
[EMAIL PROTECTED]> wrote:>> The following is used mainly as an example for something I've been> wondering about.>> Say I'm a blog host and want to use django. I need all my views to
> know which blog (so as to know what information to get) they're using.> I also need all my templates to have access to the blog object (so> they can display the name and use the stylesheet of the current blog).
> How, while remaining DRY, that is not having each view take the blog> slug and then pass the blog object to the template, can I do this? I> think the sites framework might do something simelar.>
> Thanks,> Frankie.>I think the right way is setting use_id in url, just like:/user_id(or user_name)/blog_idthat's ok.--I like python!My Blog: 
http://www.donews.net/limodouMy Django Site: http://www.djangocn.orgNewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~-~--~~~---~--~~
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: Recursive delete problem

2006-06-19 Thread spacedman


Viktor wrote:

> But when I delete a round, with round.delete(), all games conected with
> that round are also deleted, but the Score table isn't updated, that is,
> the delete method from the game objects is not called?!?!

Looking at the code I see that when an objects is .delete()d all the
related objects are gathered up and then it calls delete_objects:

[django/db/models/base.py]
# Actually delete the objects
delete_objects(seen_objs)

 which does the actual deletion from the DB. Hence the .delete() method
wont be called for related objects.

 So I'd say you weren't doing something terribly wrong, but it might
not be a bug either. If this behaviour is desirable (and I cant see why
it isn't) then it needs a bit of rewriting...

Barry


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---