Re: urgent, undo delete

2011-01-17 Thread ge...@aquarianhouse.com
you should have a backup of your data in the case where is no way to get the data back On Jan 17, 10:18 am, gintare wrote: > Is it possible to undo  model.filter( field_gte = datemin ).delete() > if it was the action, which happened from function in views.py, by >

Re: send_mail not firing

2010-05-18 Thread ge...@aquarianhouse.com
what happens if you set fail_silently to True? On May 19, 12:05 am, Nick wrote: > I am having an issue with an authentication app I am writing. The app > saves the form appropriately but doesn't send the confirmation email. > I am using the same email_host settings as with

Re: How to adapt some code provided by friend

2010-05-05 Thread ge...@aquarianhouse.com
install MySQLdb :) On May 5, 1:23 pm, Etienne Python wrote: > On May 5, 12:42 pm, Daniel Roseman wrote: > > > > > On May 5, 11:06 am, Etienne Python wrote: > > > > Hey all, > > > > I'm a real beginner at both Django and

Re: Equivalent of php json_encode?

2010-05-04 Thread ge...@aquarianhouse.com
sure, simplejson is your helper On May 4, 4:34 pm, zweb wrote: > Is there a django or python equivalent of php json_encode? > > the data I am converting to json has text fields that have quotes, > double quotes, newlines and html tags. Creating json manually in my >

Re: send an email to users after saving is_active=True

2010-05-04 Thread ge...@aquarianhouse.com
if you don't use django-registration, when listen on signal post_save for User, check if is_active == True and do something. On May 4, 2:45 pm, Sander wrote: > someone got an answer to this one? > is there some kind of is_activated signal? > > Sander > > On Apr 3,

Re: HttpResponseRedirect and user message

2010-05-04 Thread ge...@aquarianhouse.com
i would use reverse and redirect to a "success" page def my_view(request): #do stufff #save info in session return HttpResponseRedirect(reverse('success_url')) def my_success_view(request): #access the session and get the data return render_to_response('success.html',

Re: Distinct Field

2010-05-03 Thread ge...@aquarianhouse.com
QL "select distinct(year) from project" it works > fine, but I dont think its very elegant... > > On 3 maio, 07:31, "ge...@aquarianhouse.com" <ge...@aquarianhouse.com> > wrote: > > > > > To use distinct in this context is not a good idea. > >

Re: Distinct Field

2010-05-03 Thread ge...@aquarianhouse.com
To use distinct in this context is not a good idea. Better use aggregate and count the years. http://docs.djangoproject.com/en/dev/topics/db/aggregation/#generating-aggregates-over-a-queryset On May 3, 12:27 pm, Thales wrote: > Hi everybody, > > I have a model called

Re: Refresh django settings without restarting apache

2010-04-29 Thread ge...@aquarianhouse.com
d_python currently not WSGI. > > On Thu, Apr 29, 2010 at 9:57 PM, ge...@aquarianhouse.com < > > > > ge...@aquarianhouse.com> wrote: > > Sure, with WSGI script reload > > > On Apr 29, 6:51 pm, Kashif Ali <kashi.az...@gmail.com> wrote: > > > Hi,

Re: Refresh django settings without restarting apache

2010-04-29 Thread ge...@aquarianhouse.com
Sure, with WSGI script reload On Apr 29, 6:51 pm, Kashif Ali wrote: > Hi, > > Is it possible to refresh changes to apache (webserver) without restart it? > Actually i have multiple databases that i need to change while the webserver > is running. Is it possible? > > Or any

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread ge...@aquarianhouse.com
http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ On Apr 29, 6:48 pm, xRobot <ciaosonoanto...@gmail.com> wrote: > No I am newbie and I don't know how to overwrite storage... could you > help me  ^_^ ? > > > > On 29 Apr, 12:46, "

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread ge...@aquarianhouse.com
Did you try to overwrite the storage? On Apr 29, 6:16 pm, xRobot wrote: > I want to use str(uuid.uuid4()) instead of the name uploaded. > > For instance: I have this model: > > class foo(models.Model): >    pic  = ThumbnailField(upload_to='pics', size=(200, 200)) > > I

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
but when calling > pisaDocument with the generated data it hangs and after a while it > gives timeout. > > On Apr 22, 4:59 pm, "ge...@aquarianhouse.com" > > > > <ge...@aquarianhouse.com> wrote: > > we say the whole thing takes 60 sec., how many

Re: How to raise integrity error in save method of model

2010-04-22 Thread ge...@aquarianhouse.com
In this case it's the wrong place, you have to put the logic into the form class MyForm(models.ModelForm): model = mdlcountry def country_name(self): #verify here and give an error On Apr 22, 3:51 pm, Tom Evans wrote: > On Thu, Apr 22, 2010 at 2:45 PM,

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
teps, I can see that the process hangs after the data > is collected, at the line that calls the pisa.pisaDocument method to > generate the pdf and write the generated bits in a buffer, which > should then be sent to response. > So the bottleneck is at pdf generation step. > > On Apr 22,

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
> On Apr 22, 3:14 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > > > > > On Thu, Apr 22, 2010 at 6:25 AM, ge...@aquarianhouse.com > > > <ge...@aquarianhouse.com> wrote: > > > I your case i would put this task in queue or kind of a back pro

Re: How to raise integrity error in save method of model

2010-04-22 Thread ge...@aquarianhouse.com
def save(self, *args, **kw): if not mdlcountry.objects.filter(country_name=self.country_name).exists(): super(mdlroomtypes, self).save(*args, **kw) else: #do something or do nothing pass On Apr 22, 3:14 pm, Radhikavk wrote: > Model > > class

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
I think that would be a wrong approach. I your case i would put this task in queue or kind of a back process. For sure not on demand. On Apr 22, 1:19 pm, Florin wrote: > Hi! > > I use pisa to generate large pdf files, but it gives opage timeout > when generating. > It

Re: Email Field

2010-04-20 Thread ge...@aquarianhouse.com
did you try: email = models.EmailField(max_length=60) On Apr 20, 5:00 pm, CrabbyPete wrote: > Where in the django.contrib is the models.EmailField defined? I have > email address that are longer than 60 characters and I want to see if > I can override it. > > -- > You

Re: unable to connect

2010-04-19 Thread ge...@aquarianhouse.com
Did you try http://127.0.0.1:8000/ ? On Apr 19, 8:51 pm, arpho wrote: > some days ago after a not clean shut-down django stopped to work, > after python manage.py runserver, it seems working normally, but when > I try to connect tohttp://localhost:8000/adminwith

Re: ChoiceField Being Unpatriotic

2010-04-18 Thread ge...@aquarianhouse.com
gt; my model has to override or define an "all" method? > > Thanks in advance! > > On Apr 17, 11:34 am, "ge...@aquarianhouse.com" > > > > <ge...@aquarianhouse.com> wrote: > > try with: > > > class AddressForm(forms.Form): >

Re: Saving a ModelForm for the current user?

2010-04-18 Thread ge...@aquarianhouse.com
s? > > On Apr 18, 3:14 am, "ge...@aquarianhouse.com" > > > > <ge...@aquarianhouse.com> wrote: > > use commit=False > > > m = form.save(commit=False) > > m.user = request.user > > m.save() > > > On Apr 18, 6:06 am, David Lindquist <da

Re: Saving a ModelForm for the current user?

2010-04-18 Thread ge...@aquarianhouse.com
use commit=False m = form.save(commit=False) m.user = request.user m.save() On Apr 18, 6:06 am, David Lindquist wrote: > Greetings, > > I am trying to solve what seems like an easy problem, but the solution > eludes me even after many Google searches. > > I have a

Re: Modify Content-Type to play MP3?

2010-04-18 Thread ge...@aquarianhouse.com
something like: f = open("file.mp3", "rb") data = f.read() f.close() return HttpResponse(data, mimetype='audio/mp3') On Apr 18, 6:34 am, The Danny Bos wrote: > Heya, > > I'm trying to modify the content-type of a page to play an MP3. > > Basically, instead of pointing

Re: Django-PostgreSQL-Unix_socket

2010-04-17 Thread ge...@aquarianhouse.com
leave HOST='' # empty then it's unix sockets On Apr 17, 10:04 pm, user4f <4fs...@gmail.com> wrote: > What exaple settings in settings.py for connection to PostgreSQL via > unix soket? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To

Re: ChoiceField Being Unpatriotic

2010-04-17 Thread ge...@aquarianhouse.com
try with: class AddressForm(forms.Form): first_and_last_name = forms.CharField(128, 1) street1 = forms.CharField(128, 1) street2 = forms.CharField(128, 1) city = forms.CharField(64, 1) state = forms.ModelChoiceField(queryset=States.objects.all()) form =

Re: how do you build an html website in python?

2010-04-17 Thread ge...@aquarianhouse.com
http://www.djangoproject.com/ On Apr 17, 3:06 pm, codecub wrote: > i want to create a website like whalesalad.com and ive read through > the python documentation but it doesnt explain building a website out > of scratch in python > > -- > You received this message because

Re: Authentication using email in Django 1.1

2010-04-17 Thread ge...@aquarianhouse.com
when overwrite the auth module :) On Apr 17, 12:08 pm, Marconi wrote: > Hello, I've been googling and I can't find a solution to use email > instead of username when logging-in that will work in Django 1.1 and > should also work on the admin side. > > -- > You received this

Re: form won't save my submitted form

2010-04-16 Thread ge...@aquarianhouse.com
def save(self): # Better: don't overwrite save method if form.is_valid(): form.save() and you are fine On Apr 17, 12:30 am, JoJo wrote: > Hi all, i have created a site where users can leave messages, and > their opinions on certain topics, i have the

Re: Concat a message with send_mail

2010-04-15 Thread ge...@aquarianhouse.com
As already mentioned, the best would be to use render_to_string('email_template.txt', {'name':'John', 'msg':'message'}) and pass it through. On Apr 15, 6:13 pm, Tim Shaffer wrote: > Can't you just concatenate them like so? > > message = "Last Name: " + last_name + "

Re: Not able to resolve this error

2010-04-15 Thread ge...@aquarianhouse.com
P?[-\w]+ to ?P[-\w]+ On Apr 15, 3:46 pm, Pankaj Singh wrote: >  Page not found (404)  Request Method: GET  Request > URL:http://10.115.4.61:1234/weblog/2010/apr/14/how-it-functions/ > > Using the URLconf defined in django_project.urls, Django tried these URL >

Re: Django 1.2

2010-04-15 Thread ge...@aquarianhouse.com
Full roadmap: http://code.djangoproject.com/wiki/Version1.2Roadmap On Apr 15, 1:56 pm, Karen Tracey wrote: > On Thu, Apr 15, 2010 at 7:51 AM, Sudhakar wrote: > > > When is the official release of Django 1.2? > >

Re: Help in working with the API

2010-04-15 Thread ge...@aquarianhouse.com
It seems there is no such table "DatabaseError: no such table: polls_choice " ./manage syncdb would help :) On Apr 15, 10:43 am, Vetc wrote: > Hello, > > I am a new user of Django, i am following the instructions at this web > page

Re: name in the model

2010-04-15 Thread ge...@aquarianhouse.com
Sure, use verbose_name='FOO' On Apr 15, 11:15 am, Alfredo Alessandrini wrote: > Hi, > > I've this model: > > class Persone(models.Model): >        CV = models.TextField() > > Can I change the name "CV" when I display it in a formset? > > Thanks, > > Alfredo -- You

Re: Calling a method immediately after login

2010-04-02 Thread ge...@aquarianhouse.com
In this case you should overwrite the auth class. http://docs.djangoproject.com/en/dev/topics/auth/ On Apr 2, 1:40 pm, Derek wrote: > I am running Django 1.1 and using the Admin framework with the "built-in" > user registration functionality. > > I need to run some code

Re: probleme with delete on cascade with foreign key self-referencing

2010-03-29 Thread ge...@aquarianhouse.com
i think like this: def delete_all(self): Categories.objects.filter(parent_category=self).delete() On Mar 29, 3:55 pm, mouadino wrote: > hello everybody > > I have a model class where i m  using a foreign key self-referencing > here is my code : > > class

Re: Django ORM

2010-03-23 Thread ge...@aquarianhouse.com
If it doesn't exist it would throw an exception. On Mar 23, 3:21 pm, jrs <j...@framemedia.com> wrote: > On Mar 23, 10:05 am, "ge...@aquarianhouse.com" > > <ge...@aquarianhouse.com> wrote: > > Filter would be better :) > > > Container.objects.filter( &

Re: Django ORM

2010-03-23 Thread ge...@aquarianhouse.com
Filter would be better :) Container.objects.filter( pk=container_id ).delete() On Mar 23, 2:55 pm, jrs wrote: > I have a statement--- > >     Container.objects.get( >          pk=container_id >     ).delete() > > This seemingly trivial operation hammers the

Re: Why should I always use a forward slash (/) in settings.py?

2010-03-18 Thread ge...@aquarianhouse.com
like this is also fine: os.path.join(os.path.dirname(__file__),'templates'), On Mar 18, 3:16 pm, brooder wrote: > http://docs.djangoproject.com/en/1.1/intro/tutorial01/#intro-tutorial01 > > Tutorial 1 says: "When specifying the path, always use forward > slashes, even on

Re: error when updating

2010-03-18 Thread ge...@aquarianhouse.com
': form = ActionForm(request.POST) # return render_to_response('tmp.html', locals())#etc... On Mar 18, 3:11 pm, Benedict Verheyen <benedict.verhe...@gmail.com> wrote: > ge...@aquarianhouse.com wrote: > > Hi, > > > I hope I understood it right. You could set t

Re: error when updating

2010-03-18 Thread ge...@aquarianhouse.com
Hi, I hope I understood it right. You could set the field to editable=False, the rest Django will take care. Btw, you have a typo "attachement" should be "attachment" I think. On Mar 18, 2:47 pm, Benedict Verheyen wrote: > Hi, > > i have a problem when saving a

Re: How to debug a 500 error - view not called, request not accessible

2010-03-16 Thread ge...@aquarianhouse.com
gt; DEBUG = True > TEMPLATE_DEBUG = DEBUG > > I'll read up on setting up a 500 error page to see if that helps. > > On Mar 16, 11:32 am, "ge...@aquarianhouse.com" > > <ge...@aquarianhouse.com> wrote: > > We need more infos. > > > Is it on the tes

Re: How to debug a 500 error - view not called, request not accessible

2010-03-16 Thread ge...@aquarianhouse.com
We need more infos. Is it on the test server or on the prodution server? Is DEBUG on? If debug is off and 500 is beeing showed when maybe django is trying to find "500.html" and if it's not available when this error happen like you have. On Mar 16, 4:22 pm, Stodge wrote: >

Re: Resize image if too large

2010-03-15 Thread ge...@aquarianhouse.com
well, something is missing, like def save(self, *args, **kwargs): #your code but in our case the form class should do the validation... On Mar 15, 5:07 pm, When ideas fail wrote: > Hello, I've been trying to create a save method which resizes an image > if it is

Re: Putting dictionary element according to another element's value

2010-03-15 Thread ge...@aquarianhouse.com
{% with o.id as key %}{{ dictionary.key }}{% endwith %} would be better, as in comments mentioned On Mar 15, 3:14 pm, "pjrhar...@gmail.com" wrote: > You'll need a custom template tag. Something like this will probably > do: > >

Re: REMOTE_ADDR

2010-03-15 Thread ge...@aquarianhouse.com
it seem to me, it's in the template. when it should work like this: {{ request.META.REMOTE_ADDR }} btw: > 'request.METTA['REMOTE_ADDR']' <--- in META is one T to much On Mar 15, 2:45 pm, Ken Lacey wrote: > Hi > > I am trying to access the remote addr in a view. > > Using

Re: send_mail UnicodeDecodeError: 'ascii' codec can't decode byte

2010-03-14 Thread ge...@aquarianhouse.com
it should work with: body = unicode("Treść", 'utf-8') On Mar 14, 3:49 pm, Michał Klich wrote: > Hi, > I do not fully understand how this works. > > I have > subject = "Temat" > body = "Treść" > from = some.em...@dot.com > to = some.em...@dot.com > > send_email(subject,

Re: convert mysql database to django model

2010-02-27 Thread ge...@aquarianhouse.com
Hi just use ./manage.py inspectdb ;) -- 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.

Re: Handling input of external urls

2010-02-26 Thread ge...@aquarianhouse.com
Check it with regex? re.compile("[a-z0-9]\.[a-z]{2,6}$", re.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

Re: update a record without typing too much

2010-02-26 Thread ge...@aquarianhouse.com
maybe like this?: def up(model, **kw): m.objects.filter(pk=model.pk).update(**kw) -- 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