Hello,
Here is an extremely simple scenario:
class Base(models.Model):
f1 = models.CharField(max_length=64)
class A(Base):
f2 = models.CharField(max_length=64)
class B(models.Model):
f3 = models.CharField(max_length=64)
b = models.OneToOneField('A', null=False, related_name="b_o
Hi all - I'm trying out the multi database options in django 1.2 beta
on a new project. I can connect to two databases which is great.
However, I'm not sure what to do in my models.py file???
I have a single class in models.py that points to a table on a
different database (existing table of data
Thank you very much for your reply. It really makes sense to change
the foreignkey, and have have changed this. The core of the problem
however remains the same.
Everything works fine when only one reservation per house is entered.
When I enter two reservations on one house, only one one of the tw
On Mar 19, 8:44 am, mbdtsmh wrote:
> Hi all - I'm trying out the multi database options in django 1.2 beta
> on a new project. I can connect to two databases which is great.
>
> However, I'm not sure what to do in my models.py file???
>
> I have a single class in models.py that points to a table o
On Mar 19, 4:22 am, timdude wrote:
> OK, dare I state the obvious, I am pretty green at this.
!-)
> Thanks for
> helping out. I'll try and be more specific:
>
> My site is sitting athttp://staging.bluecaravan.net. The 'glitch'
> happens fairly frequently (over 50%) and on random pages through th
I would strongly suggest to go with contrib.auth as quite a lot in the
django universe revolves arround it.
Remember you can also write your own login/logout/... views but still
using contrib.auth's models, forms and other utils.
You may also want to have a look at django-registration:
http://bit
I guess what I am asking is - can Django handle BLOBs in its models?
On 18 Mar, 16:55, huw_at1 wrote:
> Hi
>
> I currently have an oraclecartridgewhich performs a specific type of
> search on large binary objects (which thecartridgealso creates and
> indexes). I want to try and integrate thecartr
Hi All,
I have a model CampaignYear that is registered with django-reversion so that
when a CampaignYear instance is saved a django-reversion Version object is
also saved. This worked great until I wanted to do the following:
add a field to CampaignYear, last_editor(), that queries the latest V
Hi,
I have come across the same problem as you describe.
Did you resolve the issue?
If so, what was wrong?
Thanks,
James
--
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 un
Is it possible to retrieve a list of attributes valid for a given
model object, without actually having an instance of that object? I
want to be able to check if a given attribute is present on a model.
Currently, I'm doing this:
dummy = MyModelObject()
if attributeName in dir(dummy):
# do som
On Fri, Mar 19, 2010 at 10:59 AM, James wrote:
> Hi,
>
> I have come across the same problem as you describe.
> Did you resolve the issue?
> If so, what was wrong?
>
> Thanks,
>
> James
>
Perhaps some context about 'the same problem' is required. No-one has
a clue what you are talking about - I m
On Fri, Mar 19, 2010 at 11:35 AM, huw_at1 wrote:
> I guess what I am asking is - can Django handle BLOBs in its models?
>
> On 18 Mar, 16:55, huw_at1 wrote:
>> Hi
>>
>> I currently have an oraclecartridgewhich performs a specific type of
>> search on large binary objects (which thecartridgealso c
Yes, this conversation hits the nail on the head.
'select related' only works with forward facing keys.
http://code.google.com/p/django-selectreverse/ is a resonably good
piece of code to improve performance:
using a structure like:
class model1(model.Models) 1<* class model2(model.Models
Hello Django community,
I have started compiling a list, "Common causes for translation
problems". Where would be a good place to put this list so people who
have a problem with their translations will be most likely to
encounter it?
Ram Rachum.
--
You received this message because you are subs
On Mar 19, 11:01 am, cpx wrote:
> Is it possible to retrieve a list of attributes valid for a given
> model object, without actually having an instance of that object? I
> want to be able to check if a given attribute is present on a model.
>
> Currently, I'm doing this:
> dummy = MyModelObject()
Hi Tom,
Sorry if I gave the impression that I had not read around before
posting here. Believe it or not I already have the top 5 hits on this
search marked as read. Was it a particular page you were referring to
since all the ones I have read are either out of date or mention
workarounds?
Cheers
In models.py, when I use
class GevondenManager(models.Manager):
def get_query_set(self):
return
super(GevondenManager,self).get_query_set().filter(crcWaarde
= 0)
I get proper answers.
However, I want to filter on "not equal to" and this does not seem to
work. How to procee
The Imagefile is just a pointer to file. Here is what I do to upload
and resize an image. I hope it helps.
file_to_open = settings.MEDIA_ROOT+'//profiles//'+
user.username+'-'+file.name
fd = open(file_to_open, 'wb+')
if file.multiple_chunks():
for chunk in file
I'm currently writing a blog application in django, and a part of what
I want to do is allow some HTML in posts and comments. I discovered
yesterday, more or less by accident, that the markdown filter actually
allows some HTML.
I've been looking for a list of exactly what markdown allows, but I
ha
On Mar 19, 1:22 pm, BobAalsma wrote:
> In models.py, when I use
> class GevondenManager(models.Manager):
> def get_query_set(self):
> return
> super(GevondenManager,self).get_query_set().filter(crcWaarde
> = 0)
> I get proper answers.
>
> However, I want to filter on "not
Hi. All that you say is totally clear to me, but I tried to suit the
customer's needs. And, yes, I finished my deals on just saving the
images serverside and sending links to files over e-mail. Thanks for
that.
Another question that bothers me is the following.
---
Thanks for reply. I tried both variants before the post :) Nothing
suited me and the customer.
When a-mailng files are uploaded to RAM anyway, zipping files just
don't really help on binary data. I chosed to save them to a web-
visible location.
On Mar 18, 7:59 pm, Paulo Almeida wrote:
> I can't
Benedict Verheyen wrote:
>
> This is the code in my update view:
>
> def action_edit(request, action_id):
> action = get_object_or_404(Action, pk=action_id)
> if request.method == 'POST':
> form = ActionForm(request.POST, action)
> if form.is_valid():
> form.sa
Hi,
When the form is submitted i would like to show a message above the
form. Much like the way if there are form errors you can print
form.errors
So, in my template i have entered
{% if form.thanks %}
thanks for submitting the form
{%
Hi Tom,
Sorry, that was my first post on Google Groups.
It seems I created a new thread instead of replying to:
http://groups.google.com/group/django-users/browse_thread/thread/6dd8777e19f06de8/
I have since resolved my issue but don't think Jonathan has.
Thanks,
James
---
On Mar 19, 12:24 pm
To clarify. If I have three houses, and house 120 has two
reservations, I get a list like this:
120 121 122 120 (if all are available)
If the query matches one reservation of house 120 i get a list like
this:
121 122 120
House 120 should been excluded from the list though.
--
You received th
This makes alot of sense and works in my case - many thanks.
However, still unclear as to how to specify which table should be
created in which database when you do want to syncdb to both
databases. I may have 2 tables in models.py that I want to point to
db_1 and 3 tables in models.py I want to s
Hi,
My suggestion to zip the files was to provide a single download link with
all the files.
- Paulo
On Fri, Mar 19, 2010 at 1:43 PM, tezro wrote:
> Thanks for reply. I tried both variants before the post :) Nothing
> suited me and the customer.
>
> When a-mailng files are uploaded to RAM anyw
Benedict Verheyen wrote:
> Benedict Verheyen wrote:
>
> As expected, it works if i set the values in my view:
>
> action = get_object_or_404(Action, pk=action_id)
> form=ActionForm(instance=action)
> if request.method == 'POST':
> form = ActionForm(request.POST, action)
> if form.is_valid
Oh. I get it, sorry. Any suggestions on my next question about
file.read() would be thankful.
On Mar 19, 5:20 pm, Paulo Almeida wrote:
> Hi,
>
> My suggestion to zip the files was to provide a single download link with
> all the files.
>
> - Paulo
>
> On Fri, Mar 19, 2010 at 1:43 PM, tezro wrote
On Fri, Mar 19, 2010 at 1:21 PM, huw_at1 wrote:
> Hi Tom,
>
> Sorry if I gave the impression that I had not read around before
> posting here. Believe it or not I already have the top 5 hits on this
> search marked as read. Was it a particular page you were referring to
> since all the ones I have
Look at the way contexts are implemented. There are actually a chain of
mappings, and if a variable isn't found in the mapping at the head of the
chain, the next is consulted, and so on. Certain operations (and, apparently,
ifequal is one of them) push a new mapping onto the chain, so when that
t
Hi,
Is it possible to get real signals into Django processes? I have
several processes that collect data for analysis, so they run a long
time normally. For maintenance purposes, it would be handy to be able
to send a SIGHUP to the processes and have them shut down cleanly. I
read up on the pse
We have a freelance designer that, for various political reasons, we need to
give access to our templates directory. The problem is, he frequently pastes
from Microsoft Word, and other sources, and then we're seeing HTTP 500 errors
because the output contains unescaped UTF-8 / unicode characters
Hi guys, I have a bit of an issue I can't seem to work out. Maybe
someone can shed some light on the issue.
I have a app that generates an xml, inside the xml nodes are paths to
flash assets i.e: /media/assets/leader1.swf. A flash file loads the xml file, reads it and
loads in the flash assets d
> Is it possible to get real signals into Django processes? I have
> several processes that collect data for analysis, so they run a long
> time normally. For maintenance purposes, it would be handy to be able
> to send a SIGHUP to the processes and have them shut down cleanly. I
> read up on th
On Fri, Mar 19, 2010 at 2:08 PM, grimmus wrote:
> Hi,
>
> When the form is submitted i would like to show a message above the
> form. Much like the way if there are form errors you can print
> form.errors
>
> So, in my template i have entered
>
> {% if form.thanks %}
>
To expand on DR's answer slightly, the '=' in 'filter(crcWaarde=0)' is
not a comparison
operator. All arguments to filter need to be of the form
"'leagal_identifier'=value". This
is python syntax, nothing to do with django. Think of this '=' as
being more akin to
assignment.
The answer to your
I offer my condolences.
Technical solutions to political problems are seldom completely satisfactory.
One possibility is that he doesn't actually get access to the
templates directory,
but gets read access to that directory, and write access to another directory,
from which a script that he can i
Might something be being entity quoted in the template rendering (some string
not marked as "safe")? Grab the page with curl -O or comparable and
use something
like vi, bbedit, or emacs to see what the characters really are.
Failing that, perhaps some relative path isn't being interpreted as
rela
Excellent, thanks for the reply
On Mar 19, 3:49 pm, Tom Evans wrote:
> On Fri, Mar 19, 2010 at 2:08 PM, grimmus wrote:
> > Hi,
>
> > When the form is submitted i would like to show a message above the
> > form. Much like the way if there are form errors you can print
> > form.errors
>
> > So, in
I had a similar problem and I used two approaches. First I used Django's
smart_str:
from django.utils.encoding import smart_str
text = smart_str(text)
Then I had the same problem with fields using the csv module and I used
these functions that I found on the web:
def unicode_csv_reader(unicode_c
Hello,
can somebody help me with this error? I am a Django beginner but I don't
see any errors in the code:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/administration/
Django Version: 1.1.1
Python Version: 2.6.4
Installed Applications:
['django.contrib.auth',
'djang
I think what's happening is you are assigning a string to the 'login'
variable:
login = request.POST['login']
So when you get to:
login(request, user)
login is the text and not the function.
HTH,
Paulo
On Fri, Mar 19, 2010 at 3:15 PM, Martin Tiršel wrote:
> Hello,
>
> can somebody help me w
Oh, I missed that part. I'm not an expert, so you may want to investigate
alternatives, but with the shutil module you can copy files or entire
directories:
http://docs.python.org/library/shutil.html
Look for copy and copytree.
Best,
Paulo
On Fri, Mar 19, 2010 at 2:32 PM, tezro wrote:
> Oh. I
On Fri, 19 Mar 2010 16:23:40 +0100, Paulo Almeida
wrote:
I think what's happening is you are assigning a string to the 'login'
variable:
login = request.POST['login']
So when you get to:
login(request, user)
login is the text and not the function.
HTH,
Paulo
Yes and I forgot to mention
I've got a Players model
I've got a Game models with roster, a M2M relationship with players,
to select the players actually playing in that particular game
And I've got a Play model with a foreignkey to Players. What I want is
to limit the list of players to the ones that are actually on the
roste
On Fri, Mar 19, 2010 at 3:23 PM, Paulo Almeida
wrote:
> I think what's happening is you are assigning a string to the 'login'
> variable:
>
> login = request.POST['login']
>
> So when you get to:
>
> login(request, user)
>
> login is the text and not the function.
>
> HTH,
> Paulo
>
Its worse tha
Maybe feed your templates through a call to unicode.decode, with the
errors arg set to 'replace'? This will replace all sequences that
can't be decoded with a '?'. At least that lets you render the
template. Depending on how far you want to go, you could also write
your own error handler and replac
Greetings djangonauts!
EuroPython 2010 - 17th to 24th July 2010
EuroPython is a conference for the Python programming language
community, including the Django, Zope and Plone communities. It is
aimed at everyone in the Python community, of all skill levels,
If i have enable view level cache then django saves the db queries
result in cache?
For example i have following view:
@cache_page(60 * 150)
def public(request):
..
..
In this view i am quering database.
My question is if i load this page in browser and then modify some
records in
Looking at this more, I think I may have more of a logic problem
I think Play can't have any idea of Game roster, because until it's
been saved it has no idea what game it's related to. So maybe what I
need is a way to dynamically fill the player field on Play, after game
has been selected. Ti
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':
file = request.FILES.copy()
...and fails with this error:
object.__new
Have you checked the logs (or what gets printed to the console in your
dev server) to see if what files flash is actually requesting from the
server? Any 404s?
Nuno
On Fri, Mar 19, 2010 at 2:48 PM, Jeffrey Taggarty wrote:
> Any ideas? I know the flash loader is working just fine, it's a
> trivia
On Mar 19, 5:11 pm, Waqas wrote:
> If i have enable view level cache then django saves the db queries
> result in cache?
>
> For example i have following view:
>
> @cache_page(60 * 150)
> def public(request):
> ..
> ..
>
> In this view i am quering database.
>
> My question is if i l
On Fri, Mar 19, 2010 at 2:11 PM, het.oosten wrote:
> To clarify. If I have three houses, and house 120 has two
> reservations, I get a list like this:
>
> 120 121 122 120 (if all are available)
>
> If the query matches one reservation of house 120 i get a list like
> this:
>
> 121 122 120
>
> Hou
Thanks to both: I felt I was missing something but couldn't find where
to look :-)
Bob
On Mar 19, 3:55 pm, Bill Freeman wrote:
> To expand on DR's answer slightly, the '=' in 'filter(crcWaarde=0)' is
> not a comparison
> operator. All arguments to filter need to be of the form
> "'leagal_identi
Hello,
I'm having some trouble putting together a form for batch import of
csv files.
I found django-batchimport at http://code.google.com/p/django-batchimport/
and that seemed to be the answer. It looks like it was integrated
into Django a year ago (http://code.djangoproject.com/changeset/
10121
My understanding is that these days people tend to suggest this:
http://code.google.com/p/html5lib/ .
Jim
--
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 th
Hello,
I am programming an application where one part is customer database with
accounts and settings for internal access, the second part is customer
access with different interface and functionality. For internal access I
am using django.contrib.auth and login_required decorator. This dec
Hi,
This ticket is pretty old, but if it turns out you need a new decorator you
can try the patch:
http://code.djangoproject.com/ticket/11770
Regards,
Paulo
On Fri, Mar 19, 2010 at 9:57 PM, Martin Tiršel wrote:
> Hello,
>
> I am programming an application where one part is customer database w
about admin delete select objects
It works on Django-1.2-beta, but does not work on revision 12807
I have to delete each object individually >_<
--
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...@g
On Fri, Mar 19, 2010 at 4:58 PM, nitipit wrote:
> about admin delete select objects
> It works on Django-1.2-beta, but does not work on revision 12807
> I have to delete each object individually >_<
>
Yes, there's a ticket open on it: http://code.djangoproject.com/ticket/12962
Karen
--
You r
Thank you for your reply.
After having a look at its code, it seems that django-registration
provides the signup feature, and uses contrib.auth for the rest.
I looked at the source code of the djangoproject.com site itself (for
me, should use the best practices), and what a surprise : django-
regi
i see,thanks.
On Mar 16, 11:41 am, Russell Keith-Magee
wrote:
> On Tue, Mar 16, 2010 at 11:34 AM, victor wrote:
> > how to set multi natural_key dependincies?
> > Model code as following:
> > class Menu(models.Model):
> > mName = models.CharField(max_length=256)
> > mTitle = models.CharFie
Here's a link to the document how to handle intermediary model of
ManyToManyField using the "through" argument for the Django admin
site.
http://docs.djangoproject.com/en/dev//ref/contrib/admin/#working-with-many-to-many-intermediary-models
Is there something similar for forms created from a model
Hey all,
I'm a RoR guy who came over to Django because I like Python more then
Ruby. That and Rails is like 70% DSL and Django is alot more Python
then DSL.
With that being said...
1) What's up with the lack of db schema migration!!?? That's really
half-assed. What's the point of an ORM if you h
waugust wrote:
Hey all,
I'm a RoR guy who came over to Django because I like Python more then
Ruby. That and Rails is like 70% DSL and Django is alot more Python
then DSL.
With that being said...
welcome
1) What's up with the lack of db schema migration!!?? That's really
half-assed. What
On Fri, Mar 19, 2010 at 10:16 PM, sebastien requiem
wrote:
[...]
>
>> 2) No Gems. Why not have a central repository that tracks middleware
>> and its versioning?
>> Seems like a crap-shoot to use middleware if you don't know if its
>> being utilized, updated, or buggy.
>>
>
> I guess that lookin
Thanks for your help, Rolando and Sebastien!
On Fri, Mar 19, 2010 at 7:45 PM, Rolando Espinoza La Fuente <
dark...@gmail.com> wrote:
> On Fri, Mar 19, 2010 at 10:16 PM, sebastien requiem
> wrote:
> [...]
> >
> >> 2) No Gems. Why not have a central repository that tracks middleware
> >> and its
FYI : here is the code for doing the registration process, with
confirmation email.
http://peyman-django.blogspot.com/2010/03/full-easy-authentication-using.html
On Mar 20, 12:55 pm, Peyman wrote:
> Thank you for your reply.
> After having a look at its code, it seems that django-registration
> p
On Sat, Mar 20, 2010 at 9:55 AM, Peyman wrote:
> Thank you for your reply.
> After having a look at its code, it seems that django-registration
> provides the signup feature, and uses contrib.auth for the rest.
>
> I looked at the source code of the djangoproject.com site itself (for
> me, should
Thanks for all your replies. I ended up using sorl-thumbnail, which I
had already installed, but I didn't think it kept aspect ratio of
image because you are required to enter w and h for thumbnail image
size using ThumbnailField. A quick test shows that it resizes and
keeps same aspect ratio. So,
On Fri, Mar 19, 2010 at 10:19 PM, mbdtsmh
wrote:
> This makes alot of sense and works in my case - many thanks.
>
> However, still unclear as to how to specify which table should be
> created in which database when you do want to syncdb to both
> databases. I may have 2 tables in models.py that I
On Fri, Mar 19, 2010 at 9:16 PM, cool-RR wrote:
> Hello Django community,
>
> I have started compiling a list, "Common causes for translation
> problems". Where would be a good place to put this list so people who
> have a problem with their translations will be most likely to
> encounter it?
Dep
75 matches
Mail list logo