newbie django hosting question

2012-03-12 Thread NENAD CIKIC
I now need to put on web the small project i have developed. To test and to skill me on linux, I have created virtualbox ubuntu VM and deployed the project and used nginx to serve it (all from scratch). May someone provide me clarification on the following: - what is the difference between "django

Re: save() creates new entry instead of updating the passed on as instance

2012-03-12 Thread Peter of the Norse
There are some issues with the code. First, entry.id = entry_id is redundant. It might even be the cause of the new Entry. https://docs.djangoproject.com/en/dev/ref/models/instances/#how-django-knows-to-update-vs-insert Second, the best way to update from a form and code at the same time is to do

Re: Why '&' is breaking Django CharField(python strings) into parts?

2012-03-12 Thread Nikhil Verma
Thanks On Tue, Mar 13, 2012 at 3:38 AM, ajohnston wrote: > > Is this a good approach ? >> >> > > Yes, that is a better approach. I was going to suggest that earlier, but > only now had time to post. > > -- > You received this message because you are subscribed to the Google Groups > "Django user

Django deployment practices -- do people use setup.py?

2012-03-12 Thread Tom Eastman
Hey guys, I'm looking for deployment best practices for Django projects. Google searches seem to show countless numbers of them, many of them somewhat contradictory :-) So as a simple discussion point: I'm curious to know if lots of people use setup.py to deploy a django project? That'd mean setu

Re: Why '&' is breaking Django CharField(python strings) into parts?

2012-03-12 Thread ajohnston
> Is this a good approach ? > > Yes, that is a better approach. I was going to suggest that earlier, but only now had time to post. -- 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.goog

Re: "Dynamyc" modells

2012-03-12 Thread Ervin Hegedüs
Hello, 2012.03.12. 20:48, "Shawn Milochik" ezt írta: > > On 03/12/2012 03:34 PM, Ervin Hegedüs wrote: >> >> The main problem is the PromoList is _dynamyc_ - it means all >> administrator on admin site should add new PromoList, without me >> :), so I can't derivate all subclass in code... >> > > Y

Re: response and post in django

2012-03-12 Thread Bill Freeman
Yes. urlopen returns a response object. If you stick something in the data argument it does a POST, otherwise a GET. You are responsible for urlencodeing any query parameters in the url passed in. The response has things like a code attribute, and I forget whether you just call read() on it or

Re: response and post in django

2012-03-12 Thread hack
Oh, it looks like when you do a urlopen the return object is a response. On Monday, March 12, 2012 2:57:20 PM UTC-4, ke1g wrote: > > The straightforward thing is to use urllib2. The tricky thing is that > the thread that got the post from them in the first place will be > blocked waiting for th

Re: response and post in django

2012-03-12 Thread hack
Yes, I could not agree more on spotty quality. The paypal instructions are below. See # 3. I'm checking out urllib2 now. I don't see a way of obtaining a response. Co n s t r u c t i n g Yo u r P o s tb a c k Use these guidelines for constructing your postback to PayPal:. 1. Your postb

Re: response and post in django

2012-03-12 Thread Bill Freeman
urllib2 uses urllib and httplib under the hood. There all part of the standard python install. Yeah the docs may say it's in the body of the response, but is that your response to them, or the response to some request you have to further make to them. This sounds familiar. It may or may not hav

Re: "Dynamyc" modells

2012-03-12 Thread Shawn Milochik
On 03/12/2012 03:34 PM, Ervin Hegedüs wrote: The main problem is the PromoList is _dynamyc_ - it means all administrator on admin site should add new PromoList, without me :), so I can't derivate all subclass in code... You can't dynamically create database tables on the fly. That would requi

Re: response and post in django

2012-03-12 Thread hack
Yea, the docs say its in the body of the response. I'll try the lib you suggest. I was also taking a look at the httplib page as well. Thanks. On Monday, March 12, 2012 2:57:20 PM UTC-4, ke1g wrote: > > The straightforward thing is to use urllib2. The tricky thing is that > the thread that

Re: "Dynamyc" modells

2012-03-12 Thread Ervin Hegedüs
Hello, thanks for the reply. On Mon, Mar 12, 2012 at 03:20:10PM -0400, Shawn Milochik wrote: > First, I would avoid using the word 'list' for describing anything > in your own data, since it's a Python built-in. Maybe CodeList or > PromoList or something, if they're going to be promotion codes.

Re: "Dynamyc" modells

2012-03-12 Thread Shawn Milochik
First, I would avoid using the word 'list' for describing anything in your own data, since it's a Python built-in. Maybe CodeList or PromoList or something, if they're going to be promotion codes. Or maybe just Promo, since a model should be a singular name, and each instance of your model will

"Dynamyc" modells

2012-03-12 Thread airween
Hello, I don't know how can I tell you my question :) There are many lists - lists contains items (in this case those items are promotion codes for marketing agencies, but it doesn't matter). I need (I want) to store every lists in different table. I can make a List model, which describes name

Re: Why '&' is breaking Django CharField(python strings) into parts?

2012-03-12 Thread Nikhil Verma
Thnaks yati i solved the problem by comparing it with id instead of title which is the primary key of that Interview Table. def get_interview_type(request): i = None id = request.GET['id'] try: i = Interview.objects.get(id=id) if i.interview_type == "Time Series":

Re: response and post in django

2012-03-12 Thread Bill Freeman
The straightforward thing is to use urllib2. The tricky thing is that the thread that got the post from them in the first place will be blocked waiting for their response. But are you understanding the API correctly? I would expect the "VERIFIED" to either be in their POST to your listener (to i

Re: how to use Django ORM in standalone script

2012-03-12 Thread Bill Freeman
I would: 1. Write the script as a manage.py command. 2. Duplicate the Django install on the other machine (or at least enough of it to cover the models that you need), making any settings changes needed to access the correct DB (i.e.; if you're using "localhost" to access the DB in your original

response and post in django

2012-03-12 Thread hack
I read the paypal ipn docs, and think I understand the procedure for processing payments. The only issue I have is that I am not 100% certain how to do this via django. Basically you setup a listener http://mysite.com/mylistener/, and when someone makes a payment paypal responds by notifying

Re: overlay feature in django

2012-03-12 Thread donarb
My guess is that he means a lightbox-like popup form, especially when he mentions login and registrations. Don On Mar 12, 12:21 am, kenneth gonsalves wrote: > On Mon, 2012-03-12 at 00:14 -0700, Derek wrote: > > That is not an example or definition of "overlaying"; just a laundry > > list of temp

Re: Initial values for inline form in admin

2012-03-12 Thread FraMazz
Sorry, Copy and paste problem. Please see http://groups.google.com/forum/?fromgroups#!topic/django-users/xOdoBYkLnGY -- 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/djang

Re: Batch processing in parallel (celery)

2012-03-12 Thread Shawn Milochik
You can just use Celery. It's very simple if you use django-celery and MongoDB as the broker. Next, you could make sure you're using the ORM effectively. Use select_related where possible, avoid doing any querying in loops, pre-pulling data from the database and storing it in memory (in a dic

how to use Django ORM in standalone script

2012-03-12 Thread H.T. Wei
Hi, If anyone can suggest what is the best way to use Django ORM in standalone script for accessing database? The "standalone script" is located on the server different from Django server but access the same database server. Thanks in advance! Steve -- " stay hungry, stay foolish" -- You rece

Re: User.objects.get() doesn't return anything in unit test.

2012-03-12 Thread RM
Putting the correct view in the c.post() method worked. Thanks! -- 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+unsub

Batch processing in parallel (celery)

2012-03-12 Thread Thomas Guettler
Hi, there is a background job which uses the django ORM and takes too long. How to speed up the job? It processes files, and updates the database. It would be easy to cut the job into peaces, since the files can be processed in parallel random order. I know that I could use celery, but it is ov

Re: Bump to Django 1.4rc1 causes near doubling of test run time

2012-03-12 Thread Philip Kimmey
Sorry - I was going to try and reproduce this result with a little bit more rigor, but didn't have time. My test environment is running against SQLite & Django's file based cache system. Frankly, I probably should have done more side-by-side testing of the two different revs before submitting it

django custom primary key problem.

2012-03-12 Thread Morris
Hi all, I have a custom primary key, but I can NOT get data from db. === **models.py** class BuildRecord(models.Model): sku_name = models.CharField(max_length=600, primary_key=True, db_column='SKU_name') download_link = models.CharField(max_length=1500, blank=True)

Re: overlay feature in django

2012-03-12 Thread Derek
So much for the Zen of Python! :D On Mar 12, 9:21 am, kenneth gonsalves wrote: > On Mon, 2012-03-12 at 00:14 -0700, Derek wrote: > > That is not an example or definition of "overlaying"; just a laundry > > list of templates. > > I would take a wild guess that he means inheritance ;-) > -- > regar

Re: Why '&' is breaking Django CharField(python strings) into parts?

2012-03-12 Thread yati sagade
In an HTTP request, the query parameters are separated by the ampersand. A form that has the fields, say, name and email, when submitted via GET, the query string will look like "name=myname&email=s...@email.com". Since your html is using literal '&', Django(and any other request parser) will think

Re: django facebook api

2012-03-12 Thread Andre Terra
Suresh, If you want to get any answers, you must first learn how to make the questions. Please follow the guidelines in this wiki article before posting to the mailing list: https://code.djangoproject.com/wiki/UsingTheMailingList Cheers, AT On Thu, Mar 8, 2012 at 9:24 AM, suresh dokania wrot

Re: Why can't forms access the request object?

2012-03-12 Thread Tom Evans
On Mon, Mar 12, 2012 at 12:34 PM, Matt Schinckel wrote: > You are mixing up views and forms. The OP was asking about forms, not views. > > Personally, I'm starting to hit more and more cases where I would like the > form to be able to access the request (and associated data). For instance, > being

Re: Why can't forms access the request object?

2012-03-12 Thread Matt Schinckel
You are mixing up views and forms. The OP was asking about forms, not views. Personally, I'm starting to hit more and more cases where I would like the form to be able to access the request (and associated data). For instance, being able to limit the queryset of choices for a related field, depe

unique_together where one of the fields may be NULL

2012-03-12 Thread ALJ
I'm struggling to get my models to enforce unique_together. We have the model below where it is possible to have a budget for a whole group (ie there is no break down for a particular sales rep) and therefore the sales_rep* *field will be left empty. However, it it possible to enter two identic

Initial value in inline form depending on foreign key value

2012-03-12 Thread FraMazz
Hi all! I' m quite new to django. I googled a bit around but was not able to find an anser to my problem. I have two models: class Patient(models.Model): ... many fields ... class Checkup(models.Model): ... many fields ... patient = models.ForeignKey(Patient, related_name='checkups') al

Re: problem with south and UTC

2012-03-12 Thread Chris Streeter
Currently, the fix seems to be to use the development version of South which fixes it in most cases. See http://south.aeracode.org/ticket/1012 On Sun, Mar 11, 2012 at 20:51, Kevin Anthony wrote: > i'm having a problem with south, i'm trying to migrate to USE_TZ > However i get this error: > (I'm

Initial values for inline form in admin

2012-03-12 Thread FraMazz
Hi all! I have two models class Paziente(models.Model): ... many fields ... class Visita(models.Model): paziente = models.ForeignKey(Paziente, related_name='visite') fumo = models.CharField(max_length=1, choices=SCELTE_FUMO, default='N') ... many fields... -- You received this message bec

Re: problem with south and UTC

2012-03-12 Thread Joel Goldstick
On Sun, Mar 11, 2012 at 11:51 PM, Kevin Anthony wrote: > i'm having a problem with south, i'm trying to migrate to USE_TZ > However i get this error: > (I'm using 1.4c1 and south 0.7.3) > > ./manage.py schemamigration main --auto > Traceback (most recent call last): >   File "./manage.py", line 9,

Re: output form html

2012-03-12 Thread Joel Goldstick
On Sat, Mar 10, 2012 at 9:36 AM, backdoc wrote: > More info. > > I found that the problem is that my "MultipleChoiceField" and > "ChoiceField" fields are not behaving.  As I added additional fields, > such as CharField, it became more clear what was happening. > > My MultipleChoiceField is bei

Re: built-in-views trouble

2012-03-12 Thread Joel Goldstick
On Mon, Mar 12, 2012 at 4:04 AM, ajohnston wrote: > 1. >> >> Exception Type: ViewDoesNotExist >> Exception Value:Tried logout_user in module myapp.views. Error was: >> 'module' object has no attribute 'logout_user' > >  2. >> >> Here is my current url setting: >> url(r'^accounts/password_reset/$',

Re: overlay feature in django

2012-03-12 Thread Joel Goldstick
On Mon, Mar 12, 2012 at 3:21 AM, kenneth gonsalves wrote: > On Mon, 2012-03-12 at 00:14 -0700, Derek wrote: >> That is not an example or definition of "overlaying"; just a laundry >> list of templates. > > I would take a wild guess that he means inheritance ;-) > -- > regards > Kenneth Gonsalves >

Why '&' is breaking Django CharField(python strings) into parts?

2012-03-12 Thread Nikhil Verma
I have a function in views.py def get_interview_type(request): i = None title = request.GET['title'] #Here the title becomes different try: i = Interview.objects.get(title=title) #it looks for that dropdown value #Erro

Re: built-in-views trouble

2012-03-12 Thread ajohnston
1. > Exception Type: ViewDoesNotExist > Exception Value:Tried logout_user in module myapp.views. Error was: > 'module' object has no attribute 'logout_user' > 2. > Here is my current url setting: > url(r'^accounts/password_reset/$', > 'django.contrib.auth.views.password_reset', name='password_

Re: Why can't forms access the request object?

2012-03-12 Thread Sergiy Khohlov
Shacker, Django migrates from function based view to the class based. It will be nice to catch a good resource about class view usage because official documentation is very poor. 2012/3/12 shacker : > Thanks for the explanations Masklinn and dstuffte - this makes a lot more > sense now. I guess

Re: overlay feature in django

2012-03-12 Thread kenneth gonsalves
On Mon, 2012-03-12 at 00:14 -0700, Derek wrote: > That is not an example or definition of "overlaying"; just a laundry > list of templates. I would take a wild guess that he means inheritance ;-) -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google

Re: overlay feature in django

2012-03-12 Thread Derek
Hi That is not an example or definition of "overlaying"; just a laundry list of templates. On Mar 9, 4:29 pm, Bhujang Bhagas wrote: > Hi, > > django templates say, login or registration html template. > > Thanks.. > --- > -