Re: mark_safe and ValidationError params

2015-02-08 Thread Andrew Pinkham
Thanks for the input, Mike. I actually think the behavior I showed here is a bug, and have started a thread on the developer mailing list to talk about it. https://groups.google.com/d/topic/django-developers/hs1Ikc8Tuuk/discussion Andrew -- You received this message because you are

Modify Installed_Apps settings

2015-02-18 Thread Andrew Pinkham
tings.py, I am given a Python Traceback which ends in: django.db.utils.OperationalError: no such table: override_modelname How may I force the TestCase class to apply the migration file override/migrations/0001_initial.py to the test database? Thanks, Andrew -- You received this mes

Re: Modify Installed_Apps settings

2015-02-18 Thread Andrew Pinkham
Thanks for the info, Joel. However, I'm trying to avoid creating a separate settings file. Any info about how to properly use modify_settings to add to installed apps or how to force the test runner to apply a specific migration would still be appreciated. Thanks, Andrew -- You received

Re: Django 1.7.4, PostgreSQL: Migrate FK to M2M?

2015-02-18 Thread Andrew Pinkham
to prepend a step to the list above: 0. change name on FK field to temporary name But I can't remember why I think that's better than changing the M2M field at the end. I would share the code, but I can't find it at the moment. Sorry about that. Hope that's helpful, Andrew

Re: Sqlite3 to Postgres Migration?

2015-02-19 Thread Andrew Pinkham
e" cannot be cast automatically > to type integer > HINT: Specify a USING expression to perform the conversion. > > How can I apply this hint to make this work? I'm unfamiliar with this error, but I suspect your problem lies in the migration files. What files exist

Re: Modify Installed_Apps settings

2015-02-19 Thread Andrew Pinkham
unmigrated apps) I am also uncertain if this is a good idea, as I'm not clear as to whether TestCase will flush the data in the unexpected table (ie: will tests methods still be isolated?). Any help or ideas welcome. Andrew -- You received this message because you are subscribed to t

Re: Doubt

2015-02-19 Thread Andrew Pinkham
e are a lot of good answers there. I'm sure people on this mailing list will help, but this is really a better place to ask about Django rather than installation problems with virtualenv. I also heartily recommend virtualenv_wrapper. Andrew -- You received this message because you are

Re: Django 1.7.4, PostgreSQL: Migrate FK to M2M?

2015-02-19 Thread Andrew Pinkham
On Feb 19, 2015, at 11:54 AM, Tom Evans wrote: > Django accepts the keyword argument "null" on all fields, but it is > meaningless for an M2M. That is an excellent point. That's what I get for writing this up based on memory late at night. Sorry for the error. Andrew

Re: Sqlite3 to Postgres Migration?

2015-02-20 Thread Andrew Farrell
useful. On Fri, Feb 20, 2015 at 4:55 PM, talex wrote: > Thanks for your helpful comments. > > Andrew, thanks for your migration article at http://afrg.co/updj17/a2 . > It is slightly daunting for me at this point, but I may need to come back > to it later. Your book looks interesting

Re: Python / Django slow ? Deciding my next technological stack

2015-02-24 Thread Andrew Farrell
As Vijay said, most of the performance of a web app (in any framework) is database access. With django, you can use the Django Debug Toolbar or the db.connection.queries

Re: django deployment in a virtual machine.

2015-02-25 Thread Andrew Farrell
Linode and Digital Ocean both have good tutorials on setting up a production deployment o

Re: Can't run django!

2015-03-04 Thread Andrew Farrell
You might see if DEBUG is being set to False in an unexpected location by using the silver searcher (also on windows ) to quickly search for a string in a directory tree. $ ag DEBUG within your a

Re: Future for Django, Jobs, Confused :/

2015-03-04 Thread Andrew Farrell
One thing to keep in mind is that there are more fields using primarily python than using primarily ruby. A company that that does primarily scientific computing in python may not advertise jobs in Django or Flask. However, when they need to build a web interface for something, they will reach for

Re: First time user, can't start project!

2015-03-10 Thread Andrew Farrell
What platform are you on? Does it print out anything? What does running the command `dir` show before and after running `django-admin.py startproject mysite` ? On Tue, Mar 10, 2015 at 12:09 PM, wrote: > Hi! > > I ran the command to get my version and it worked. However when I run: > django-admin

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
Hello Nivin, Could you please hit the "switch to copy-and-paste view" link at the top of the tradeback and copy that? The bottom of a traceback is often the most useful for debugging. Feel free to paste it or relevant code at github gist and send the link if you want to

Re: How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread Andrew Farrell
Based on a brief search but no personal experience, SUDS looks like the best python library for making requests to an existing SOAP server. On Wed, Mar 18, 2015 at 11:16 AM, SHINTO PETER wrote: > How to make request ie GET/POST to soap (windows

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
So it seems like the problem is that you are doing `import http` on line 24 of /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/ branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py rather than `import httplib`. Python2 doesn't have a module in the standard library named `http`, onl

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
Actually, please listen to Guilherme over me; He seems to have correctly spotted the omission. On Wed, Mar 18, 2015 at 11:45 AM, Andrew Farrell wrote: > So it seems like the problem is that you are doing `import http` on line > 24 of /home/akhil/Documents/NIVIN/NIVIN/svn/CrossF

Re: newbie question

2015-03-19 Thread Andrew Farrell
The other commenters are right that reading the tutorial is a good use of your time. https://docs.djangoproject.com/en/1.7/intro/tutorial03/ is the section relevant to your question. On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez wrote: > On Wed, Mar 18, 2015 at 9:41 PM, VMD wrote: >

Re: importing csv data into database

2015-03-31 Thread Andrew Farrell
Hello Sum, There are two approaches you could take. One is to install a plugin like django-import-export and then use it's import functionality. Its been a while since I've done this, but when I did under django-1.4 it Just Worked. This is

Re: Alternatives to Django REST Framework

2015-04-09 Thread Andrew Farrell
Someone I met at the Austin python user group told me they'd built their company's backend using Falcon and were very happy with it. On Thu, Apr 9, 2015 at 7:54 AM, Amit Prahesh wrote: > Hi, > > while Django REST Framework seems wonderful to me, it is a heayweight >

Should squashmigrations produce a migration that could be improved by editing?

2015-04-17 Thread Andrew Farrell
one or should I file a new ticket? This project is currently running python=2.7.9 django==1.7.7 cheers, Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: error logging with nginx and uWSGI

2015-04-23 Thread Andrew Farrell
Hi Larry, What does cd /etc/nginx && ag log Give you? On Thu, Apr 23, 2015 at 1:05 PM, Larry Martell wrote: > This is not really a django question, but I think these are issues > folks here have faced, so I hope someone can help me. > > Prior to now, all the django p

Re: importing csv data into database

2015-04-23 Thread Andrew Farrell
; > > Cheers, > Sum > > > On Wed, Apr 1, 2015 at 1:51 PM, sum abiut wrote: > >> Thanks guys, >> appreciate your help. Yes i am looking to have a form that accepts CSV >> files. I will have a read on the link that you guys have provided and see >> how it goes.

Re: importing csv data into database

2015-04-23 Thread Andrew Farrell
prise', 'fanatical devotion to the pope', and in fact weapons = 'fear', creates a 1-item tuple. On Fri, Apr 24, 2015 at 12:33 AM, Andrew Farrell wrote: > could you replace your function with > def readcsvfile(request): > with open('/var/www/html/webapp/

Re: importing csv data into database

2015-04-25 Thread Andrew Farrell
data=test() > data.PersonID=row[0], > data.FirstName=row[1], > data.LastName=row[2], > data.Address=row[3], > data.save() > return render_to_response('csv_test.html',locals()) > > > > > On

Re: importing csv data into database

2015-04-26 Thread Andrew Farrell
,lastname,address. > Please advise > > > Cheers > > On Sun, Apr 26, 2015 at 2:36 AM, Andrew Farrell > wrote: > >> Ah, I suppose that bit didn't get sent. Google groups only lets mail from >> my old gmail address through and bounces mail from the MIT address I

Re: How to find a view in a complex web application

2015-04-28 Thread Andrew Farrell
If you are asking this question as a developer who wants to know what view to use to affect a page when you know the url, I recommend you install The Silver Searcher , which lets you run $ ag 'some arbitrary text you might find on a page' and it will quickly show you ev

Re: Why so complicated :O??

2015-05-06 Thread Andrew Farrell
Hi Vesko, I might take a look at Harry Perceval's Test Driven Development with Python , which is available for free. Although the book focuses on teaching TDD, it teaches Django along the way and does so by focusing on getting the smallest piece working at a tim

DjangoCon US 2015 Proposals Deadline

2015-05-11 Thread Andrew Pinkham
y> As always, feel free to contact us <https://2015.djangocon.us/contact/>! Submit your proposals soon, and we hope to see you at DjangoCon US! Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Fwd: What is the ideal web server to use with Django?

2015-05-14 Thread Andrew Farrell
orn on port 8000 And then you can also get the postgres database working, first by being able to connect to it with manage.py dbshell, then by running migrations and the built-in webserver and then the full stack. Welcome aboard the django train, Andrew -- Forwarded message -- From

Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread Andrew Farrell
Hello Florian, If you are having trouble installing python without root permissions, you should consider installing the miniconda distribution of python that is used in the scientific computing community. Assuming you are on a linux server, you can do this

Also: installing postgres w/o root Re: django-admin.py --> permission denied (shared server deployment)

2015-05-19 Thread Andrew Farrell
7;PORT': '5432', } } Then you can set up your tables with python manage.py migrate You can also log in to the database with python manage.py dbshell On Tue, May 19, 2015 at 11:50 AM, Andrew Farrell wrote: > Hello Florian, > > If you are having trouble installing python

How do I patch django.core.mail.send_mail for testing?

2015-05-19 Thread Andrew Farrell
test_patching_mail_works(self): with patch('django.core.mail.send_mail') as mocked_send_mail: from django.core.mail import send_mail #This test actually fails too if I have the import outside the mock context send_mail(subject="foo", message="bar&qu

Re: can i use sqlite for big project?

2015-06-26 Thread Andrew Farrell
Arindam, Here are two routes you should consider: 1) Develop your site using SQLite until you get to the point of needing something more performant under heavy loads, then switch over. By the time you switch, you will have developed a deeper understanding of Django and also will have demonstrated

Re: Python & Django.

2015-07-05 Thread Andrew Farrell
Could you please paste a reply with: - The operating system you are running on - The output of the command "pip freeze" - The commands you are entering to try to run django on python 3.4 and the output of those commands ? On Sun, Jul 5, 2015 at 8:44 PM, Steve Burrus wrote: > > *"Are you getting

Re: What is _set and where is it documented?

2015-07-13 Thread Andrew Farrell
Hello, One relevant bit of the documentation for what you are asking is following-relationships-backward . On Mon, Jul 13, 2015 at 3:13 PM, wrote: > I've been working through "Writing Your first Django A

Re: Your opinion on which technologies to use when building web applications

2014-07-23 Thread Andrew Farrell
1) You never linked to the survey. 2) I hope when you do link to the survey, your data collection includes the fact that it comes from people subscribed to django-users@googlegroups.com and therefore comes from people who value the approach django takes. On Wed, Jul 23, 2014 at 10:05 AM, Master T

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Andrew Farrell
Note: this is much better documented at https://docs.djangoproject.com/en/dev/howto/custom-management-commands/ You want to move this file to the management.commands module. I don't know what the equivalent commands are on windows, but on linux this would be. 1) `cd myapp; mkdir management`: Withi

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Andrew Farrell
oh, and you should then be able to run the command by doing python manage.py myapp mycommand and see the 'mycommand' in the list of commands printed by `python manage.py help` On Wed, Aug 13, 2014 at 10:36 AM, Andrew Farrell wrote: > Note: this is much better document

Re: Django app deployment step-by-step

2014-08-13 Thread Andrew Farrell
I've tried to get django running without shell access and it was a headache. You can get a good server with shell access for $10. Unless you are far smarter than I, you will almost certainly waste more than hours trying to get django to work without shell access. With two of those hours, you would

Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-18 Thread Andrew Koller
I'm having issues getting the dev server to work. After I installed Django, and $ python -c "import django; prindjango.get_version())" > returns 1.6.5 Then: $ python manage.py runserver returns: Validating models... 0 errors found August 19, 2014 - 02:19:03 Django version 1.6.5, using sett

Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-19 Thread Andrew Koller
Yes they are. On Tuesday, August 19, 2014 2:13:18 AM UTC-7, Tom Evans wrote: > > On Tue, Aug 19, 2014 at 3:28 AM, Andrew Koller > wrote: > > I'm having issues getting the dev server to work. After I installed > Django, > > and > > > > $ python

Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-19 Thread Andrew Koller
18, 2014 7:28:12 PM UTC-7, Andrew Koller wrote: > > I'm having issues getting the dev server to work. After I installed > Django, and > > $ python -c "import django; prindjango.get_version())" > >> returns 1.6.5 > > Then: > > $ python manage.py r

Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-19 Thread Andrew Koller
Tue, Aug 19, 2014 at 8:46 AM, Aaron C. de Bruyn > wrote: > >> After trying to load the page in Chrome, do you see any output in the >> 'runserver' window? >> >> >> On Mon, Aug 18, 2014 at 7:28 PM, Andrew Koller > > wrote: >> >>> I&#x

Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-19 Thread Andrew Koller
curl: (52) Empty reply from server On Tuesday, August 19, 2014 9:21:34 AM UTC-7, Tom Evans wrote: > > On Tue, Aug 19, 2014 at 5:07 PM, Andrew Koller > wrote: > > Yes they are on the same computer and no, I don't get any additional > output > > to the console.

Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-21 Thread Andrew Koller
Thanks for all your help guys. I got it to work by changing the ip address to: python manage.py runserver 0.0.0.0:8000 Not terribly sure why. On Tuesday, August 19, 2014 6:39:37 PM UTC-7, Camilo Torres wrote: > > > > On Tuesday, August 19, 2014 11:59:31 AM UTC-4:30, Andrew

Re: Improvement to objects.get_or_create and objects.update_or_create

2014-08-25 Thread Andrew Farrell
I have long wanted something like this. However, it would need to be able to handle: 1) possible unique_together clauses 2) communicating clearly to the user what it tried to do and what went wrong when it errors The thing that has made me wary of suggesting something like this is the fact that un

Re: Constants values and best practices

2014-08-28 Thread Andrew Pinkham
database, and would like to keep the constants up to date across multiple databases/developers, you should look into data migrations. South provides them, as do the new migrations in Django 1.7 (I believe). http://south.readthedocs.org/en/latest/tutorial/part3.html Hope that helps, Andrew

Re: settings.py

2014-09-08 Thread Andrew Pinkham
what is going on Are you following the tutorial? Are you experiencing a problem in particular? We need a little bit more information before we can help you. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: extremely slow django migrations

2014-09-10 Thread Andrew Pinkham
call `makemigrations`, verify the contents of the file, and then call `migrate` to build/alter the database. However, despite deprecation, `syncdb` should not be having an effect on your migration speeds. Hope that helps, Andrew -- You received this message because you are subscribed to the Google G

Re: extremely slow django migrations

2014-09-10 Thread Andrew Pinkham
for working with with native migrations is nearly identical. Hope that helps, Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr.

Re: models get_absolute_url issue

2014-09-10 Thread Andrew Pinkham
`CreateResourceForm`? Also, you may find the following site helpful when dealing with Generic Class Based Views (which allowed me to quickly check the behavior of get_object, listed in your traceback): http://ccbv.co.uk/ Andrew -- You received this message because you are subscribed to the Google

Re: Three Django forms in different tabs in one template?

2014-09-11 Thread Andrew Pinkham
o, but again, there was quite a lot being asked. I hope that helps clarify the issue. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-u

Re: Right way to create proxy to User model in Django 1.7

2014-09-15 Thread Andrew Pinkham
-49fc6cea24d46bdb27339c1aab392e32R379 Note that the code inherits not only from `AbstractBaseUser`, but also from a `PermissionsMixin`, which may or may not be desirable for you. Hope that helps, Andrew -- You received this message because you are subscribed to the Google Groups "Django

Upgrading Django (to 1.7)

2014-09-24 Thread Andrew Pinkham
/ I plan to post the next three in the series on each of the coming Wednesdays. Any feedback appreciated. I hope you find the material helpful. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Re: Upgrading Django (to 1.7)

2014-09-25 Thread Andrew Pinkham
ot be automatically squashed. If you use data migrations, this will result in migration file editing down the line. This should not be a problem, but I also don't want that to surprise you. I hope this and future articles are helpful! Thanks again for the positive feedback. Andrew PS I d

Re: Upgrading Django (to 1.7)

2014-09-25 Thread Andrew Pinkham
Fred, Thank you! Good luck with the upgrade! Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To po

Re: Upgrading Django (to 1.7)

2014-09-27 Thread Andrew Pinkham
the emails from Aymeric Augustin, Russell Keith-Magee, and Christopher Medrela documenting their work are incredibly helpful. Andrew Godwin even kept a blog! I would love it if people continued this trend. I will be linking to their work in Part III because of how useful and interesting the emails/bl

Re: Upgrading Django (to 1.7)

2014-09-27 Thread Andrew Pinkham
e ask, I will happily write a short article about the process. If you have any questions about data migrations after reading Part II, please ask them here! Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Upgrading Django (to 1.7)

2014-10-01 Thread Andrew Pinkham
Hi, Upgrading Django (to 1.7) Part II: Migrations in Django 1.6 and 1.7 is now available! For the article: afrg.co/updj17/a2/ For all of the material: afrg.co/updj17/ Any feedback appreciated. I hope you find the material helpful. Andrew -- You received this message because you are

Re: Upgrading Django (to 1.7)

2014-10-04 Thread Andrew Pinkham
Carsten, Thank you for reading and for the positive feedback! Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@google

Re: Upgrading Django (to 1.7)

2014-10-04 Thread Andrew Pinkham
provides some insight about the app registry, as well. Hope that helps, Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-user

Re: Upgrading Django (to 1.7)

2014-10-08 Thread Andrew Pinkham
Hi Fred, Thanks again for the input! Glad you liked Part II. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@google

Re: Upgrading Django (to 1.7)

2014-10-08 Thread Andrew Pinkham
Hi, Upgrading Django (to 1.7) Part III: Django 1.7's New Features is now available! For the article: afrg.co/updj17/a3/ For all of the material: afrg.co/updj17/ Any feedback appreciated. I hope you find the material helpful. Andrew -- You received this message because you are subsc

Re: Upgrading Django (to 1.7)

2014-10-09 Thread Andrew Pinkham
where I can find an article similar to > yours that gets me from 1.4 to 1.5 and on to 1.6 before I use > yours to get me from 1.6 to 1.7? No, but I hope the process I lay out in Part IV will help you indirectly. Andrew -- You received this message because you are subscribed to the Googl

Re: Upgrading Django (to 1.7)

2014-10-15 Thread Andrew Pinkham
hanks, Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@g

Re: Tango with Django - Populated Script

2014-10-20 Thread Andrew Crockett
Solution here: http://stackoverflow.com/questions/19699136/python-django-tangowithdjango-models-and-databases On Wednesday, June 4, 2014 2:01:44 PM UTC+4, Srinivasulu Reddy wrote: > > Hello Folks, >I am learning tangowithdjango book . In chapter 5 while dealing > the Populated Script

Re: A migration in one app that adds a field to another

2014-11-04 Thread Andrew Godwin
ng models in your project, you're not going to be able to use anything makemigrations outputs and expect it to Just Work™. Andrew On Tuesday, November 4, 2014 3:59:23 PM UTC-8, Carl Meyer wrote: > > Hi Justin, > > On 11/04/2014 04:42 PM, Justin Myles Holmes wrote: > >> I d

Re: Upgrading Django (to 1.7)

2014-11-25 Thread Andrew Pinkham
efore the end of the day! Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send

Re: Upgrading Django (to 1.7)

2014-11-25 Thread Andrew Pinkham
17/cl/ afrg.co/updj17/l/ Any feedback appreciated. I hope you find the material helpful. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django

Content using {% include %} not appearing on detailed page Django

2014-12-16 Thread Andrew Nguyen
I'm having some problems getting some of my content to appear on my detailed page view, which I have in two separate html files that are being pulled in using {% include %}. Inside my two files, slider.htmland sidebar.html, I'm using tags like {{article.title}} to grab specific information I

Re: Expected performance of the django development server?

2015-01-04 Thread Andrew Farrell
The django development server is slow by intentional neglect; It isn't supposed to be used in production because the django team does not want to divide its focus by supporting a full-fledged web server that is performance-optimized and security-audited. They want to include a development server th

Re: Expected performance of the django development server?

2015-01-04 Thread Andrew Farrell
To clarify: I'm not a django core dev and by "neglect" I don't mean that anyone is being neglectful, just focusing efforts elsewhere. On Sunday, January 4, 2015, Andrew Farrell wrote: > The django development server is slow by intentional neglect; It isn't > su

Re: Expected performance of the django development server?

2015-01-04 Thread Andrew Farrell
. (See also: http://stackoverflow.com/questions/2133627/using-django-db-connection-queries ) On Sunday, January 4, 2015, Andrew Farrell wrote: > To clarify: I'm not a django core dev and by "neglect" I don't mean that > anyone is being neglectful, just focusing effort

Re: Why is RequestContext used in this way?

2013-11-27 Thread Andrew Taylor
Thanks guys this was very helpful On Friday, 15 November 2013 14:12:50 UTC, Tom Evans wrote: > > On Fri, Nov 15, 2013 at 12:59 PM, Andrew Taylor > > > wrote: > > > > > > Hi, > > > > I've followed some example code which is is follo

GET and POST in forms. Please help me understand the logic!

2013-11-27 Thread Andrew Taylor
Hi, I'm struggling with the concepts of get and post and where these status come from in the workflow. I have worked my way through the official pages on forms but I have not quite understood this to my satisfaction. I get the gist that: - get is for requesting data and - the query stri

Re: GET and POST in forms. Please help me understand the logic!

2013-11-28 Thread Andrew Taylor
Awesome I feel much better about this now. Thanks for your help! On Thursday, 28 November 2013 09:29:05 UTC, Daniel Roseman wrote: > > On Thursday, 28 November 2013 03:24:11 UTC, Andrew Taylor wrote: >> >> Hi, >> >> I'm struggling with the concepts of get and p

Re: Adding Objects to Query Set

2013-12-16 Thread Andrew Farrell
It sounds like you just want a set of projects and don't actually need a querySet. You can do this with projects = set( Project.objects.filter(owner=request.user).all() ) member_projects = set( ProjectMember.objects.filter(member = request.user) ) total_projects = set(projects) | set(member_project

Re: Django ORM & DB backend coupling

2013-12-24 Thread Andrew Farrell
This seems like it would be a reasonable idea if the API represented a data model that was fundamentally relational in character. However, many are not. An API should be designed such that it is the best way to interact with its data model, so trying to shoehorn it into an ORM's API seems like it w

Re: New to Django; Question

2013-12-30 Thread Andrew Farrell
LegacyPatients.objects.all()) for patient in Patients.objects.all(): print patient.full_name, oldpatients[patient.useful_id].relevant_info -- Andrew (Feedback on my advice appreciated. I hope I don't sound like a tireboot) On Monday, December 30, 2013, Karthik Kannan wrote: > There seems

Re: Error when using apache 2.4.6

2014-01-17 Thread Andrew Farrell
To bisect your problem, I think that the error happens before the wsgi file even runs. you can test this by putting assert False at the top of /home/jass/Automation/apache/django.wsgi and seeing if the error changes to a 500. If it doesn't, I'm right. If it does, the problem is in django.wsgi Give

Not pure Django. Chrome versus Safari discrepancy

2014-02-14 Thread Andrew Taylor
Hi, I have been working my way through the tango with django tutorial, which I have to say I have found to be excellent. http://www.tangowithdjango.com/book/chapters/tango_too.html There is one section (above link) whereby you track the number of times a url has been clicked. This is done by p

Re: Not pure Django. Chrome versus Safari discrepancy

2014-02-15 Thread Andrew Taylor
not to cache the page. > Sometimes that won't work due to how browsers respect the headers. You can > also try the decorator: > > > from django.views.decorators.cache import cache_control > > @cache_control(no_cache=True, must_revalidate=True, no_store=True) > > > > O

is this (online tutorial) code calling a view from a view?

2014-02-15 Thread Andrew Taylor
Hi, I've been following an online tutorial but been debugging. I've traced my issue to this line in the view function below: return category(request, category_name_url) Is this view effectively calling another view directly without going via the urls file (in the exception case)? If so can yo

Improving django test startup performance.

2014-03-05 Thread Andrew Farrell
ing: - reordering the paths assigned to sys.path - removing items from sys.path when I am running tests - caching the locations where modules were previously found and looking there first Has anyone looked at doing anything like this? -- *Andrew Farrell* Software Engineer *|* MassChallenge, I

Re: Improving django test startup performance.

2014-03-05 Thread Andrew Farrell
is almost certainly something in the test discovery process. I suppose this means that digging up and mapping out the piping that runs through nose <https://github.com/nose-devs/nose>, django-nose<https://github.com/django-nose/django-nose>, the django test-discovery code

Django admin for public pages

2014-04-08 Thread Andrew Pashkin
I'm thinking about using django.contrib.admin for public facing pages. On the one hand, seems like it is not recommended: It’s not intended to be a *public* interface to data, nor is it intended to > allow for sophisticated sorting and searching of your data. As we said > early in this chapter,

Django i18n questions

2014-04-10 Thread Andrew Pashkin
Documentation says , that: ...it looks for a django_language key in the current user's session This is the latest commit

Re: Django i18n questions

2014-04-10 Thread Andrew Pashkin
I ended up using this snippet <https://djangosnippets.org/snippets/2875/> for switching languages. It simply reverses url with given language code. On 11.04.2014 09:55, Andrew Pashkin wrote: Documentation says <https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-

Re: Django i18n questions

2014-04-11 Thread Andrew Pashkin
Indeed On 11.04.2014 12:45, Daniel Roseman wrote: On Friday, 11 April 2014 06:55:12 UTC+1, Andrew Pashkin wrote: Documentation says <https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference>, that: ...it looks

Re: Template

2014-04-17 Thread Andrew Farrell
Do you mean that you are new to the syntax of django templates so you just want to look at and see what django templates look like? Take a look at the ones used in the admin of django itself: https://github.com/django/django/tree/master/django/contrib/admin/templates/admin index.html is a reasona

Re: Django app

2014-04-17 Thread Andrew Farrell
I'm a bit confused. Are you looking for something other than the Django Tutorial found here: https://docs.djangoproject.com/en/1.6/intro/tutorial01/? It takes you through building up an application. Or is that what you are looking for? On T

Re: Please help me out, I tried to get sync for whole day @@

2014-04-19 Thread Andrew Farrell
This looks like you have an index error in your settings.py file. Probably an extra space at the start of line 58. If you run python settings.py, you probably get the same error. On Sat, Apr 19, 2014 at 10:02 AM, Toan ComS wrote: >

Re: Django export the CSV file from database

2014-05-21 Thread Andrew Farrell
So the error is somewhere here: for att in attendance: day = att[2].day But I can't see where `attendance` is defined. I suspect you'll have a similar error in for leav in leavework: day = leav[2].day But also can't see where `leavework` is defined. On Wed, May 21, 2014 at 10:24 PM, hito

Re: django models

2014-06-02 Thread Andrew Farrell
hrough someone else's django project but would find some broader context useful. If you haven't already, I would recommend working through the tutorial, starting here: https://docs.djangoproject.com/en/dev/intro/tutorial01/ best regards, Andrew Farrell On Mon, Jun 2, 2014 at 8:51 PM, ngangs

Re: Django python fuction

2014-06-10 Thread Andrew Farrell
In general, I recommend adding the line "import pdb;pdb.set_trace()" to the top of your function and walking through it to see why it doesn't work. def foo(x): import pdb;pdb.set_trace() list = [] if isinstance(x, list): for i in x: elem = i return list

Re: Angular and Django

2014-06-22 Thread Andrew Farrell
Doug, I'm very interested to hear that Angular is more powerful than Ember. After some indecision between Ember and Angular, I decided to start picking up Ember on the advice of a friend that it was the more powerful of the two. Therefore, if you have anything I might read to contradict that, I'd b

Re: Returning submitted formset data to the template for further editing

2014-06-28 Thread Andrew Choi
Daniele, It doesn't seem like there's an easier way to do what you're proposing. However, what's the form data manipulation that you need to do for some of these forms? Is there a way to separate that from the form set submission? Andrew On Saturday, June 28, 2014 12:26:

Re: Update user and user profile same form

2014-06-29 Thread Andrew Choi
Henrique, It looks like what you're looking for is a formset: https://docs.djangoproject.com/en/1.6/topics/forms/formsets/ Andrew On Saturday, June 28, 2014 11:28:35 PM UTC+9, Henrique Oliveira wrote: > > Hi Guys, > > I have this model: > > class Member(mo

<    1   2   3   4   5   6   7   8   9   10   >