Re: A lots of foreign keys - Django Admin

2012-09-26 Thread Jani Tiainen
Your query clearly indicates that you're still doing foreign keys against TITLE fields, which are strings. So something is definitely still incorrect in your models. Make sure that your foreign keys really point to ID field (basically that is leaving out 26.9.2012 9:24, rentgeeen kirjoitti:

ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-26 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 2.0.1 mxODBC Connect is our commercially supported client-server product for

Django-cart. How to run method add_to_cart?

2012-09-26 Thread enemybass
https://github.com/bmentges/django-cart *I'm* a total *newbie* to *Django. *How to run method *add_to_car*t? In template I would have button "add to cart". Thanks. def add_to_cart(request, product_id, quantity): product = Product.objects.get(id=product_id) cart = Cart(request) cart.

GeoDjango shapefiles and maps

2012-09-26 Thread Coulson Thabo Kgathi
Hello guys i realy need to create an app that presents data on maps, by placing markers on maps to show locations of places. i want to use geodjango WITHOUT THE INTERNET, but i am struggling to do this, I have just read a document about Spatializing you data with PosyGIS, GeoDjango, and OpenLay

How to add content to the FileField associated with an object

2012-09-26 Thread godlike
File.save(*name*, *content*[, *save=True*]) Django document says if I provide a same filename to the attribute name,the existing file will not be replaced , but will create a new file and update the object to point to it. How can I add some content to the existing file

Re: Pip type error.

2012-09-26 Thread Brian Peiris
Thanks John, that was useful. This happens because powershell outputs UTF-16 by default. Another way to fix it is by using the out-file command with an ascii encoding specified: pip freeze | out-file -enc ascii requirements.txt On Sunday, March 11, 2012 4:17:59 AM UTC-4, John W. wrote: > > I kn

Re: Inheritance and default value

2012-09-26 Thread winniehell
> Dummy.__dict__.update({"myfield":42}) Thanks for the answer! The problem is that my default value is a callable which queries stuff from the database. So I can't assign the value once. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Django Form with initial DateTime Value is recognized as changed

2012-09-26 Thread Stefan Winkler
class Test(models.Model): datum = models.DateTimeField() text = models.CharField(max_length=255) class TestForm(ModelForm): class Meta: model = Test Rendering the form with form = TestForm(initial={'datum':datetime.datetime(2012, 8, 21, 18, 0, tzinfo=)) looks all good. Djang

django scrolling script

2012-09-26 Thread MrF16
Hello, I need a script to display content from my database in a scrolling list on my website. Any links? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/1U

Upgraded to Django 1.4.1 and now I have one database connection

2012-09-26 Thread Ricardo Grizonic
Hey everyone, I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for every new thread, a new database connection to postgresql is created. I'm using: from django.db import connection which, according to the docs, should get a global connection that would be used by all the thr

Background Programs in Django

2012-09-26 Thread surya
I have to use RSS/ Atom feeds of blogs in my Django app. So, I thought to use Google Feed API. All the API provides is a BIG list of feeds.. If I need a post (say no 25), I need to GET the whole feeds and search every time which is redundant. *So, I am thinking to run a background program which

Re: ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-26 Thread winniehell
We had a little private discussion about this. Is this list meant to be for product announcements? I personally don't like to get product announcements on mailing lists because I'm in most cases not interested in the offered products. -- You received this message because you are subscribed to the

Re: Upgraded to Django 1.4.1 and now I have one database connection

2012-09-26 Thread Ricardo Grizonic
The subject should be: "Upgraded to Django 1.4.1 and now I have one database connection per thread" sorry for that! :) On Wednesday, 26 September 2012 13:34:13 UTC+2, Ricardo Grizonic wrote: > > Hey everyone, > > I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for > every ne

I am in trouble

2012-09-26 Thread hetwen
hello every, When I configure apache,mod_pyton and mod_pywebsocket on windows7,some errors occurred,this is a part of my httpd.conf, AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On test.py is test file ,but it does not work test.py: " from mod_python impor

Re: I am in trouble

2012-09-26 Thread Steve McConville
Instead of > test.py: > > " > from mod_python import apache >def index(reg): > retutn "test successful!" > " > Try: " from mod_python import apache def index(reg): return "test successful!" " Note that there is no space preceding the 'def'. Indentation is meaningful in p

Re: I am in trouble

2012-09-26 Thread Gerald Klein
Indentation Error, see if you can turn on hidden characters in your editor and find out if you have exactly the correct amount of spaces for each indented section. Some time it looks right but it is not. It also looks like your def statement should go to the left margin and not be indented from the

Re: I am in trouble

2012-09-26 Thread Jirka Vejrazka
Others have pointed at the indentation error, so I'll just add that mod_python is no longer supported and recommended - you should use mod_wsgi or similar supported module if possible at all. HTH Jirka -- You received this message because you are subscribed to the Google Groups "Django u

Re: A lots of foreign keys - Django Admin

2012-09-26 Thread rentgeeen
I am sorry I post the old one here is the update: Screenshot: http://cl.ly/image/2A3z1q2l053l Screenshot of Admin clicking on TYPES = 60 seconds to load this is the query http://cl.ly/image/1G1S0c0r302s if I remove from admin "list_display class ProjectAdmin(admin.ModelAdmin): list_display =

Re: A lots of foreign keys - Django Admin

2012-09-26 Thread rentgeeen
Here is the SQL again it overlap in previous post dont know why it posted twice: *SELECT* `auto_type`.`id`, `auto_type`.`client_id`, `auto_type`.`category_id`, `auto_type`.`subcategory_id`, `auto_type`.`project_id`, `auto_type`.`title`, `auto_client`.`id`, `auto_client`.`title`, `auto_category

Re: A lots of foreign keys - Django Admin

2012-09-26 Thread rentgeeen
If you want I can send you a zip of the project On Wednesday, 26 September 2012 09:34:33 UTC-4, rentgeeen wrote: > > Here is the SQL again it overlap in previous post dont know why it posted > twice: > > *SELECT* `auto_type`.`id`, `auto_type`.`client_id`, > `auto_type`.`category_id`, `auto_type

Re: how to layout a "big" project in django 1.4 - best practices ?

2012-09-26 Thread Michel Thadeu Sabchuk
Hi Guys, > And i want ask about settings.py, if we make the settings become a folder > and put dev.py, prod.py, any step to make manage.py know which one to > load. Seems there is no info about it in the blog. > I often create a settings module like above: settings -->__init__.py -->ba

Re: A lots of foreign keys - Django Admin

2012-09-26 Thread rentgeeen
Here is mysql profiling: Results: Query: http://cl.ly/image/0311392u0Z0S CPU Profile: http://cl.ly/image/2D210h0f1L06 On Wednesday, 26 September 2012 09:38:03 UTC-4, rentgeeen wrote: > > If you want I can send you a zip of the project > > On Wednesday, 26 September 2012 09:34:33 UTC-4, rentg

Re: ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-26 Thread bobhaugen
I like to get open-source project announcements that are relevant to Django, but am not interested in commercial products. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg

Re: A lots of foreign keys - Django Admin

2012-09-26 Thread rentgeeen
Also how can I use "select_related()" for admin? Should I put it in admin.py or settings like a setting or how? thanks On Wednesday, 26 September 2012 10:16:29 UTC-4, rentgeeen wrote: > > Here is mysql profiling: > > Results: > > Query: > > http://cl.ly/image/0311392u0Z0S > > CPU Profile: > > ht

Re: Background Programs in Django

2012-09-26 Thread John DeRosa
There are a number of technologies out there for background asynchronous tasks in Python. They differ on attributes such as how the tasks are managed and administered; the run queues' sophistication (how many, how they're divvied up, whether they can be pinned to servers, etc.), whether the task

Re: A lots of foreign keys - Django Admin

2012-09-26 Thread Tiago Albineli Motta
We had similar problem a few months ago, one join in only two tables (but those two tables were big, very big) we solve the problem denormalizing the table. So everytime we save some row for table1, we update the table2 with a column table1_name_cache. In the list, we display this column. On

Re: Background Programs in Django

2012-09-26 Thread Tiago Albineli Motta
Create a django command to do the job and put it in the crontab On Wednesday, September 26, 2012 9:07:23 AM UTC-3, surya wrote: > > I have to use RSS/ Atom feeds of blogs in my Django app. So, I thought to > use Google Feed API. All the API provides is a BIG list of feeds.. > > If I need a post

Update Services for Django

2012-09-26 Thread Tom
Hi All, Wordpress has something called Update Services, a feature that pings certain web services when content is created or updated. http://codex.wordpress.org/Update_Services Does Django happen to have anything similar? What I'm trying to achieve is a way to tell a remote server that a piece

Re: Update Services for Django

2012-09-26 Thread Ilian Iliev
Hi, in the case of wordpress this is just an XML-RCP call it is used for pingbacks/tracebacks. There is similar implementation in zinnia if I remember correctly. Otherwise you can just create a method that will get/post to specific URL to notify it about the changed content. Greetings, Ilian Ilie

Re: django scrolling script

2012-09-26 Thread creecode
A Google search would yield many results. I think you'll find that this sort of thing is often handled by a library such as jQuery (one of many possibilities). You would use the library as their documentation directs and then supply the data needed from your django project. Toodle-loo

Re: ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-26 Thread creecode
I don't mind the occasional well marked commercial product announcement as long as it's related to django. By well marked I mean something in the subject line that indicates this is an ad or announcement, which this poster did. Thank you! Toodle-l... creecode -- You rece

Re: Using success_url with reverse() in class-based generic view

2012-09-26 Thread Germán
Just for the record. Since Django 1.4, the best way to set up success_url in class-based generic views with url names is: > success_url = reverse_lazy('my_url_name') On Wednesday, September 21, 2011 4:53:56 PM UTC-3, Xavier Ordoquy wrote: > > Hi, > > You can also use get_success_url for that:

Re: Using success_url with reverse() in class-based generic view

2012-09-26 Thread Kurtis Mullins
Sometimes, though, you may need to pass variables to a success url. In that case, I'd use the "get_success_url" method so you can access the 'self' attributes. On Wed, Sep 26, 2012 at 1:32 PM, Germán wrote: > Just for the record. > > Since Django 1.4, the best way to set up success_url in class-

New Project 403 Forbidden Error

2012-09-26 Thread Bestrafung
I have been following these guides to setup Django on a CentOS cPanel server: http://forums.cpanel.net/f5/django-python-cpanel-71229-p2.html#post439009and http://blog.perplexedlabs.com/2008/11/10/setup-python-25-mod_wsgi-and-django-10-on-centos-5-cpanel/. After following those guides everythin

Re: Using email instead of username for registration and login

2012-09-26 Thread Germán
I opted to customize a little. First the backend: from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User class EmailBackend(ModelBackend): """A django.contrib.auth backend that authenticates the user based on its email address instead of the username.

Re: Using success_url with reverse() in class-based generic view

2012-09-26 Thread Germán
Indeed On Wednesday, September 26, 2012 2:45:32 PM UTC-3, Kurtis wrote: > > Sometimes, though, you may need to pass variables to a success url. In > that case, I'd use the "get_success_url" method so you can access the > 'self' attributes. > > On Wed, Sep 26, 2012 at 1:32 PM, Germán > > wrote:

Re: Update Services for Django

2012-09-26 Thread Tom Clark
Hi Ilian, I couldn't find any reference to pingbacks/trackbacks for Django, could you point me in the right direction? :) Many thanks! On 26 September 2012 16:49, Ilian Iliev wrote: > Hi, > > in the case of wordpress this is just an XML-RCP call it is used for > pingbacks/tracebacks. > There

Admin page not showing rows after adding a ForeignKey self to the model

2012-09-26 Thread Olivier Lauret
Hello, Sorry for the beginner's question, but I have a behaviour which looks like a bug to me and wanted to know if someone could advise me on this. *Error* I have added a models.ForeignKey('self', blank=True) to my model and now I cannot see any row in the admin page, even if the filter shows t

Re: Update Services for Django

2012-09-26 Thread Ilian Iliev
Hi Tom, I believe here you can find how the pingback is implemented in zinnia but as you will see the example is not that simple. Consider if you need so complex one or just a get/post to specific URL will be enough. Greetings, Ilian Iliev -- eng. Ilian Iliev Web Software Developer Mobile: +359

Django Tutorial Equivalent to Ruby on Rails Tutorial by Michael Hartl

2012-09-26 Thread Tommy DANGerous
Hello, I've been through several tutorials and looked around quite a bit and haven't really found a solid tutorial that goes through creating a web app in detail that is on par with the Ruby on Rails Tutorial by Michael Hartl. Will you please help a noobie like me and describe some tutorials f

Re: Django Tutorial Equivalent to Ruby on Rails Tutorial by Michael Hartl

2012-09-26 Thread Jonathan Baker
I haven't worked through the RoR tutorial you referenced, but completing http://www.djangobook.com/en/2.0/index.html gave me all of the tools necessary to get projects up and running. hth, Jonathan D. Baker On Wed, Sep 26, 2012 at 1:53 PM, Tommy DANGerous wrote: > Hello, > > I've been through s

Re: Update Services for Django

2012-09-26 Thread Germán
You could create some methods that ping an specific URL. Then you could subscribe/connect to the specific signals associated to what you want to report. On Wednesday, September 26, 2012 12:14:46 PM UTC-3, Tom wrote: > > Hi All, > > Wordpress has something called Update Services, a feature that p

View.py v models.py

2012-09-26 Thread Lachlan Musicman
Hi I was doing some work on a view last night and realised that the code could go into either views.py or as a method on the model. Do people have internal guidelines about when they make something a method on a model rather than a view function? Is there any functional difference apart from the

Re: View.py v models.py

2012-09-26 Thread Javier Guerra Giraldez
On Wed, Sep 26, 2012 at 5:50 PM, Lachlan Musicman wrote: > Do people have internal guidelines about when they make something a > method on a model rather than a view function? if it's not a presentation thing, it probably goes in the model even some presentation things go there, like the __unico

Re: View.py v models.py

2012-09-26 Thread Lachlan Musicman
On Thu, Sep 27, 2012 at 10:59 AM, Javier Guerra Giraldez wrote: > On Wed, Sep 26, 2012 at 5:50 PM, Lachlan Musicman wrote: >> Do people have internal guidelines about when they make something a >> method on a model rather than a view function? > > if it's not a presentation thing, it probably goe

Re: ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-26 Thread Russell Keith-Magee
On Wed, Sep 26, 2012 at 8:11 PM, winniehell wrote: > We had a little private discussion about this. Is this list meant to be > for product announcements? I personally don't like to get product > announcements on mailing lists because I'm in most cases not interested > in the offered products. We

Django Developer, Palo Alto, California

2012-09-26 Thread Chris Streeter
Hello group, My company, Educreations [1], is looking for a full time Django developer. We are looking for extraordinary people who want to make a difference solving immensely challenging problems for an education industry in need of innovative solutions. If you’ve ever wanted to use your technica

syncdb in GeoDjango tutorial

2012-09-26 Thread Guddie
I'm following the GeoDjango tutorial, and when I get to the "Run syncdb" section and I run "python manage.py syncdb", I get the following error: Failed to install index for world.WorldBorder model: function > addgeometrycolumn(un

model field not null

2012-09-26 Thread Jonas Geiregat
Hello, While setting up a new model I'm trying to have a strong data model. One of the requirements is that a certain field cannot be null. lastname = models.CharField( blank=False, default=None,