Group: http://groups.google.com/group/django-users/topics
- Queries to multiple tables [2 Updates]
- google app engine suggestion [4 Updates]
- Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE" [1 Update]
- CBV for Nested Formesets [1 Update]
- How to build this query [1 Update]
- How to crop image ? [2 Updates]
- tutorial first step. -ImportError: No module named django.core- [1 Update]
Kristofer <kris...@cybernetik.net> Nov 10 01:23AM -0600
Hello,
I'm new to Django and trying to learn it by making a simple budget/checkbook application.
I apologize for my ignorance, but I couldn't seem to find an answer to this on Google or the Django docs from my searches.
I want to create a function that will take a bank account as an id number (assumed to already exist), and the payee/amount. From there, the function will do a typical bank transaction: 1) add the entry to the "Ledger" table, and subtract the amount from the "balance" field of the "Account" table for the account referenced in the id number passed to the function.
Where is the appropriate/intended place to put that type of function? Model, Manager, View, or somewhere completely different?
My best guess is that it belongs in a Manager, but all of the examples I can find seem to indicate that Managers are intended for queries.
Thanks in advance,
Kris
Tomas Ehrlich <tomas....@gmail.com> Nov 10 12:15PM +0100
Hi Kristofer,
I usualy put methods like this one into Model, although Manager is also
possible. Definitely not View or sth else.
Why I like Model more than Manager is this difference (suppose your
method is called make_payment):
Account.make_payment # via Model
Account.objects.make_payment # via Manager
and because this method is "creating" object instead of "retrieving"
objects, it seems to me more apropriate. I know, there are methods like
create or get_or_create in Manager, so propably someone would have a
better arguments on this. Or maybe it's just matter of taste. In fact,
in one application of mine I have method Node.create which do some
fancy stuff (creating other related objects, consistency checks, etc.)
and then call Node.objects.create.
Cheers,
Tom
Dne Sat, 10 Nov 2012 01:23:44 -0600 (CST)
> My best guess is that it belongs in a Manager, but all of the examples I can find seem to indicate that Managers are intended for queries.
> Thanks in advance,
> Kris
<
Aswani Kumar <aswin...@gmail.com> Nov 09 08:53AM -0800
hi, i am planning to develop an education related information portal in
django and google app engine.
my question is google app engine supports python 2.7 but django moving
towards python 3.x now with django 1.5 the minimum required version of
python is 2.6. and django 1.6 will be on python 2.7. what will be my future
if i choose google app engine and django.
i need a PAAS like google app engine so i can concentrate on developing app
instead of managing servers.
please give me suggestions.
Javier Guerra Giraldez <jav...@guerrag.com> Nov 09 12:54PM -0500
> towards python 3.x now with django 1.5 the minimum required version of
> python is 2.6. and django 1.6 will be on python 2.7. what will be my future
> if i choose google app engine and django.
migration to 3.x is still experimental, it will be some time before
it's mandatory.
also, a significant part of Django deprecation policy is which
versions are available in widely used platforms. Not so long ago, 2.4
was still supported just because some still-supported RHEL version
uses it by default.
finally, i'm sure Google will make 3.x available before 2.7 is
hopelessly obsolete. Remember that they employ some big-name Python
developers just for that (even someone with GvR initials....)
> i need a PAAS like google app engine so i can concentrate on developing app
> instead of managing servers.
personally, i find much easier to manage my own server than to be
constantly distracted by the by-design limitations of the different
PaaS offerings. But if you find one that you really like, and don't
mind the lock-in, go for it!
--
Javier
Ashwin Kumar <aswin...@gmail.com> Nov 10 12:40PM +0530
thank you javier,
i am a .net and php developer, i can setup .net and php servers on windows,
ubuntu.
i am new to django/python. i love python so giving it a try.
can you give any idea of setting up my own django server, i found hard time
in setting up one. not able to choose between apache and nginx mod_wsgi,
mod_python.
i never found a decent documentation on how to setup and run django on
apache or nginx.
With Best
-Ashwin.
+91-9959166266
On Fri, Nov 9, 2012 at 11:24 PM, Javier Guerra Giraldez
Kurtis Mullins <kurtis....@gmail.com> Nov 10 03:51AM -0500
Well for development purposes, I just recommend using Django's built-in
"runserver" command. It will launch a relatively full-featured HTTP Server
for testing on your own computer. The command is "python manage.py
runserver" and you should be able to access it using localhost:8000
Otherwise, I think the web server of your choice depends upon your needs.
I, personally, prefer Nginx and uWSGI but something else may be better for
your particular use case.
Good luck!
Kev Dwyer <kevin....@gmail.com> Nov 10 06:57AM
muhammed riyas wrote:
> db.delete(employeekeys)
> return render_to_response('main/index.html')
> i dont know why?,,,,
Hello,
Your question isn't related to Django, so it is not suitable for this group.
You should send questions about App Engine software to an App Engine-related
group.
Having said that, the error message that you are getting is telling you that
your employeekeys list does not contain keys, it contains references to the
key method of each Employee instance in your query resultset.
You need to change the line
employeekeys.append(employee.key)
to
employeekeys.append(employee.key())
Now your list will contain the keys.
Cheers,
Kev
Lee Hinde <leeh...@gmail.com> Nov 09 10:54AM -0800
I'm looking at these two blog posts to help me figure out nested formsets:
http://yergler.net/blog/2009/09/27/nested-formsets-with-django/
http://andreipetre.tumblr.com/post/26203496689/nested-formsets-with-django
The example uses a function view and I was interested using class-based
views, but I can't figure out where to start.
Thanks for any pointers.
- Lee
Nikolas Stevenson-Molnar <nik.m...@consbio.org> Nov 09 09:13AM -0800
That looks correct, though you don't need distinct('id'), since
presumably id is your primary key and will already be unique.
_Nik
On 11/9/2012 1:01 AM, ozgur yilmaz wrote:
Brent <brentc...@gmail.com> Nov 09 06:56AM -0800
Have you looked at easy-thumbnails? It depends on PIL or Pillow and works great for cropping amount other image manipulations.
Kurtis Mullins <kurtis....@gmail.com> Nov 09 10:48AM -0500
The only thing I didn't like about easy-thumbnails is that it relied on
generating them on the fly and caching them, if I remember correctly. While
that's not totally horrendous, I was using a CDN and didn't want to use my
Django Application to serve media. Note: I might be thinking of something
else (sorl?) so my apologies if I've given incorrect information.
Francesco Serafini <serafini....@gmail.com> Nov 09 03:07PM
I am sure I activated the environment but nothing. In my case I guess I had
some problem with the PATH variable..
2012/11/9 Dan Gentry <d...@gentryville.net>
You received this message because you are subscribed to the Google Group django-users.
--
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.