Re: date time errors: please explain?

2006-03-05 Thread gizo

With all due respect, this doesn't attend to my question.
Why can I use MySQLdb from python to run a date_add query, but not run
the same query from Django?
I don't see the point in using a workaround for a query that I should
be able to call through MySQL


--~--~-~--~~~---~--~~
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: date time errors: please explain?

2006-03-01 Thread gizo

Correct me if I am wrong, but timedelta doesn't allow for months, does
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
-~--~~~~--~~--~--~---



date time errors: please explain?

2006-02-28 Thread gizo

Hoody.

Can anyone tell me why I can use this code with MySQLdb in python, but
not in Django?

  cursor=db.cursor()
  cursor.execute("select date_add('2006-2-24',INTERVAL 1 Month) as
newDate")

django error is: ValueError, unpack list of wrong size

I am completely stumped.

Alternately, is there a way within Django to do this?

ie. a way to change a datefield by a user-defined number of years,
months, or days?
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: how to implement RequiredIfOtherFieldEquals validation?

2006-02-22 Thread gizo

okay. Sorry to waste your time.

Firstly: I had a bad day yesterday, my head was very hurt.

Secondly: choices_list=(('by Month','Month'),('by Day','Day')) - no
wonder it didn't work!!

I apologise to anyone who has bothered to read this, and even more to
anyone who might have stopped to think about it Sorry.


--~--~-~--~~~---~--~~
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: how to implement RequiredIfOtherFieldEquals validation?

2006-02-22 Thread gizo

ahhh!

The 'periodType' field I am testing against is currently set up as a
SelectField, which is being generated by the manipulator
(choices=choice_list). And that somehow doesn't work.

I changed it to a TextField, and entered 'Month', and it works
wonderfully. 

Yay, mostly


--~--~-~--~~~---~--~~
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 implement RequiredIfOtherFieldEquals validation?

2006-02-21 Thread gizo

Hiya.

I am completely lost. I want to use the standard AddManipulators
provided. They are cool.
But, I also want to make use of the RequiredIfOtherFieldEquals
validator from django.core.validators.py.

I have searched and searched, but I can't seem to find any reference to
how to implement it (or any of those validators..?)

i have tried adding it in the view like this:
manipulator.fields[3]=formfields.IntegerField(field_name="monthDay",validator_list=[
RequiredIfOtherFieldEquals("periodType","Month")]
and in the model like this:
monthDay = meta.IntegerField(null=True, blank=True,
validator_list=[RequiredIfOtherFieldEquals('periodType','Month')])

and I've tried prefixing with "validators."

Am I trying to do something which can't be done? And if not, how do I
access and use all those validators?

Lost in confusion, 
gizo.


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



manipulator validation across fields

2006-02-19 Thread gizo

I have a form with 3 separate fields. I need the user to input data
into one of the fields. No more than one, and no less than one.
Is there an easy way to tell my manipulator to check this?
Something like :
one_of_these_is_required_list=['field1','field2','field3']

does that kind of functionality exist?


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



can i extend manipulators?

2006-02-15 Thread gizo

Hiya. I have a largeish form, and I want to add customised choices and
validation for one field. I can only seem to find doc references to
creating a whole new manipulator, and I'd rather not have to re-define
every field in the form.
Is there a way I can extend the standard manipulators to do so?
(And have I missed something quite obvious?)
Please be gentle 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: more model basics - mny to many's

2006-02-14 Thread gizo

ah, looks clever, i like that.
I'll check it when i get into work.
thanks...



Re: more model basics - mny to many's

2006-02-14 Thread gizo

wont that just give me:
Each Song can have many Instruemtns
Each Song can have many Musicians?

what I want is:
Each Song can have Many Player/Instrument combinations (where each
musician could play any instrument, in theory)



more model basics - mny to many's

2006-02-13 Thread gizo

Hiya.
I am not a web developer, okay, just trying to do a band website (so
take it easy on me, please ;)
I am having trouble with my models.

I have the following:

class musician(meta.Model):
  ...
class instrument(meta.Model):
  ...
class song(meta.Model):
  ..
class songInstrument(meta.Model):
  song = meta.ForeignKey(song, edit_inline=meta.TABULAR, core=True)
  instrument = meta.ForeignKey(instrument)
  musician = meta.ForeignKey(musician)
  def __repr__(self):
return "%s, %s, %s" % (self.get_song(), self.get_musician(),
self.get_instrument())
  class META:
admin = meta.Admin()

So each song has many musicians playing many instruments (ie. Jerry
might have played drums and bass and read Chaucer in a particular
song). This is great, and when I add a song in the admin section, I can
add all this detail, but when I look at songInstrument in admin, there
are no entries??

Can anyone tell me:
a) where have I gone wrong?
b) is there an easier way to set up these (and similar) models?

thanks, 
and keep up to good work, django ist fun



Re: Making Django Development server available to local network.

2006-02-09 Thread gizo


Jan Rademaker wrote:
> Panos Laganakos wrote:
> > I am using a local server for all web development stuff. So I set up
> > django on it and started the tutorial.
> You could try 'manage runserver 0:8000' so it won't bind to a specific
> interface/ip address.

Panos, I was about to ask the same question, Jan, your solution worked
perfectly for me.

Thanks...