Re: Error handling. Catching DoesNotExist errors.

2009-06-21 Thread soniiic
if you'd like to create a book you could have also tried: def getBook(request, bookID): try:     book = Books.objects.get(id=bookID) catch Book.DoesNotExist: #create book here return render_to_response('book.html', {'book': book}) Not useful in this situation but I used it in one of my proje

How do you handle scheduled downtime?

2009-06-14 Thread soniiic
Hello, I've been wondering how django devs handle scheduled downtime? Do you use a different urls.py to always redirect someone to a 'service unavailable' page? Or is there something fancy that you do? Thanks, --~--~-~--~~~---~--~~ You received this message becau

Re: Add request.user.message_set for Anonymous user

2009-06-10 Thread soniiic
use session_messages http://code.google.com/p/django-session-messages/ I'm using it myself at yourxisity.com and it works fine :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: unique slugs (duplicates allowed to be saved)

2009-05-28 Thread soniiic
you might have to reset your database and do a fresh syncdb if you have just added your "unique=True" bit. On May 27, 9:10 pm, Bobby Roberts wrote: > On May 27, 4:08 pm, Bobby Roberts wrote: > > > hi group... I thought slugs were unique, or supposed to be?  Here's > > what i'm doing: > > > in f

Re: Decimal to Decimal nightmare

2009-04-24 Thread soniiic
Are you sure you're using it correctly? i googled it and came up with this which is the exact same position you're in. This never actually applies a value to be converted but it still tries and that's what causes the error (i think) >>> import decimal >>> d = decimal.Decimal() >>> reload(decimal

Re: Registration

2009-04-20 Thread soniiic
The templates are basically your HTML pages. You need to write your urls.py so that when a user visits a certain page, the view that corresponds to that url is just a render_to_response with a path to the HTML page. I can't really be bothered to explain it in detail but once you get the hang of

Re: Registration

2009-04-20 Thread soniiic
you can't just add django funcationality to an already-made HTML site. The whole site has to be moved on the django platform. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Modifying the User model

2009-04-10 Thread soniiic
The way I achieved this was to make my own registration form and use this: email = forms.EmailField(widget=forms.TextInput(attrs=dict (attrs_dict,maxlength=75)),label=_(u'Email address')) where attrs_dict was earlier defined as: attrs_dict = { 'class': 'required' } also, the email address isn't

Re: django.contrib.auth user password decryption

2009-04-05 Thread soniiic
I hope that doesn't mean storing the real password in a table in the database :) On Apr 4, 11:12 pm, Joshua Partogi wrote: > On Apr 4, 11:49 pm, Masklinn wrote: > > > > > > > > > On 4 Apr 2009, at 15:38 , Joshua Partogi wrote: > > > > Dear all, > > > > I already take a look at the django.contri

Re: Adding a ManyToMany field to existing model

2009-04-03 Thread soniiic
You need to delete the model's tables from the database and then do syncdb. Else you could use some of the django plugins that senses the difference between the model and the existing database and then it changes the database for you. google for django-extensions On Apr 3, 2:14 am, jjgod wrote

Re: Modifu request.user

2009-04-01 Thread soniiic
On Apr 1, 3:16 pm, Митко Масарлиев wrote: > soniiic wrote: > > > On Mar 31, 10:31 pm, Mitko Masarliev wrote: > > >> I have application with table name clients. Clients has one to one > >> relation with django users and in all app logic I check clients id by &g

Re: Modifu request.user

2009-04-01 Thread soniiic
On Mar 31, 10:31 pm, Mitko Masarliev wrote: > I have application with table name clients. Clients has one to one > relation with django users and in all app logic I check clients id by > request.user.id, In some cases user_id is not same as clients_id. This > is the problem, so I am trying to c