ManyToManyFields - a double operation to the database?

2010-04-04 Thread Robert
I wonder whether you have to save a record to the database BEFORE you
can update a ManyToMany field?

I came across a post by Karen Tracey that seems to suggest this.

The problem is that I am unable to do so because the ManyToManyField
in my model has no default value and this triggers an error when I try
to save without adding a value to it. And when I try to add a value
django says that the "instance needs a primary key value before a many-
to-many relationship can be used." Thus, it's kind of a trap, isn't
it?

I am working on an app with similar models to the document "Making
queries" at
http://docs.djangoproject.com/en/1.0/topics/db/queries

only that I change the authors-field with a users field pointing to
the auth.model User.

class Entry(models.Model):
[..]
users = models.ManyToManyField(User)

(KT's post below)

Please advise.

Robert



[The] way to update a ManyToMany field is to call the add() method on
the
many-to-many field, not to assign anything to it.  So I'd think what
you
need to do is:

 if f.is_valid():
   newgroup = f.save(commit=False)
   newgroup.group_owner = request.user
   newgroup.save()
   newgroup.group_members.add(request.user)
   newgroup.group_admins.add(request.user)
   return HttpResponseRedirect("/group/list/")


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



Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Daniel Roseman
On Apr 4, 11:56 am, Robert  wrote:
> I wonder whether you have to save a record to the database BEFORE you
> can update a ManyToMany field?
>
> I came across a post by Karen Tracey that seems to suggest this.
>
> The problem is that I am unable to do so because the ManyToManyField
> in my model has no default value and this triggers an error when I try
> to save without adding a value to it. And when I try to add a value
> django says that the "instance needs a primary key value before a many-
> to-many relationship can be used." Thus, it's kind of a trap, isn't
> it?
>
> I am working on an app with similar models to the document "Making
> queries" athttp://docs.djangoproject.com/en/1.0/topics/db/queries
>
> only that I change the authors-field with a users field pointing to
> the auth.model User.
>
> class Entry(models.Model):
>     [..]
>     users = models.ManyToManyField(User)

No, there isn't usually a trap here. What error do you get when you
try to save without defining a ManyToMany?
--
DR.

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



Re: Model inheritance foreign key user

2010-04-04 Thread Daniel Roseman
On Apr 3, 10:37 pm, Fredrik  wrote:
> What I want is to "automatic" add an owner to every object..
>
> Is there another way to accomplish the same?
>
> Fredrik
>

Do you need the PersistentModel field to exist in a separate table? It
sounds to me as if that would be better off as an abstract model.
--
DR.

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



Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Robert
Hi,

I get OperationalError: (1364, "Field, 'user_id' doesn't have a
default value")

As I understand, the many-to-many relationship shall be taken care of
by a join table.No such table shows up when I run mysql show tables;.
I have of course run a syncdb command. All other tables are present.

Thanks DR

Robert

On 4 apr, 14:10, Daniel Roseman  wrote:
> On Apr 4, 11:56 am, Robert  wrote:
>
>
>
>
>
> > I wonder whether you have to save a record to the database BEFORE you
> > can update a ManyToMany field?
>
> > I came across a post by Karen Tracey that seems to suggest this.
>
> > The problem is that I am unable to do so because the ManyToManyField
> > in my model has no default value and this triggers an error when I try
> > to save without adding a value to it. And when I try to add a value
> > django says that the "instance needs a primary key value before a many-
> > to-many relationship can be used." Thus, it's kind of a trap, isn't
> > it?
>
> > I am working on an app with similar models to the document "Making
> > queries" athttp://docs.djangoproject.com/en/1.0/topics/db/queries
>
> > only that I change the authors-field with a users field pointing to
> > the auth.model User.
>
> > class Entry(models.Model):
> >     [..]
> >     users = models.ManyToManyField(User)
>
> No, there isn't usually a trap here. What error do you get when you
> try to save without defining a ManyToMany?
> --
> DR.– Skjul sitert tekst –
>
> – Vis sitert tekst –

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



Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Daniel Roseman
On Apr 4, 1:44 pm, Robert  wrote:
> Hi,
>
> I get OperationalError: (1364, "Field, 'user_id' doesn't have a
> default value")
>
> As I understand, the many-to-many relationship shall be taken care of
> by a join table.No such table shows up when I run mysql show tables;.
> I have of course run a syncdb command. All other tables are present.
>
> Thanks DR
>
> Robert

Did you previously have a ForeignKey, but changed it to a ManyToMany?
If so, remember syncdb doesn't change existing tables. You'll need to
do the migration manually, or if you don't have any data worth keeping
you can just drop the tables and rerun syncdb to recreate them.
--
DR.

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



Re: ManyToManyFields - a double operation to the database?

2010-04-04 Thread Robert
That's a spot on, DR.

I'll try that and I'm sure it will work out.

Have an excellent day.

R

On 4 apr, 15:03, Daniel Roseman  wrote:
> On Apr 4, 1:44 pm, Robert  wrote:
>
> > Hi,
>
> > I get OperationalError: (1364, "Field, 'user_id' doesn't have a
> > default value")
>
> > As I understand, the many-to-many relationship shall be taken care of
> > by a join table.No such table shows up when I run mysql show tables;.
> > I have of course run a syncdb command. All other tables are present.
>
> > Thanks DR
>
> > Robert
>
> Did you previously have a ForeignKey, but changed it to a ManyToMany?
> If so, remember syncdb doesn't change existing tables. You'll need to
> do the migration manually, or if you don't have any data worth keeping
> you can just drop the tables and rerun syncdb to recreate them.
> --
> DR.

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



Re: Model inheritance foreign key user

2010-04-04 Thread Thierry Chich
You are right but it would not change his problem. If 2 or more  
classes inherit from a class with a foreignkey or a manytomany, there  
will be a conflict in the related name




Le 4 avr. 2010 à 14:11, Daniel Roseman  a  
écrit :



On Apr 3, 10:37 pm, Fredrik  wrote:

What I want is to "automatic" add an owner to every object..

Is there another way to accomplish the same?

Fredrik



Do you need the PersistentModel field to exist in a separate table? It
sounds to me as if that would be better off as an abstract model.
--
DR.

--
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en 
.




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



Re: Hosting for Django sites

2010-04-04 Thread Justin Myers
I'm a fan of Webfaction's shared plans, and I've used them for three
or four projects now. I've had no problems with their support, and
they even did a pretty good job keeping everyone informed when they
were affected by that big explosion at The Planet's datacenter a
couple of years ago (http://tech.slashdot.org/article.pl?
sid=08/06/01/1715247). That said, even though their servers are
physically in the US, my credit card bill shows that they're in the
UK--so I end up with the fun foreign transaction surcharge every time
Webfaction bills me.

I've also spent the last few months on a Rackspace Cloud server for a
project, and I've got no complaints. Setting it up and getting
everything configured were more involved, of course, but that's to be
expected (as Ray said).

As Shawn mentioned earlier, Webfaction's control panel makes it easy
to set up subdomains and media URLs (so much easier to me than mucking
around in httpd.conf and the like), and I like the backup features in
Rackspace's control panel. Overall, I'd say you can't go wrong with
either, honestly.

HTH,
Justin

On Apr 3, 5:35 pm, shofty  wrote:
> +1 for webfaction.
>
> this is a +1 from a proper noob. they were very helpful to me when i
> was struggling my way through my first django site, so if you're on a
> real steep learning curve, they will help you out.
>
> im not so sure for the 24/7 phone support, i raised an issue with them
> on twitter once and they sorted it there and then. plus im uk based so
> phone wouldn't really help.
>
> Matt
>
> On Apr 3, 9:47 pm, django_jedi  wrote:
>
> > Thanks guys.  Very helpful.  Confirming my research.  We've been using
> > Webfaction for a couple of sites to test drive them, and they come
> > through w/flying colors.
>
> > The only thing I'd like to see from them is 24/7 phone support (hey,
> > I'm not asking for much, am I? ;-)

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



decorators

2010-04-04 Thread CrabbyPete
I am using pyfacebook and when I run the debug server I get the
following:

C:\Python26\lib\site-packages\facebook\djangofb\__init__.py:185:
DeprecationWarning: Calling the deprecated function 'new_wrapper'
Downgrade to decorator 2.3 if you want to use this functionality
  return decorator.new_wrapper(updated, f)

Can someone please explain this to me.

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django-registration with django-profile

2010-04-04 Thread Alessandro Ronchi
2010/4/3 shacker :

> Cool!  Would be nice to put your solution up on djangosnippets.org or
> similar for the benefit of others.

It's nothing new. I've copied the default backend for
django-registration, changed the RegistrationForm and handled
correctly the form with a view.
It's simply a matter of choice what pieces are useful to achieve the
needed registration workflow.

I found that django-profile was unuseful, because it add another
registration step with a form you can include in registration.


-- 
Alessandro Ronchi

http://www.soasi.com
SOASI - Sviluppo Software e Sistemi Open Source

Hobby & Giochi, l'e-commerce del divertimento
http://hobbygiochi.com
http://www.facebook.com/pages/Forli/Hobby-Giochi/185311523755

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



Re: Geodjango tutorials?

2010-04-04 Thread Tyler Erickson
Another tutorial:
http://linfiniti.com/2009/11/geodjango-tutorial/

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



Re: Geodjango tutorials?

2010-04-04 Thread Nabil Servais

Le 3 avr. 2010 à 04:16, Benjamin Welton a écrit :

> Hey All,
> 
>   Im wondering if anyone has some good links to geodjango tutorials (outside 
> of the main one featured on geodjango.org)? Specifically any related to 
> Google Map integration (since that subsection appears to be missing in the 
> current doc's).
> 
> Thanks
> Ben
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

Hello, 

http://github.com/palewire/nicar2010/tree/master/geodjango_dunktank/


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



Re: Is any thing for python like .jar files for java.

2010-04-04 Thread George Cox
On 9 Feb 2010, at 20:05, chiranjeevi muttoju wrote:

> Is there any concept in python like .jar files in java. If anybody of you 
> know please reply me.

This is not a Django question and could have been answered by some judicious 
use of Google.  Have a look at

http://docs.python.org/library/zipimport.html


gjvc

-- 
George Cox





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



RSS feeds of model instances by tag

2010-04-04 Thread Nick
I have a question about RSS feeds for objects by tag.

I'm using this statement currently in a feed class items method, which
accepts a tag as an 'obj' parameter:

return Model.objects.filter(tags__icontains=obj.name).order_by('-
pub_date')[:10]

This statement works, but I get mixed results in my QuerySet based on
whether I filter by 'icontains' or 'exact'.

For example, filtering for the tag 'test' matches 'test', 'tag-
testing', and 'testing'. I only want objects tagged with 'test'. If I
use the 'exact' lookup, if the field contains more than one tag, it
won't find the tag at all.

I know there's a good generic view for this, tagged_object_list, but I
need a request object to use it, and my feed class doesn't accept or
create request objects that I know of.

How would I translate the following sql query into a chained QuerySet
statement:

select *
from model m
inner join taggeditem ti
on m.id = ti.object_id
inner join tag t
on ti.tag_id = t.id
where t.name = obj.name

Is there a better way to do this? The problem with the TagField() is
it can be multivalued.

Is there a way to split a tag field and then do a match on each item
in the list?

Any suggestions?

I'm scripting in Django 1.1, using postgreSQL, and Windows XP.

Thank you very much.

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is any thing for python like .jar files for java.

2010-04-04 Thread Ozgur Yılmaz
python egg's

E.Ozgur Yilmaz
Lead Technical Director
www.ozgurfx.com


On Sun, Apr 4, 2010 at 11:12 PM, George Cox  wrote:

> On 9 Feb 2010, at 20:05, chiranjeevi muttoju wrote:
>
> > Is there any concept in python like .jar files in java. If anybody of you
> know please reply me.
>
> This is not a Django question and could have been answered by some
> judicious use of Google.  Have a look at
>
>http://docs.python.org/library/zipimport.html
>
>
> gjvc
>
> --
> George Cox
> 
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-04 Thread Bill Freeman
Perchance are you somehow passing a list of list?  When the validator
strips off the outer list, it would get a list instead of a string, which
would match the error message (that's the only reason I suggest it).

Otherwise, pdb is your friend.  I particularly like running the dev server
under emacs, because when you hit a breakpoint, emacs pops up the
relevant file in another "window" (what emacs calls panels).  But then
I do everything in emacs, so your favorite tool may be just as good.

Bill

On Sat, Apr 3, 2010 at 11:30 AM, ben  wrote:
> Either I don't understand how CheckboxSelectMultiple works or there is
> a bug in Django 1.2. I have tried the following custom multi select
> fields I have found around the web.
>
> http://www.djangosnippets.org/snippets/1200/
> http://www.davidcramer.net/code/181/custom-fields-in-django.html
>
> Out of desperation I tried using a ManyToMany field and all produce
> the same validation error when used with either CheckboxSelectMultiple
> or SelectMultiple.
>
> 'Select a valid choice. [u'1', u'2', u'3', u'4'] is not one of the
> available choices.'
>
> This happens regardless of the number of choices, types of the choices
> tuple values, or the model field type.
>
> Can anyone point me to an example that demonstrates how to properly
> use these fields.
>
> Thanks,
> Ben
>
>
> On Apr 2, 5:19 pm, Bill Freeman  wrote:
>> I know that I used (some revision of) that snippet a while back.
>>
>> Realize that what it stores is a string, containing digits and commas.
>>
>> The to_python and get_db_prep_value methods are responsible for
>> converting between that database single string and a list of strings,
>> not integers.  You can use any string (that doesn't contain comma) to
>> represent a choice (db value).  I had two character ID flags (easier to
>> read in pgadmin).  It did work, but I forget the details (I eventually went
>> to multi to multi and the one end of many to one relationships).  So I
>> expect that the DB side of your choice tuples must be strings.
>>
>> Bill
>>
>>
>>
>> On Fri, Apr 2, 2010 at 3:37 PM, ben  wrote:
>> > Sorry. I pasted code that I was experimenting with. I thought maybe
>> > the validation code was looking for strings because that is what the
>> > error code said it was looking for. Before that I had been using
>> > integers and that doesn't seem to work either. I am wondering if this
>> > is a bug in Django 1.2. I hunted around on Django snippets as Bill
>> > Freeman suggested and found the following 
>> > codehttp://www.djangosnippets.org/snippets/1200/
>> > for a custom multiple selection field.
>>
>> > I inserted it into my app and it doesn't want to validate the
>> > selection either. In fact it returns a validation error message
>> > similar to what I received from CommaSeperatedIntegerField and
>> > CheckboxSelectMultiple. "Value [u'1'] is not a valid choice."
>>
>> > Not sure what is going on. Any insights would be appreciated.
>>
>> > On Apr 2, 3:06 pm, orokusaki  wrote:
>> >> The problem is that you're using '1' instead of 1. The comma
>> >> separated integer list is expecting integers not strings. The reason
>> >> you're seeing u'1' is because it's being turned from a string to a
>> >> unicode object.
>>
>> >> Try this instead:
>>
>> >> SOME_CHOICES =  ((1, 'ch1'),(2, 'ch2'), (3, 'ch3'),(4, 'ch4'))
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Django users" group.
>> > To post to this group, send email to django-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Hosting for Django sites

2010-04-04 Thread Nick Lacey
Matt wrote:

>  plus im uk based so  phone wouldn't really help.

Speaking of being UK based .. for the project all I'm working on,
*all* the users will be in the UK, so I'm not sure about performance
issues caused by servers in the US.

Do I need to worry about the host not being based in Europe? If so,
could anyone recommend a Europe based host?

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django + tagging + multilingual + postgresql: Programming error exception

2010-04-04 Thread pgsn
Hi. I'm getting the following error message when i try to navigate by
tags:

from tagging.views import tagged_object_list
info_dict = {
'queryset_or_model': Article.objects.filter(enabled=True),
'paginate_by': paginate_parm,
}

 url(r'^tag/(?P[^/]+)/$', tagged_object_list, info_dict,
name='tag-view'),

and this is what i get:

invalid reference to FROM-clause entry for table "articles_article"
LINE 1: ...N (("articles_article_translation_ru".master_id =
"articles_...
 ^
HINT:  There is an entry for table "articles_article", but it cannot
be referenced from this part of the query.

I tried using both release and recent svn versions of django, tagging
and multilingual libs.

I'm using postgresql-8.4 on Ubuntu.

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



Re: django + tagging + multilingual + postgresql: Programming error exception

2010-04-04 Thread pgsn
Wow, I just tried to run it on mysql instead of postgresql, and
everything worked fine.
Is this a postgresql bug? I really wouldn't like to switch to mysql.

On Apr 5, 5:59 am, pgsn  wrote:
> Hi. I'm getting the following error message when i try to navigate by
> tags:
>
> from tagging.views import tagged_object_list
> info_dict = {
>     'queryset_or_model': Article.objects.filter(enabled=True),
>     'paginate_by': paginate_parm,
>
> }
>
>  url(r'^tag/(?P[^/]+)/$', tagged_object_list, info_dict,
> name='tag-view'),
>
> and this is what i get:
>
> invalid reference to FROM-clause entry for table "articles_article"
> LINE 1: ...N (("articles_article_translation_ru".master_id =
> "articles_...
>                                                              ^
> HINT:  There is an entry for table "articles_article", but it cannot
> be referenced from this part of the query.
>
> I tried using both release and recent svn versions of django, tagging
> and multilingual libs.
>
> I'm using postgresql-8.4 on Ubuntu.

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



error about django and mssql

2010-04-04 Thread CCC
hi,now I use django-mssql and sqlserver2008,
but I found that it always appear some errors when I do some
command,for example:python manage.py syncdb
the error likes coding error is blow:
raise OperationalError(e, "Error opening connection: " +
connection_string)
ngo.db.backends.sqlserver_ado.dbapi.OperationalError:
(com_error(-2147352567,
xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft OLE DB
Provider for
L Server', u'[DBNETLIB][ConnectionOpen (Connect()).]SQL Server \u4e0d
\u5b58\u
8\u6216\u62d2\u7edd\u8bbf\u95ee\u3002', None, 0, -2147467259), None),
'Error
ning connection: PROVIDER=SQLOLEDB;DATA
SOURCE=115.238.106.100,60433;Network
rary=DBMSSOCN;Initial Catalog=rvdb_1;UID=sa;PWD=asd.1234')


anyone can help ?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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



error about django and mssql

2010-04-04 Thread CCC
hi,now I use django-mssql and sqlserver2008,
but I found that it always appear some errors when I do some
command,for example:python manage.py syncdb
the error likes coding error is blow:
raise OperationalError(e, "Error opening connection: " +
connection_string)
ngo.db.backends.sqlserver_ado.dbapi.OperationalError:
(com_error(-2147352567,
xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft OLE DB
Provider for
L Server', u'[DBNETLIB][ConnectionOpen (Connect()).]SQL Server \u4e0d
\u5b58\u
8\u6216\u62d2\u7edd\u8bbf\u95ee\u3002', None, 0, -2147467259), None),
'Error
ning connection: PROVIDER=SQLOLEDB;DATA
SOURCE=115.238.106.100,60433;Network
rary=DBMSSOCN;Initial Catalog=rvdb_1;UID=sa;PWD=asd.1234')


anyone can help ?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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



error about django and mssql

2010-04-04 Thread CCC
hi,now I use django-mssql and sqlserver2008,
but I found that it always appear some errors when I do some
command,for example:python manage.py syncdb
the error likes coding error is blow:
raise OperationalError(e, "Error opening connection: " +
connection_string)
ngo.db.backends.sqlserver_ado.dbapi.OperationalError:
(com_error(-2147352567,
xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft OLE DB
Provider for
L Server', u'[DBNETLIB][ConnectionOpen (Connect()).]SQL Server \u4e0d
\u5b58\u
8\u6216\u62d2\u7edd\u8bbf\u95ee\u3002', None, 0, -2147467259), None),
'Error
ning connection: PROVIDER=SQLOLEDB;DATA
SOURCE=115.238.106.100,60433;Network
rary=DBMSSOCN;Initial Catalog=rvdb_1;UID=sa;PWD=asd.1234')


anyone can help ?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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ORM: get, filter and DoesNotExist

2010-04-04 Thread zweb
after some debugging, just found out that
filter method does not throw DoesNotExist while get does.

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



Re: Hosting for Django sites

2010-04-04 Thread Michael
On Mon, Apr 5, 2010 at 12:33 PM, Nick Lacey  wrote:
> Matt wrote:
>
>>  plus im uk based so  phone wouldn't really help.
>
> Speaking of being UK based .. for the project all I'm working on,
> *all* the users will be in the UK, so I'm not sure about performance
> issues caused by servers in the US.
>
> Do I need to worry about the host not being based in Europe? If so,
> could anyone recommend a Europe based host?
>
> 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-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

http://djangodomain.com has hosting in Europe.


-- 
--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ORM: get, filter and DoesNotExist

2010-04-04 Thread Russell Keith-Magee
On Mon, Apr 5, 2010 at 11:33 AM, zweb  wrote:
> after some debugging, just found out that
> filter method does not throw DoesNotExist while get does.

get() returns a single object. If a single object does not exist, you
get a DoesNotExist exception. This is documented:

http://docs.djangoproject.com/en/dev/ref/models/querysets/#id5

filter() applies a filtering condition to return a QuerySet of objects
that match the filter. If no objects match the filter, the queryset
can be empty. The result exists - it just doesn't contain anything
(e.g., the set of "all people that are 4m tall" exists, but has no
members). This is also documented:

http://docs.djangoproject.com/en/dev/ref/models/querysets/#filter-kwargs

Yours,
Russ Magee %-)

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



Re: Is any thing for python like .jar files for java.

2010-04-04 Thread Anand Agarwal
I think you mean python egg.

-Anand
www.bootstraptoday.com

On Wed, Feb 10, 2010 at 1:35 AM, chiranjeevi muttoju
wrote:

> Hi all,
> Is there any concept in python like .jar files in java. If anybody of you
> know please reply me.
>
> --
> Thanks and regards,
> chiranjeevi.muttoju
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Is any thing for python like .jar files for java.

2010-04-04 Thread ankit rai
you can use deb file for ur python project

On Mon, Apr 5, 2010 at 11:48 AM, Anand Agarwal  wrote:

> I think you mean python egg.
>
> -Anand
> www.bootstraptoday.com
>
> On Wed, Feb 10, 2010 at 1:35 AM, chiranjeevi muttoju <
> chiru.bt...@gmail.com> wrote:
>
>> Hi all,
>> Is there any concept in python like .jar files in java. If anybody of you
>> know please reply me.
>>
>> --
>> Thanks and regards,
>> chiranjeevi.muttoju
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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