Re: Froms new line in forms.py

2011-05-06 Thread Oleg Lomaka
use mark_safearound your html string if you are sure your variables aren't contains html tags On Fri, May 6, 2011 at 4:09 PM, GKR wrote: > > raise forms.ValidationError("Item Code

Re: Django administration page, created a Site -- now what?

2011-05-06 Thread Andy McKay
On 2011-05-06, at 5:25 PM, Boštjan Mejak wrote: > I have created a new Site in my "Django administration" page. How can I use > it now? If I visit the URL that this newly created Site points to, I get a > URLconf error. So what do I need to add to my project's urls.py file? A > newbie here.

Re: Help! Database is locked! Windows developing envrionment, sqlite3, djcelery and djkombu

2011-05-06 Thread Andy McKay
On 2011-05-06, at 7:01 PM, Robert Ray wrote: > I''im using Django 1.3 with Djcelery and Djkombu on Windows7. When I'm > Can anyone give me any help? Thanks in advance! You are using sqlite? Don't use that, use postgresql instead. -- Andy McKay a...@clearwind.ca twitter: @andymckay --

Help! Database is locked! Windows developing envrionment, sqlite3, djcelery and djkombu

2011-05-06 Thread Robert Ray
I''im using Django 1.3 with Djcelery and Djkombu on Windows7. When I'm running a task, I alwalys get the following error saying the database is locked and then the djcelery process quits: [2011-05-07 09:44:05,319: INFO/MainProcess] Got task from broker:

Django administration page, created a Site -- now what?

2011-05-06 Thread Boštjan Mejak
Hello, I have created a new Site in my "Django administration" page. How can I use it now? If I visit the URL that this newly created Site points to, I get a URLconf error. So what do I need to add to my project's urls.py file? A newbie here. Please help me on this. Thanks. -- You received this

Re: Get child model class

2011-05-06 Thread Ethan Jucovy
Is your CF base class an abstract base class[1]? If it's not, then your database actually has separate tables for CF, CFI and CFT .. and when you access a `doc.cf` you're really getting the CF model instance, *not* the derived class instance. IIRC if you make CF an abstract base class then this

Re: login using TestCase hangs

2011-05-06 Thread LurkingFrog
Well, after much rummaging I found that enabling autocommit allowed this to run. Still very weird that I only have the error when explicitly running my tests, as opposed to just a standard runserver. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Giving inlined models in a form in admin a default value based on order in form?

2011-05-06 Thread Mike Ryan
Also, you could override the model's save to set the sort_order to (current_max + 1), if you just want to ensure that the newest children are sorted last by default. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: how to use jquery for point of Sale

2011-05-06 Thread AJ
Oh, I can agree with that. I am just saying that the way it was handled by Shawn and GKR...I liked it. -- 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

Re: how to use jquery for point of Sale

2011-05-06 Thread Javier Guerra Giraldez
On Fri, May 6, 2011 at 2:53 PM, AJ wrote: > I am impressed at the maturity of folks around here. Keep up the good work > folks. :) unfortunately, it's still impossible to help the original poster... let's hope he follows Shawn's advice and then come back with better

Re: how to use jquery for point of Sale

2011-05-06 Thread AJ
I am impressed at the maturity of folks around here. Keep up the good work folks. :) -- 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 group, send email

Re: Get child model class

2011-05-06 Thread pbzRPA
Just to clarify your suggestion In [100]: isinstance(x, CFT) Out[100]: False In [101]: isinstance(x, CFI) Out[101]: False In [105]: isinstance(e, CF) Out[105]: True This is not what I am looking for. I want to know to what class the CF primary key points to. So if it's CFT or CFI -- You

Re: Get child model class

2011-05-06 Thread Shawn Milochik
On 05/06/2011 03:32 PM, pbzRPA wrote: I now the isinstance function but that will return the CF class. I want to know the child class of CF for that specific primary key. The isinstance function doesn't return a class. It returns a boolean, based on the class(es) you are inquiring about.

Re: Get child model class

2011-05-06 Thread pbzRPA
I now the isinstance function but that will return the CF class. I want to know the child class of CF for that specific primary key. On May 6, 9:30 pm, Shawn Milochik wrote: > This might work: > > http://docs.python.org/library/functions.html#isinstance -- You received

Re: Get child model class

2011-05-06 Thread Shawn Milochik
This might work: http://docs.python.org/library/functions.html#isinstance -- 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 group, send email to

Get child model class

2011-05-06 Thread pbzRPA
Hi, I am not sure if this is possible but it would really help if it is. I have 4 classes class CF(models.Model): class CFT(CF): data = models.CharField(max_length=20) class CFI(CF): data = models.IntegerField() class Doc(models.Model): name = models.CharField(max_length

Re: Django password reset modification

2011-05-06 Thread Andre Terra
What you *can* do is e-mail the user with a link to reactivate his password, possibly requesting that he gives the right reply to a secret question. It's a good compromise between ease and security. On Fri, May 6, 2011 at 2:01 PM, DrBloodmoney wrote: > On Fri, May 6,

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread AJ
I am not aware what 'relations' can do or if there was anything like 'relations' let alone 'GenericRelations' :) What does the Sum('vote') done? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Problem in Configuring the database

2011-05-06 Thread Stuart MacKay
If you search for the error code 2002 the most likely cause is that the MySQL server is not running. However you also mention that you are running VMWare - I presume this is where the database server is running. Are you trying to connect to the database from another system, i.e. windows ? I

Re: Problem in Configuring the database

2011-05-06 Thread rahul raj
On Fri, May 6, 2011 at 1:45 PM, r_bloodlife wrote: > Hello, > I'm a beginner trying to build an application.. > please help in correcting these errors.. > I'm Confused, whether to use "MySql" or "Sqllite3" > > > "rahul@linux-cgdq:~/myproject/prj> ls -l > total 36 >

How to programatically define Site in Admin

2011-05-06 Thread Juergen Schackmann
Hi all, I do have various models with ForeignKey(Site). These models should be managed through Admin. However, I would like to determine the current site based on the URL (which basically means it needs to be defined in the view based on the request object). However, he current default

Re: Django password reset modification

2011-05-06 Thread DrBloodmoney
On Fri, May 6, 2011 at 12:36 AM, Phui-Hock wrote: > On May 6, 4:22 am, Shawn Milochik wrote: >> This is a bad idea for multiple reasons. Don't do it. > > Huh, care to explain, please? Please Please Please do not send plain text passwords via email.

Re: Giving inlined models in a form in admin a default value based on order in form?

2011-05-06 Thread Mike Ryan
I On May 6, 1:05 pm, Thomas Weholt wrote: > I've inlined a model so that when I add a new object of the parent > model ( for the inlined model ) I can add child model instances in the > same form, all done in admin.py. Standard stuff actually. But each > child object has

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread Jason Culverhouse
On May 6, 2011, at 8:35 AM, Shawn Milochik wrote: > Sorry, I was going off of your pasted code. > > Sounds like this could be a case for annotate. > http://docs.djangoproject.com/en/1.3/ref/models/querysets/#annotate > > I recommend reading this whole page, along with the two prerequisite

Re: how to use jquery for point of Sale

2011-05-06 Thread Shawn Milochik
On 05/06/2011 11:50 AM, GKR wrote: sorry for that please help me i wanted to add a table and a input text for the purpose of Point Of Sale. So that the id when entered in the textbox will add the item onto the table with other values like rates etc for billing. how can i implement this..

Re: how to use jquery for point of Sale

2011-05-06 Thread Shawn Milochik
On 05/06/2011 11:52 AM, Jacob Kaplan-Moss wrote: On Fri, May 6, 2011 at 10:21 AM, Shawn Milochik wrote: How to ask an actual question so maybe someone can answer it. Shawn, that's uncalled-for. I'm super-impressed with how much work Yeah, you're right, of course. I just

Re: Using the Django Admin to change a password.

2011-05-06 Thread Aaron Fay
I was getting this error also, the tickets suggested I had a custom User proxy model or something, when in fact I didn't. What I _had_ done was commented out the admin.autodiscover() in my urls and manually registered the django.contrib.auth.models.User model manually. Using

Re: how to use jquery for point of Sale

2011-05-06 Thread Jacob Kaplan-Moss
On Fri, May 6, 2011 at 10:21 AM, Shawn Milochik wrote: > How to ask an actual question so maybe someone can answer it. Shawn, that's uncalled-for. I'm super-impressed with how much work you're putting into answer people's questions here, and I really do appreciate it. But

Re: how to use jquery for point of Sale

2011-05-06 Thread GKR
sorry for that please help me i wanted to add a table and a input text for the purpose of Point Of Sale. So that the id when entered in the textbox will add the item onto the table with other values like rates etc for billing. how can i implement this.. please give me any example to learn.

Re: how to use jquery for point of Sale

2011-05-06 Thread Jacob Kaplan-Moss
On Fri, May 6, 2011 at 10:21 AM, Shawn Milochik wrote: > How to ask an actual question so maybe someone can answer it. Shawn, that's uncalled-for. I'm super-impressed with how much work you're putting into answer people's questions here, and I really do appreciate it. But

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread Shawn Milochik
Sorry, I was going off of your pasted code. Sounds like this could be a case for annotate. http://docs.djangoproject.com/en/1.3/ref/models/querysets/#annotate I recommend reading this whole page, along with the two prerequisite pages called for at the top. It'll help a lot. -- You received

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread AJ
Appreciate your response, Shawn. I am a newbie and struggling. Yea, but that is 'latest'. I need ascending descending order by score/votes. Can't seem to figure that one out. That would go in the else part. By default in my app, I want the comments to be sorted by vote/score. else:#This

Re: Getting Django admin to display new autoincremented values in primary key model forms

2011-05-06 Thread wilbur
With my current setup, the autoincrement variable set in postgresql is visible in the Django admin as "Sample_ID", with an empty form field. The user can't possibly know what the next value in the sequence should be, so I'm wondering how to deal with the field, as it is Not NULL, and any attempt

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread Shawn Milochik
You could probably sort ascending, take a subset, then reverse the search. Something like this: | .order_by('created_datetime', 'modified_datetime')[:100].reverse()| -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: how to use jquery for point of Sale

2011-05-06 Thread Shawn Milochik
On 05/06/2011 11:19 AM, GKR wrote: how to use jquery for point of Sale How to ask an actual question so maybe someone can answer it. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

how to use jquery for point of Sale

2011-05-06 Thread GKR
how to use jquery for point of Sale -- 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 group, send email to django-users+unsubscr...@googlegroups.com.

Re: Problem in Configuring the database

2011-05-06 Thread Stuart MacKay
It looks like a connection cannot be made to the MySQL database server. If you are just starting out with Django I would suggest that you use sqlite - it is really easy to work with (get the firefox plugin, https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/) and will do all the

Re: Best practice for async task in django?

2011-05-06 Thread Brian Bouterse
AMQP is not too heavy weight for me. +1 for Celery and RabbitMQ. Brian 2011/5/6 λq > Thanks guys. > > Is AMQP a bit too heavy weight? > > Besides celery, are there any realworld in-production usage of > Django+ZeroMQ? > > Is django-ztask stable? > > On Fri, May 6, 2011 at

Re: Form hidden filed for foreign key - validation error

2011-05-06 Thread Boris Tomic
I am outputting the field but I am using javascript to populate its value attribute. Maybe there is some difference from default behavior for empty value. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Best practice for async task in django?

2011-05-06 Thread λq
Thanks guys. Is AMQP a bit too heavy weight? Besides celery, are there any realworld in-production usage of Django+ZeroMQ? Is django-ztask stable? On Fri, May 6, 2011 at 8:44 PM, Shawn Milochik wrote: > I throw in my +1 for Celery and/or django-celery, plus Rabbit MQ. > >

Froms new line in forms.py

2011-05-06 Thread GKR
raise forms.ValidationError("Item Code [" + fieldrec.barcode_id + "] already exists. [" + fieldrec.i_name + " -- " + str(fieldrec.i_size) + "(ml) -- Rs." + str(fieldrec.i_price) + " -- Last Updated On: " + lud.strftime("%d/%m/%Y") +"]") in forms.py gives output as

Re: Email app is breaking long lines, any fix?

2011-05-06 Thread John Crawford
> The only encoding that isn;t going to wrap is charset="us-ascii" Actually, looking at the resulting file, it *does* say it's charset="us-ascii". > An email client would read "=\r\n" as a soft line break, and remove it > when displaying the message. I tried cutting/pasting the text, and

AW: Problem in Configuring the database

2011-05-06 Thread Szabo, Patrick (LNG-VIE)
Hi, Well, are u using a MySQL database or sqilite ?! Of course that's what it depends on wether to use mysql oder sqlite driver. Mabe you could give us a little more information about your DB cheers . . . . . . . . . . . . . . . . . . . . . . . . . . Patrick Szabo XSLT Developer LexisNexis

Re: Best practice for async task in django?

2011-05-06 Thread Shawn Milochik
I throw in my +1 for Celery and/or django-celery, plus Rabbit MQ. However, if you want to try something else that's growing in popularity, check out ZeroMQ. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Problem in Configuring the database

2011-05-06 Thread r_bloodlife
Hello, I'm a beginner trying to build an application.. please help in correcting these errors.. I'm Confused, whether to use "MySql" or "Sqllite3" "rahul@linux-cgdq:~/myproject/prj> ls -l total 36 -rw-r--r-- 1 rahul users 148 2011-05-04 23:36 current_datetime.py -rw-r--r-- 1 rahul users0

Annotate and then filter

2011-05-06 Thread nexus
I've posted a question in SO about django, any help will be appreciated. arye http://stackoverflow.com/q/5901127/435019 -- 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

Re: Makemessages Multiline

2011-05-06 Thread momo2k
No one? -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this

Re: Best practice for async task in django?

2011-05-06 Thread Tom Evans
2011/5/6 λq : > Hi guys, > > We have a django product running, one of the view is to track each > request of news and write to MySQL, so when user grows the track > read/write became heavy and it may take a while for the user to get a > response. So we are thinking about

Giving inlined models in a form in admin a default value based on order in form?

2011-05-06 Thread Thomas Weholt
I've inlined a model so that when I add a new object of the parent model ( for the inlined model ) I can add child model instances in the same form, all done in admin.py. Standard stuff actually. But each child object has a sort_order-field with default value = 1. I'd like to have that default

Re: Best practice for async task in django?

2011-05-06 Thread Thomas Weholt
Celery/django-celery. My best tips :-) Thomas 2011/5/6 λq : > Hi guys, > > We have a django product running, one of the view is to track each > request of news and write to MySQL, so when user grows the track > read/write became heavy and it may take a while for the user to

Re: Best practice for async task in django?

2011-05-06 Thread Masklinn
On 2011-05-06, at 12:20 , λq wrote: > Hi guys, > > We have a django product running, one of the view is to track each > request of news and write to MySQL, so when user grows the track > read/write became heavy and it may take a while for the user to get a > response. So we are thinking about

Re: Best practice for async task in django?

2011-05-06 Thread Kenny Meyer
Look at the Celery project ( http://celeryproject.org/ ) to be sure it fits your needs. You can easily integrate with Django by using https://github.com/ask/django-celery . You could also use a signal, listening for a request_finished, which will run the task inside a Thread. Here's a concrete

Best practice for async task in django?

2011-05-06 Thread λq
Hi guys, We have a django product running, one of the view is to track each request of news and write to MySQL, so when user grows the track read/write became heavy and it may take a while for the user to get a response. So we are thinking about something like async worker process to do the MySQL

Re: Form hidden filed for foreign key - validation error

2011-05-06 Thread Tom Evans
On Tue, May 3, 2011 at 11:16 PM, Boris Tomic wrote: > I have added (required=False) to field: >> contactid = ModelChoiceField(queryset=Contact.objects.all(), >> widget=HiddenInput()) >> > > so now I have: > contactid = ModelChoiceField(queryset=Contact.objects.all(), >

comments for pinax social

2011-05-06 Thread LIU Liang
I set up a social with pinax. In the topics of tribe, I want to add the notification for the reply of a comment. But can't find the place to add code. In the template of topic.html, I find that the comment is loan as a templatetags of threadcomment. don't know how to do ; ( -- You received this

Re: How to send notification when reply to a comment?

2011-05-06 Thread LIU Liang
I am using the pinax template social. In this social, there already exist the views and templates of comment. But as the structure is too complete, I don't know where to add the code to send notification when reply a comment in a tribe. On May 5, 7:41 pm, Shawn Milochik

Re: Email app is breaking long lines, any fix?

2011-05-06 Thread Tom Evans
On Fri, May 6, 2011 at 5:33 AM, Jason Culverhouse wrote: > > > The answer is no, it it the underlying python email.MIMEText object that is > performing the encoding > The only encoding that isn;t going to wrap is charset="us-ascii" > >

Re: Error: No module named messages.

2011-05-06 Thread Jacob Scherffenberg
Solved it. Found something called pip that installs pythons packages. thanks for your answers On May 5, 9:34 pm, Jacob Scherffenberg wrote: > Cool, but what folder should i put, the content of that download into, > found something similar. > but im not quite sure which

Re: not able to use editable=True or false in forms.CharField()

2011-05-06 Thread Oleg Lomaka
I'm not sure you need to output a static value that user can't modify in a form field, but if you still need it... some_field = forms.CharField(widget=forms.TextInput(attrs={'readonly': True})) or if you need hidden value some_field = forms.CharField(widget=forms.HiddenInput) On Fri, May 6,

ANN : any2any, serializers & deserializers for Django

2011-05-06 Thread sebastien piquemal
Hi all ! I am pleased to announce that I have finally released a piece of code I begun to write a while ago, ... It is a python library called any2any, which helps to write casts operations (from one python instance, to another of a different type). It all started with Django serializations and