Re: save_model admin

2010-04-13 Thread Ian Lewis
If you are talking about Django's admin couldn't you implement it by overriding save_model as your subject seems to suggest? http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model

Re: many to many based upon common field

2010-04-13 Thread Ian Lewis
wizard, Would it make sense to use the intermediate table to hold the field? Using the stack overflow example: class Edi856(models.Model): pass class Order(models.Model): edi = models.ManyToManyField(Edi856, through='PoNum') def in_edi(self): '''Has the edi been

Re: CSRF and Caching

2010-04-13 Thread Ian Lewis
There is the possibility that the token could be cached in html if you are using the cache template tag. Otherwise the token shouldn't be cached. On Wed, Apr 14, 2010 at 3:31 AM, scoopseven wrote: > Is there any possibility that CSRF tokens could be cached by memcache >

Re: urllib2: post request to a django form

2010-04-13 Thread Ian Lewis
Try running the server locally using the devserver and posting to it. You can invoke python's debugger when the post is recieved on the server side by adding some code like the following: import pdb;pdb.set_trace() On Wed, Apr 14, 2010 at 7:30 AM, bfrederi wrote: > I'm

Re: Django Newbie seeking for advice

2010-04-13 Thread Matt Schinckel
On Apr 13, 11:12 pm, Mister Yu wrote: > Hi Ian, > > Thanks for replying. The information is really useful. > > however, when i checked out the openid link you gave me, the project > seems still on a testing stage, and on the website, it says: "A modern > library for

Re: admin page will not display

2010-04-13 Thread Nick
try resetting your server On Apr 13, 4:50 pm, NicMAN wrote: > Hi all, i recently tried to open my admin page and it won't let me > open it keeps saying > > Caught an exception while rendering: Tried create_user in module > applications.views. Error was: 'module' object

Re: admin page will not display

2010-04-13 Thread Karen Tracey
On Tue, Apr 13, 2010 at 5:50 PM, NicMAN wrote: > Hi all, i recently tried to open my admin page and it won't let me > open it keeps saying > > Caught an exception while rendering: Tried create_user in module > applications.views. Error was: 'module' object has no

urllib2: post request to a django form

2010-04-13 Thread bfrederi
I'm attempting to re-route user posts from one django instance to another. I'm doing this by receiving a user's post request, and then sending the post to another django instance as a post request (sorry if this is confusing). I'm having trouble making a post request to a django form using

admin page will not display

2010-04-13 Thread NicMAN
Hi all, i recently tried to open my admin page and it won't let me open it keeps saying Caught an exception while rendering: Tried create_user in module applications.views. Error was: 'module' object has no attribute 'create_user' but i don't have a my create_user code anymore, i deleted it

Re: Different model behaviour in template tag and python shell?

2010-04-13 Thread Sven Richter
Haha, just like always, short after mailing it flashed to my mind. I named the class Business the same like the model Business, which of course, clashes with each other. Greetings Sven On Tue, Apr 13, 2010 at 11:09 PM, Sven Richter wrote: > Hi everybody, > > i have some

Re: invalid literal for int() with base 10

2010-04-13 Thread Pankaj Singh
ok i resolved .. primary key was the problem i was using name as pk instead of id -- 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

Different model behaviour in template tag and python shell?

2010-04-13 Thread Sven Richter
Hi everybody, i have some problem i just dont understand. I have a business model (derived from django namespace): class Business(models.Model): business = models.ForeignKey("self", related_name="other_business") name = models.CharField(max_length=50, unique=True) ... objects =

invalid literal for int() with base 10

2010-04-13 Thread Pankaj Singh
*I am unable to resolve this issue .. please help me* ValueError at /pages/About/ invalid literal for int() with base 10: 'About' Request Method: GET Request URL: http://localhost:8000/pages/About/ Exception Type: ValueError Exception Value: invalid literal for int() with base 10: 'About'

Re: Problems with comment form customization ?

2010-04-13 Thread Ariel
That's the same I do, but if you don't take off the cols property and you set a width size smaller than that amount of cols then the textarea shows an ugly horizontal scroll, that I want to avoid. Could anybody knows how to solve that ??? On Tue, Apr 13, 2010 at 4:13 PM, bax...@gretschpages.com

Re: WSGIScriptAlias

2010-04-13 Thread Tim Shaffer
Try reversing the order. The first alias is probably picking up the / test URL. If you specify the test alias first, it should work. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

many to many based upon common field

2010-04-13 Thread wizard
This is sort of an extension of my post from stackoverflow. http://stackoverflow.com/questions/2632573/how-do-i-relate-two-models-tables-in-django-based-on-non-primary-non-unique-keys The gist is I have two tables with a common field and I would like to relate two models with a many to many based

Re: Problems with comment form customization ?

2010-04-13 Thread bax...@gretschpages.com
Personally, I just set the width of textareas in my CSS and call it a day. On Apr 13, 2:35 pm, Ariel wrote: > if I want to reduce de amount of columns that the > textarea has, how could I do it ? -- You received this message because you are subscribed to the Google Groups

Send file over HTTP

2010-04-13 Thread Rafael Nunes
How can I send a file over HTTP? I tried with request parameter and it works fine. [code1] def handle_upload(files, id_user): url = URL_IMG_HANDLER_APP values = {''param1', 'value1'} req = urllib2.Request(url, data) urllib2.urlopen(req) But if I try with binary files, the file

CSRF and Caching

2010-04-13 Thread scoopseven
Is there any possibility that CSRF tokens could be cached by memcache causing chaos on a django site? -- 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

Re: Problems with comment form customization ?

2010-04-13 Thread Ariel
Well that really solve the problem. Now I have a new question: if I want to reduce de amount of columns that the textarea has, how could I do it ? This is not as simple as the previous issue. Thanks in advance. Regards Ariel On Mon, Apr 12, 2010 at 3:58 PM, bax...@gretschpages.com <

WSGIScriptAlias

2010-04-13 Thread Alfredo Alessandrini
Hi, I've a problem with the apache configuration: I'm trying to set www.example.com/ and www.example.com/test, but if I try this, work only the first site: WSGIScriptAlias / /home/alfreale/. WSGIScriptAlias /test /home/alfreale/. thanks, Alfredo -- You received

Re: Override Delete Function

2010-04-13 Thread cootetom
I've settled on a solution for this now which works fine. So I'm overriding the delete function for my model. In that function I'm clearing any references that I need to but I'm then also calling delete manually on any child objects that I also have overridden delete functions for. This does

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread geraldcor
That was a very good guess. I tried it but it didn't work. On Apr 13, 12:46 pm, johan sommerfeld wrote: >  You could try using initial=0. > > /J > > On Tuesday, April 13, 2010, geraldcor wrote: > > Hello all, > > > I know the error "invalid

Re: Override Delete Function

2010-04-13 Thread cootetom
OK I've tried the pre_delete approach but unfortunately it doesn't work for what I'm trying here. It appears that django gets a collection of objects that it is going to delete then it calls pre_delete on each object before finally deleting the objects. So django has decided which objects to

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread johan sommerfeld
You could try using initial=0. /J On Tuesday, April 13, 2010, geraldcor wrote: > Hello all, > > I know the error "invalid literal for int() with base 10: '' " has > been discussed a lot in the past, but this seems to be unique to my > situation. > > I have 2 choice fields

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread bfrederi
I happened to be stopping by to post my own question, and I don't know if this is the answer or not, but have you tried adding the argument blank=True to your model field? http://docs.djangoproject.com/en/dev/ref/models/fields/#blank -- You received this message because you are subscribed to the

ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread geraldcor
Hello all, I know the error "invalid literal for int() with base 10: '' " has been discussed a lot in the past, but this seems to be unique to my situation. I have 2 choice fields as defined below for both the model and form: models.py class Checkin(models.Model): ... content =

Re: MySQLdb setup on snow leopard help

2010-04-13 Thread VWAllen
I had a lot of trouble at first getting things setup on Snow Leopard (mostly 32-bit/64-bit problems). Ultimately, I loaded the full stack through MacPorts (apache, mysql, python, wsgi, django, etc. etc.). Almost all of the problems I ran into with this method were related to making sure that

Re: Calling the same views, displaying in different templates

2010-04-13 Thread rvidal
Thanks! I knew there was a way around this. Repeating code is very not like django :) Works like a charm. Thanks again. On Apr 13, 12:30 am, Danny Adair wrote: > On Tue, Apr 13, 2010 at 15:59, rvidal wrote: > >[...] > > I have my urls.py looking

Re: Django SMTP and SPA

2010-04-13 Thread Massimiliano della Rovere
i think the python modules - smtplib - email will help. Have you already tried these ones? On Tue, Apr 13, 2010 at 14:58, Alex wrote: > Hi. > Can anybody suggest an idea how to deal with SMTP server with Secure > Password Authentication in Django? > > -- > You received

Re: Django Newbie seeking for advice

2010-04-13 Thread Mister Yu
Hi Ian, Thanks for replying. The information is really useful. however, when i checked out the openid link you gave me, the project seems still on a testing stage, and on the website, it says: "A modern library for integrating OpenID with Django - incomplete, but really nearly there (promise)"

Re: Using properties as filters in the admin

2010-04-13 Thread filias
Humm, but are not FilterSpecs used to customized a filter on a specific attribute of the model? In my case I would like that the value of a property is used as a filter in the admin. This property is not related directly with any of the fields from the model. Is there a way of doing this? On Apr

Async Django, async ORM?

2010-04-13 Thread Continuation
There has been a lot of interesting things happening in the async area of Python. Projects like gevent or Concurrence all provide WSGI servers and async database drivers. So it looks like it should be possible to run Django on such an async framework. I'm hoping to learn more about this. Some

Re: get_comment_count templatetag

2010-04-13 Thread bax...@gretschpages.com
Actually, on the first one, I would just define it in the model. So if you have Blog.entry, under entry there would be def get_comment_count(self): do stuff and in the template, you'd just say entry.get_comment_count On Apr 13, 2:01 am, fuxter wrote: > yeap, that's

OneToOneField produces two inlines?

2010-04-13 Thread wally
I have two models related by a OneToOneField as in the code below, but when I create an inline to display on the admin form for the 'parent' object, I get forms for two of the related objects instead of one (ie an instance of A and two instanced of B). Can anyone suggest why this would be the

Django SMTP and SPA

2010-04-13 Thread Alex
Hi. Can anybody suggest an idea how to deal with SMTP server with Secure Password Authentication in Django? -- 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

pubsubhubbub and django

2010-04-13 Thread homoludens
Is anyone (here) using pubsubhubbub with django? I want to implement it in my project, but only code i have found is this: https://git.participatoryculture.org/djpubsubhubbub/ without any findable documentation. Is there something more on this topic, presumably some more active project? Thanks

Django Sphinx Foreign key search

2010-04-13 Thread urukay
Hi, I'm trying to create full text search on model, everything goes fine when searching TextFields but I have a problem with ForeignKey field. How can i do that? Can anyone point me to the right direction? Thanks Model example: class Model1(models.Model): text_field

Re: Calling the same views, displaying in different templates

2010-04-13 Thread Danny Adair
On Tue, Apr 13, 2010 at 15:59, rvidal wrote: >[...] > I have my urls.py looking something like this: > urlpatterns = patterns('mysites.shop.views', >        (r'^$', 'index'), >        (r'^client/(?P\d+)/$', 'details'), >        (r'^client/(?P\d+)/receipts/$', 'receipts'), >      

Re: Plugin for Eclipse

2010-04-13 Thread Jani Tiainen
On 04/13/2010 03:07 AM, Zbiggy wrote: Hi, maybe someone would be interested in: http://eclipse.kacprzak.org/ I use Eclipse + PyDev, however Django tags coloring was always sth I was missing. However if you found such a plugin already, please let me know. I'd like to avoid wasting my time in

Re: Calling the same views, displaying in different templates

2010-04-13 Thread bruno desthuilliers
On 13 avr, 05:59, rvidal wrote: > I have my urls.py looking something like this: > urlpatterns = patterns('mysites.shop.views', >         (r'^$', 'index'), >         (r'^client/(?P\d+)/$', 'details'), >         (r'^client/(?P\d+)/receipts/$', 'receipts'), >        

save_model admin

2010-04-13 Thread Alfredo Alessandrini
Hi, I've this model: class Person(models.Model): user = models.ForeignKey(User) courses = models.TextField(blank=True, null=True) research_statement = models.TextField(blank=True, null=True) .. I will let to save the form only when the user is making

Re: Override Delete Function

2010-04-13 Thread cootetom
Thanks Ian, I'll give that a go later. I don't suppose it matters what order they are called in because it's only clearing references to do with the model instance it's calling from. On Apr 13, 2:15 am, Ian Lewis wrote: > Tom, > > You could try doing this clear logic in

Re: Plugin for Eclipse

2010-04-13 Thread phoebebright
Have you checked out PyCharm - also uses pydev but geared for python and django aware. Is only in public alpha but I'm very impressed. Phoebe. On Apr 13, 1:07 am, Zbiggy wrote: > Hi, > maybe someone would be interested in:http://eclipse.kacprzak.org/ > > I use Eclipse +

Re: get_comment_count templatetag

2010-04-13 Thread fuxter
yeap, that's another way this could be done. incrementing comments_count on signal. actually, i'm inclined to your first method, since it's seems easier for my to accomplish. i'm also considering writing a templatetag just for the practice. nevere have i need to write templatetag till now. thank