Re: Help - m2m field in my model

2008-06-07 Thread M.Ganesh
[EMAIL PROTECTED] wrote: > Don't use the internal method, instead do unicode(self.location_type) > + ' - ' > > Done. BTW is there any specific reason for this suggestion? Thanks Ganesh --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Help - m2m field in my model

2008-06-07 Thread [EMAIL PROTECTED]
The point for those "magic methods" in python is to provide a common api to them, it's the same reason you do len(sequence) instead of sequence.__len__(), or the reason we do 3 + 4 instead of 3.__add__(4). On Jun 7, 2:42 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Don

Dear Friends, Are you interested to make Rs.20,000 to Rs.1,20,000 A Day ? This is not a get rich quick scheme. This is a legal opportunity to make good money when you do it part time. This opportuni

2008-06-07 Thread onlin
Dear Friends, Are you interested to make Rs.20,000 to Rs.1,20,000 A Day ? This is not a get rich quick scheme. This is a legal opportunity to make good money when you do it part time. This opportunity is a proven way to make Rs.20,000 to Rs.1,20,000 A Day . There are already 3,00,000 people around

Re: very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-06-07 Thread oliver
Thanks for that. We kind of worked around it but it does still pop up randomly which is very odd! Will keep an eye on it! thanks again. On Jun 6, 7:55 pm, Ole Laursen <[EMAIL PROTECTED]> wrote: > I think it's this bug: > > http://code.djangoproject.com/ticket/6052 > > Nasty fellow. > > -- > Ole

الفيلم الكامل لروبى نيك ودعك وصورها بعد مانامت

2008-06-07 Thread maiya omr
الفيلم الكامل لروبى نيك ودعك وصورها بعد مانامت http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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 unsu

كويتيه بتتناك من رجلين فى وقت واحد

2008-06-07 Thread maiya omr
كويتيه بتتناك من رجلين فى وقت واحد http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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

فيديو سعوديات فى مصر بيرقصوا عارين تماما

2008-06-07 Thread maiya omr
فيديو سعوديات فى مصر بيرقصوا عارين تماما http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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 unsubscrib

سعودى مصمم ينكها فى طيزها وهى رافضه يا ترى ردها هيبقى ايه

2008-06-07 Thread maiya omr
سعودى مصمم ينكها فى طيزها وهى رافضه يا ترى ردها هيبقى ايه http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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.

الفلم الذي أغضب الشارع المصري-اغتصاب بنت جامعة المنصورة

2008-06-07 Thread maiya omr
الفلم الذي أغضب الشارع المصري-اغتصاب بنت جامعة المنصورة http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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.c

سكرتيرة سورية بمكتب مديرها (حقيقي) + الصور اغتصاب

2008-06-07 Thread maiya omr
سكرتيرة سورية بمكتب مديرها (حقيقي) + الصور اغتصاب http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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

ليلة دخلة سعودي كامل +صور

2008-06-07 Thread maiya omr
ليلة دخلة سعودي كامل +صور http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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 gro

طيز دلال عبد العزيز أحلى طيز عربيه مصريه ولاول مره معنا فقط

2008-06-07 Thread maiya omr
طيز دلال عبد العزيز أحلى طيز عربيه مصريه ولاول مره معنا فقط http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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@googlegroup

فاطمة زاهر من مصر وهي بتمص بغرابة مش معقوللللللللللللللللل

2008-06-07 Thread maiya omr
فاطمة زاهر من مصر وهي بتمص بغرابة مش معقول http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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

فيلم خليجي رااااائع جدااا و خرافه بنت شديده طحن+الصور

2008-06-07 Thread maiya omr
فيلم خليجي رائع جدااا و خرافه بنت شديده طحن+الصور http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ 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

فيلم ناااااااادر جدا لفض غشاء بكارة بنت مصرية من البوى فريند بتاعها والبنت هاديه جداااا

2008-06-07 Thread maiya omr
فيلم ندر جدا لفض غشاء بكارة بنت مصرية من البوى فريند بتاعها والبنت هاديه جد http://tinyurl.com/6jhm5v --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

to_python vs validate

2008-06-07 Thread Eric Abrahamsen
Hi there, I recently discovered that, when fooling with values in my model's custom save() method, I need to treat PositiveSmallIntegerField values as string values, rather than integer values. Googling led me to this thread on django-developers: http://groups.google.com/group/django-develo

@#we are bad boys#@

2008-06-07 Thread we are student
@#we are bad boys#@ http://studentloans4.blogspot.com --~--~-~--~~~---~--~~ 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

Django models - newbie question

2008-06-07 Thread nikosk
Hi all Does anyone know how to do something like this : class Game(models.Model): team1 = models.ForeignKey(Teams, related_name=u'team_home') team2 = models.ForeignKey(Teams , related_name=u'team_away') round = models.ForeignKey(Round) game_date = models.DateField() def __uni

Re: Django models - newbie question

2008-06-07 Thread Sebastian Bauer
try this: return Teams.objects.get(self.team1).name nikosk pisze: > Hi all > > Does anyone know how to do something like this : > > class Game(models.Model): > team1 = models.ForeignKey(Teams, related_name=u'team_home') > team2 = models.ForeignKey(Teams , related_name=u'team_away') >

Re: Django models - newbie question

2008-06-07 Thread Sebastian Bauer
ups i think return Teams.objects.get(self.team1_id).name will be better :) Sebastian Bauer pisze: > try this: > > return Teams.objects.get(self.team1).name > > > nikosk pisze: > >> Hi all >> >> Does anyone know how to do something like this : >> >> class Game(models.Model): >> team1 = mo

Re: Help - m2m field in my model

2008-06-07 Thread M.Ganesh
[EMAIL PROTECTED] wrote: > The point for those "magic methods" in python is to provide a common > api to them, it's the same reason you do len(sequence) instead of > sequence.__len__(), or the reason we do 3 + 4 instead of 3.__add__(4). > > Thanks for your time Regards Ganesh --~--~-

Re: Django models - newbie question

2008-06-07 Thread Alex Koshelev
Hmm.. def __unicode__( self ): return "%s" % self.team1 # if Teams model has its own __unicode__ method On Jun 7, 5:34 pm, nikosk <[EMAIL PROTECTED]> wrote: > Hi all > > Does anyone know how to do something like this : > > class Game(models.Model): > team1 = models.ForeignKey(Teams, relat

building distributed systems with django?

2008-06-07 Thread lgr888999
Im curious to hear if theres any django developer that has built any decentralized distributed system with help of django? I know building a website doesnt include any scaling problems in the beginning, im asking more out of personal interests in high availability. If you dont have any experience

Re: building distributed systems with django?

2008-06-07 Thread John Dohn
On Sun, Jun 8, 2008 at 2:11 AM, lgr888999 <[EMAIL PROTECTED]> wrote: > how you would build a huge decentraliced system. Now of course it > would depend on what the purpose of the system is so lets just take > twitter as an example. :) > It's easy. All you have to do is to avoid all single points

Re: Question about Form Wizard

2008-06-07 Thread Leeland (The Code Janitor)
I am a new Django person as well. There is one other point about storing data in sessions. If you expect the site to grow you should put the session data in a back-end database. This will allow multiple servers to access the data. This is important if you ever want to have load balanced servers wh

ModelChoiceField option values

2008-06-07 Thread Mihai Damian
I'm using a ModelChoiceField on a form and it seems the value attributes of the generated option tags are simply their numeric order in the queryset. How can I set the value attribute to some useful information like id or the __unicode__ representation itself? Thanks --~--~-~--~~-

confusing querying

2008-06-07 Thread birkin
I just posted some command-line interactive output at: http://dpaste.com/hold/55270/ The gist of the problem: >>> second_bunch = Subject.objects.all().order_by('name')[22:44] >>> second_bunch[0] # shows unexpected output ...but... >>> second_bunch = Subject.objects.all().order_by('name')[22:

Re: I need to display lists of objects with sublist under each one - sounds simple, but I hit a roadblock :(

2008-06-07 Thread Karen Tracey
On Sat, Jun 7, 2008 at 2:40 AM, Minder <[EMAIL PROTECTED]> wrote: > > Hi, > > I am new to both Django and Python and yet I'm developing a site for > myself. I have some programming skills in REXX, Pascal and Bash and > that helps a little. > > I need to do one of the simplest things, yet I hit a r

Re: confusing querying

2008-06-07 Thread Alex Koshelev
When in your first example you call `[0]` it replaced earlier `[22:44]` slicing. In second example before `[0]` slice query set is converted into list (for `repr` call and output) and then you apply `[0]` to result list. On Jun 7, 7:54 pm, birkin <[EMAIL PROTECTED]> wrote: > I just posted some c

Inline editing an object related to itself.

2008-06-07 Thread Cliff
Hi, This is the simplified version of my code: class Test(models.Model): parent = models.ForeignKey('self',edit_inline=models.TABULAR) and the error I got: RuntimeError: maximum recursion depth exceeded I can understand that's because it's doing recursive for the child object, grand child ob

Re: building distributed systems with django?

2008-06-07 Thread lgr888999
Great write up! Thanks! Im fully aware of that the problem is in the datastorage but django doesnt support for example sharding or multiple databases out of the box, the other way around its more about keeping things dry and normalized which makes it harder to build something decentralized. Hence

Re: building distributed systems with django?

2008-06-07 Thread Jeff Anderson
lgr888999 wrote: Great write up! Thanks! Im fully aware of that the problem is in the datastorage but django doesnt support for example sharding or multiple databases out of the box, the other way around its more about keeping things dry and normalized which makes it harder to build something dec

Re: building distributed systems with django?

2008-06-07 Thread lgr888999
replication isnt exactly distributing... with only one master db which handles all the writes you have a single point of failure... On 7 Juni, 20:05, Jeff Anderson <[EMAIL PROTECTED]> wrote: > lgr888999 wrote: > > Great write up! Thanks! Im fully aware of that the problem is in the > > datastorag

deleting an uploaded file after a positive virus check

2008-06-07 Thread tejas
Hi All I've been using django's newforms library to handle file uploads. To do this safely I also use pyclamd to virus check the content of the files (using the values['file'] dict which has been validated with newforms). If there's a virus found I want to delete the file from the server immediat

MySQL Lib

2008-06-07 Thread [EMAIL PROTECTED]
I'm following the online Django install docs and seem to be getting hung up on the MySQL Lib, I'm following this information here: http://antoniocangiano.com/2007/12/22/how-to-install-django-with-mysql-on-mac-os-x/ I'm getting a lot of _mysql.c:2527: warning: passing argument 1 of ‘PyMember_

Re: Remove empty value ('---------') from HTML SELECT choices

2008-06-07 Thread Berco Beute
Thanks! Quite a lot of work for something so simple, but it works. For future reference here's what it looks like now: ===forms.py== class CarChoiceField(forms.ModelChoiceField): def __init__(self, *args, **kwargs): super(MyChoiceField, self).__init__(empt

Re: Can Someone Do something about ALL THIS SPAM

2008-06-07 Thread Karen Tracey
On Fri, Jun 6, 2008 at 9:43 AM, Vadim Macagon <[EMAIL PROTECTED]> wrote: > > John Handelaar wrote: > >> * The alternative to this is to start moderating the list, > > > > With respect, no. There are a large number of other list hosting > > options. > > Clearly moderating every post is impractical

Re: Inline editing an object related to itself.

2008-06-07 Thread Cliff
Just to throw in another variable. The recursion comes from file django/db/models.py in method get_follow: def get_follow(self, override=None): follow = {} for f in self.fields + self.many_to_many + self.get_all_related_objects(): if override and f.name in override:

Re: MySQL Lib

2008-06-07 Thread [EMAIL PROTECTED]
I've torn out 64 bit version of MySQL and replaced with the 32 bit version that I have seen some people mentions the leopard incompatabilities. I'm on Leopard 10.5.3 with the MySQL 10.4 x86 build. I still can't get the MySQLdb to build get over 2500 errors. This is what I have in my path:

Re: Remove empty value ('---------') from HTML SELECT choices

2008-06-07 Thread Nathaniel Whiteinge
On Jun 7, 4:18 pm, Berco Beute <[EMAIL PROTECTED]> wrote: > Quite a lot of work for something so simple I agree that overriding default widgets is currently too much work. But here's a slightly shorter version that works in exactly the same way as your example:: class SomeForm(forms.ModelFor

Re: deleting an uploaded file after a positive virus check

2008-06-07 Thread Karen Tracey
On Sat, Jun 7, 2008 at 4:35 PM, tejas <[EMAIL PROTECTED]> wrote: > Hi All > > I've been using django's newforms library to handle file uploads. To > do this safely I also use pyclamd to virus check the content of the > files (using the values['file'] dict which has been validated with > newforms).

custom action during "insert" but not during "update"

2008-06-07 Thread chefsmart
Hi All, I need some insight on the following scenario: I want to execute some custom action when creating new model instances when calling model.save(), but I don't want this custom action to execute when updating an existing model instance. How do I distinguish between an "insert" and an "upda

Re: custom action during "insert" but not during "update"

2008-06-07 Thread [EMAIL PROTECTED]
If you overide model.save() just check for self.pk to be set. On Jun 7, 11:19 pm, chefsmart <[EMAIL PROTECTED]> wrote: > Hi All, > > I need some insight on the following scenario: > > I want to execute some custom action when creating new model instances > when calling model.save(), but I don't w

How to execute function dynamically?

2008-06-07 Thread David.D
view.py = def functionA(request): ... return ... def functionB(request): return ... callDict = {'functionA': functionA, 'functionB':functionB,...} def myview(request, indata): func = callDict.get(indata) func(request) indata is a string:'functionA'、'functionB'.

Re: custom action during "insert" but not during "update"

2008-06-07 Thread Julien
As alex says, testing the primary is the only way that I know of: def save(self): if self.pk is None: # Here's we're creating a new object else: # Here we're updating an existing object On Jun 8, 2:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If you overide mo

Re: custom action during "insert" but not during "update"

2008-06-07 Thread chefsmart
Alex, Julien That was it -- thanks. On Jun 8, 10:37 am, Julien <[EMAIL PROTECTED]> wrote: > As alex says, testing the primary is the only way that I know of: > > def save(self): >     if self.pk is None: >         # Here's we're creating a new object >     else: >         # Here we're updating

Re: How to execute function dynamically?

2008-06-07 Thread Karen Tracey
2008/6/8 David.D <[EMAIL PROTECTED]>: > > view.py > = > def functionA(request): >... >return ... > def functionB(request): > >return ... > > callDict = {'functionA': functionA, 'functionB':functionB,...} > > def myview(request, indata): >func = callDict.get(indata) >

upload is working, but how to store the path in the imagefield?

2008-06-07 Thread chefsmart
Hi, can someone help me with the following please: - I have a newform with an imagefield. The upload is working fine [using save_FOO_file(filename, raw_contents)], but I'm not sure what value to assign to the model's imagefield, or how to assign it. The django documentation for save_FOO_file say

Django Suitable for this?

2008-06-07 Thread beetlecube
I read a blog entry somewhere by someone contemplating the ideal type of web application needs that Django best meets: Since it was written originally for publishing articles in a newspaper environment, it's good for blogs or other Article type sites. Myself, I'm working on a To-Do list type a

Re: django programming project

2008-06-07 Thread david.watson
Thanks for the tip. On Jun 6, 6:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Jun 6, 2008 at 7:55 PM, david.watson <[EMAIL PROTECTED]> wrote: > > I have a relatively simple django project that I need to get done. > > I'm an experienced software engineer, but I don't have the cycles