If I have a view function that transfers money from savings to
checking account, is @transaction.commit_on_success the recommend way
to manage the transaction?
So something like:
@transaction.commit_on_success
def transfer(request):
...
savings.withdraw(amount)
Hi there,
I'm in a template that is trying to simply show everything in my
database. But I can't seem to do it even though this should be dead
simple :<.
Here is my view, called browse_all:
def browse_all(request):
resultSet = Sample.objects.all();
print resultSet
I'm relatively new to the Django world and I'm just starting on a new
project that may be right up the frameworks ally. But there's one
thing I'm a little iffy on after reading the documentation.
I'm attempting to write an app that will allow for management of a
"parts" database that will allow
Russell Keith-Magee wrote:
> Sorry - a point of clarification. the technique I gave you is 1.2
> specific. There's no analog under 1.1, because 1.1. doesn't support
> multiple databases.
That explains a lot; tx.
My current impediment - probably nothing to do with Django - is ...
On Tue, Mar 30, 2010 at 12:05 AM, Phlip wrote:
>> qs.query.get_compiler(qs.db).as_sql()
>
> That gives this error message with the usual zero Google hits for that
> error message:
>
> AttributeError: 'BaseQuery' object has no attribute 'get_compiler'
Sorry - a point of
On Mon, Mar 29, 2010 at 12:34 AM, Colin wrote:
> After struggling with Django's templating language for a while, I
> decided I wanted to switch to something with a bit more power. In
> particular, I liked what I saw of Mako (being able to instantiate new
> variables, and
> def setUp(self):
> user = User.objects.create_user(USER, '@nowhere.com', PASS)
That's what fixtures are for!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
> editing django/utils/translation/__init__.py
yea looks like that was the problem, all the fixes in rev #12875
sorted the problem
and everything still works in the latest trunk #12882
thanks Russ!
Thanks Graham, I saw that blog post earlier but haven't had time to
read it, I should have time
On Mon, Mar 29, 2010 at 11:58:17AM -0700, Valentin Golev wrote:
> How to tell django about the locale? It does not seem like it will
> find the /locale/ folder by itself
I'm using the following:
LOCALE_PATHS = ('/locale', )
With kind regards,
--
Baurzhan Ismagulov
http://www.kz-easy.com/
--
> The test_settings and dev_settings should point to a PASSWORDLESS
> database with localhost-only permissions. The production_settings file
> should not be committed. It's the one copied up to the server.
Come to think of it, what I'm screaming about here is three separate
things:
- developer
Guillermo wrote:
> I'm working on a project with multiple programmers for the first time,
> and I'm not sure how I should go about commiting the Django project's
> setting file to the public repo. Since it can contain sensitive data,
It should not contain sensitive data. You should write
Hello!
I'm developing a project with two different sites, divided by
language. Maybe I was terribly wrong, but now my directory structure
looks like:
/ruapp/settings.py # SITE_ID =1
/ruapp/manage.py
/enapp/settings.py # SITE_ID = 2
/enapp/manage.py
/common/urls.py
/common/ # almost every other
Hi,
I have this forms.py file
---
# -*- coding: utf-8 -*-
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.forms.models import inlineformset_factory
from
Thanks Baxter. If I don't store HTML code in the database though where
do I store it? Do I just create a lot of different HTML snippets in
the templates that might possibly be used? Or do I create lots of mini-
templates and use inheritance?
On Mar 29, 12:53 pm, "bax...@gretschpages.com"
I would generally recommend against storing html in the database, but
if you're going to, and if you KNOW that it's safe, you have to mark
it safe: {{ obj.stuff|safe }}
On Mar 29, 12:36 pm, gvernold wrote:
> Hi fellow Djangoists
>
> I've got some content with embedded
Hi there,
I've tried to contact with the people related to the django-
chronograph project, but without success.
When you create a new job there is a field called Params, there you
should be able to specify when your job is run following the rrule
rules.
So the only parameter that seems to work
> self.fields['man'].queryset=Pupil.objects.filter(gender='M')
> self.fields['woman'].queryset=Pupil.objects.filter(gender='F')
>
> It returns only the man and woman for each combo box. Now, also, I only want
> the User wich aren't Teacher. How can I do this? I've tried with
Hi fellow Djangoists
I've got some content with embedded html tags in a database. When I
pass the content for rendering with a template through the Django
templating system the web page actually prints the html tags rather
than parsing through the browser (for instance actually prints
rather
It would be more on the lines of the first one. I guess folks intent
to pretend, as much as possible, that we are running vanilla Django -
and, perhaps, deploy to a RDBMS and only move to a non-relational
store if the app is successful enough.
Thanks! There is a lot to catch up.
On Mon, Mar 29,
I have a model form in my project that has a field that is swapped out
for another field based on user preferences. Some users want a select
the value from a dropdown box, other people want to just type the
value into a textbox.
Before I had it like this:
def proper_flight_form(profile):
"""
Hello,
Are you sure you don't have a cyclic reference in there:
cat1 -> cat2 -> cat1 ?
You can always insert a
import pdb; pdb.set_trace()
line in the method and use the debugger to figure out what's keeping
the loop from exiting normally.
Nuno
On Mon, Mar 29, 2010 at 2:55 PM, mouadino
On Mar 29, 8:22 am, bruno desthuilliers
wrote:
> On 19 mar, 20:05,pjmorse wrote:
>
> > In my application's admin console, there's a tiny form for updating
> > the image associated with a specific model.
>
> > When a file is uploaded, the
Looks like it was a pythonpath thing.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
OK, maybe it won't save the world.
My name is Mark Morgan and I'm working on a project which might be of
interest to some of you. I'm a family doctor in Minnesota and I'm
associated with a really, really big clinic in Minnesota as well as
the US Indian Health Service. Neither institution is
> * Similarly, connection.cursor() will only work in the single
> database case. connections[qs.db].cursor()
Aaaand that's not working either. (No connections, no qs.db.)
I must take a break until someone unravels all this, because I don't
know enough about the architecture inside QuerySet...
> AttributeError: 'BaseQuery' object has no attribute 'get_compiler'
qs._as_sql() returns a tuple of a SELECT statement, and a (),
presumably with wildcards; I will start there.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
> qs.query.get_compiler(qs.db).as_sql()
That gives this error message with the usual zero Google hits for that
error message:
AttributeError: 'BaseQuery' object has no attribute 'get_compiler'
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
my setup is like this:
/apps/
/apps/app1/
/apps/app2/
/projects/
/myproject/
I've got it set up that way because multiple projects use multiple
apps. Because of that setup, I use django-admin.py, specifying the
project.
Anyways, from the admin and site side of things, everything looks
This doesn't answer your question, but it may help you solve the problem. I
have this class in my tests:
class LoggedInUser(TestCase):
def setUp(self):
user = User.objects.create_user(USER, 'm...@nowhere.com', PASS)
self.client.login(username=user.username, password=PASS)
Thanks Shawn. Funny that you posted the anwer at exactly the same time
it occurred to me.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send
That's fantastic! I did it using one of the alternatives he describes
(separate form with constructor/save code to manually select, extract
and set the ManyToMany) and it was fairly unpleasant.
Thanks for point this out.
--
You received this message because you are subscribed to the Google
It depends on what you want. You can set 'created_by' to blank=True and
null=False, so it doesn't have to be filled but it is still mandatory in the
database. Or, if you never want to set it in the form, you can make it
'editable=False' and it doesn't show up in the form, but it can still be NOT
Hi all.
Can somebody help me and point me to solving the following problem:
1. I am writing an application where I render the needed information
in the XML file (to be more specific GeoRSS)
2. I am generating the GeoRSS with the means of the GeoAtom1RSS django
class, and passing it to
I am entering them on the same page otherwise I will have to note down
the ids of people and publications table and then go to bridge table
and insert the ids there. So the reason I want to enter in the same
page is I will insert the ids into bridge table whenever I click save.
I am not allowed to
Hi,
On 03/28/2010 06:34 PM, Colin wrote:
> Or any other templating language that's a bit looser in allowing a bit
> of logic to mix in with the presentation layer?
>
http://mockit.blogspot.com/2010/02/using-chameleon-in-django.html
--
You received this message because you are subscribed to
2010/3/29 Ricardo Bánffy :
> Hi.
>
> I am about to be asked to either find a way to use Cassandra as a
> database backend or create one. Is there anyone working on something
> like this?
>
Do you mean writing a database backend for django ORM that supports Cassandra?
Have a
Hi.
I am about to be asked to either find a way to use Cassandra as a
database backend or create one. Is there anyone working on something
like this?
--
Ricardo Bánffy
http://www.dieblinkenlights.com
http://twitter.com/rbanffy
--
You received this message because you are subscribed to the
On Mar 29, 10:08 am, Massimiliano della Rovere
wrote:
> I am writing a two step admin action:
> 1) select the items you want to mass-modify and click the action
> 2) enter the values that will be processed for each selected item
> 3) finally go back to the item
On Mar 29, 3:48 pm, Javier Guerra Giraldez wrote:
> On Mon, Mar 29, 2010 at 3:07 AM, derek wrote:
> > Is there a possibility to store longer term data in the session
> > variable (assuming one is dealing with logged-in users)?
>
> you should write that
i think like this:
def delete_all(self):
Categories.objects.filter(parent_category=self).delete()
On Mar 29, 3:55 pm, mouadino wrote:
> hello everybody
>
> I have a model class where i m using a foreign key self-referencing
> here is my code :
>
> class
hello everybody
I have a model class where i m using a foreign key self-referencing
here is my code :
class Categories(custom.Model):
url = models.ForeignKey(Urls, null=True, blank=True)
category = models.CharField(max_length=128)
parent_category = models.ForeignKey('self',
On Mon, Mar 29, 2010 at 3:07 AM, derek wrote:
> Is there a possibility to store longer term data in the session
> variable (assuming one is dealing with logged-in users)?
you should write that data to the user's profile; or to any DB record
with a ForeingKey to the User
On Sun, Mar 28, 2010 at 12:34 PM, Colin wrote:
> Or any other templating language that's a bit looser in allowing a bit
> of logic to mix in with the presentation layer?
PHP
--
Javier
--
You received this message because you are subscribed to the Google Groups
Thank you for the answers!
Everything is much clearer now :-)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
On 29 mar, 13:49, Vinicius Mendes wrote:
> Django algo has a shortcut called django.template.loader.render_to_string.
Mmm, yes, indeed. Forgot about that one, thanks for the reminder !-)
--
You received this message because you are subscribed to the Google Groups
"Django
On 19 mar, 20:05, pjmorse wrote:
> In my application's admin console, there's a tiny form for updating
> the image associated with a specific model.
>
> When a file is uploaded, the application reaches this code:
>
> if request.method == 'POST':
>
Continued research (I kept asking people) suggests that this is a
consequence of moving from Python2.4 to Python2.5. The options appear
to be:
* Downgrade Python to 2.4
* Find a "more compatible" copy method.
I'd really rather not downgrade Python, but I don't know how to find a
"more
trying to delete a user via admin results in the following error
message: relation "django_comments" does not exist.
I'm not using regular comments but threaded comments. Any idea how to
fix this problem (without creating a fake django_comments table)?
Django 1.1.1
Thanks,
Paul
--
You
Django algo has a shortcut called django.template.loader.render_to_string.
__
Vinícius Mendes
Solucione Sistemas
http://solucione.info/
On Mon, Mar 29, 2010 at 8:15 AM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:
> On 29 mar, 10:47, "het.oosten"
You can include a template with area 1 and inside this template, you add the
other tags.
__
Vinícius Mendes
Solucione Sistemas
http://solucione.info/
On Sun, Mar 28, 2010 at 6:26 PM, Sławek Tuleja wrote:
> Hi all!
> my question is: can 'tag'
On 29 mar, 09:12, Thierry Chich wrote:
> Le lundi 29 mars 2010 02:14:34, pjrhar...@gmail.com a écrit :> > OK. I can
> also put an hidden field in my form. I will evaluate what is
> > > the better option for me.
>
> > Bear in mind if you exclude it from your form
On 29 mar, 10:47, "het.oosten" wrote:
> When I send mails with my Django app the first line of every mail is:
> Content-Type: text/html; charset=utf-8
>
> When i watch the message source i noticed that charset=utf-8 is
> changed into charset=3Dutf-8
>
> I also saw that in
On 29 mar, 12:16, vamsy krishna wrote:
> thnx jonas...i figured datz wat i mite do...
Totally OT, but talking "datz way" won't make you looks "kewl" here.
> so django has a limitation
> on imports like in da case i mentioned?
>
It's not a django limitation, it's a
> I cant use inlines option ind admin,py because the
> tables should be related.
If they aren't related why would you want to be entering them on the
same page?
When you come to edit them again what two instances should be loaded
together if they are completely unrelated?
Given what you first
thnx jonas...i figured datz wat i mite do...so django has a limitation
on imports like in da case i mentioned?
On Mar 29, 2:51 pm, Jonas Obrist wrote:
> On 03/29/2010 10:28 AM, vamsy krishna wrote:
>
> > hi...am very new to django and am having some problem with my code...
>
On 03/29/2010 10:28 AM, vamsy krishna wrote:
hi...am very new to django and am having some problem with my code...
say i've two modules...mod1 n mod2...n views in both modules have
certain generic functions which i need to import from each other...as
in
(in views.py of mod1)
from mod2.views
hi...am very new to django and am having some problem with my code...
say i've two modules...mod1 n mod2...n views in both modules have
certain generic functions which i need to import from each other...as
in
(in views.py of mod1)
from mod2.views import xyz
(and in views.py of mod2)
from
We use Paste Deploy configuration files [1] and we have a main/base
configuration file under version control, which gets overridden with a
non-versioned configuration file with holds all the sensitive
information specific to that instance of the application.
This way, such information is not
When I send mails with my Django app the first line of every mail is:
Content-Type: text/html; charset=utf-8
When i watch the message source i noticed that charset=utf-8 is
changed into charset=3Dutf-8
I also saw that in the message header the mail is marked as:
Content-Type: text/plain;
Le lundi 29 mars 2010 02:14:34, pjrhar...@gmail.com a écrit :
> > OK. I can also put an hidden field in my form. I will evaluate what is
> > the better option for me.
>
> Bear in mind if you exclude it from your form altogether there is
> nothing to stop a malicious user setting it by modifying
I am writing a two step admin action:
1) select the items you want to mass-modify and click the action
2) enter the values that will be processed for each selected item
3) finally go back to the item list page with a user_message informing
her/him about the outcome.
I am trying to create a
hi all,
i am trying to connect to mssql server using pyodbc.
i am connecting to two databases each one on defferent instances, one
is default instance and another is client instance.
whenever my default instance mssql server is runnning, i can access
both instances database.
but when my default
On Mar 26, 5:58 pm, Bill Freeman wrote:
> Actually, by the time your user can click a button the "result-set" is no
> longer around, because thecontextis no longer around (render and the
> view function have returned). All that's left is the rendered representation.
>
> I see
Nice idea ! It will simplify my work.
Thanks to share it !
Le 28 mars 2010 à 22:29, "pjrhar...@gmail.com" a
écrit :
See this snippet:
http://www.djangosnippets.org/snippets/1295/
Peter
On Mar 27, 6:02 am, jwils2...@gmail.com wrote:
I believe the answer is to
You can override a method called "save_model" inside your model admin
class, this will be called
whenever you hit save button of admin for a particular class. You can write
your custom logic in
this method.
ex
def save_model(self, request, obj, form, change):
Your Logic
Regards,
On Mar 29, 7:56 am, Asim Yuksel wrote:
> Sorry for not making it clear. The idea is to use default admin
> template and help the admin to enter data from admin interface. I will
> enter data via admin's default template. Lets say I have People and
> Publications Table
The admin page has a button to add records. When I click a table from
admin page and click add, I can enter data. What I want to do is I
want to add records to 2 table at the same time. The admin page will
show me all the fields to enter data for both table. When I click save
the data will be
I would like to perform something similar to
http://stackoverflow.com/questions/861310/summing-the-values-from-the-2nd-table-based-on-id-of-the-1st-table
(ie get the sum of distinct event amounts in a payment table then
group the payments by event details and total money paid for them.
Also
68 matches
Mail list logo