I use such way to get around that. Don't know is there any better
ways to do it though.
def is_mutual_friend(friend):
"""
Test whether myself and friend is mutual friend, which means we both
are in each other's friend list
"""
# The next line can't be moved to the top of the file
We discussed a bit about this topic in our project as well.
Surely that's one way to do it, or maybe the only practical way we
could come up with. But the problem is once you support more than 2
languages, keeping schema in sync will become a headache and
definitely not DRY.
- Cheng Zhang
On 1/10/06, Greg <[EMAIL PROTECTED]> wrote:
And I could put the import insidemy method, but that's not ideal either. Any thoughts? The local import is the solution I usually fall back on.
Is this arestriction that will be lifted by the magic removal branch? Yes. The problem you are experiencing
Maybe you should set the module instance in module_constants property,
it's described at model-api document in META options section. Or just
like what Cheng Zhang shown to import the module in the function
scope.
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://gr
We discussed a bit about this topic in our project as well.
Surely that's one way to do it, or maybe the only practical way we
could come up with. But the problem is once you support more than 2
languages, keeping schema in sync will become a headache and
definitely not DRY.
- Cheng Zhang
On Tuesday 10 Jan 2006 9:51 am, Mike wrote:
> but necessary enough. The point I was making was, what's the
> difference between a primary key vs. any other unique field?
database design mandates that every row in a table must be unique.
Where there is a serial data type as the primary key, this
On 1/10/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> The params are being passed in as a format string style (%s), which MS
> SQL chokes on.
Can you clarify exactly what you mean here? What SQL are you getting,
and what are you expecting (or what would work)?
If you feel like having a poke around
(I accidentally sent this to the developers list before)
Hi,
In my model I have the field:
created_by = meta.ForeignKey(
User,
verbose_name='created by',
editable=False,
blank=True,
null=True
)
and the module method below to create a "validated" objec
Anyone familiar with this error running Apache and SQLite?
SQLite objects created in a thread can only be used in that same thread
On 1/10/06, Greg <[EMAIL PROTECTED]> wrote:
> So I hacked
> DatabaseWrapper.quote_name so that it doesn't quote periods, but is
> that the "right" way to handle this or is it an ugly hack? It seems to
> work very well, but it feels like it might be cleaner to add a
> db_schema attribute or somethi
On 1/9/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> I am experimenting with Django and MS SQL and it appears that Django is
> passing parameters to MS SQL in an incorrect format.
>
> The params are being passed in as a format string style (%s), which MS
> SQL chokes on.
Hey Rich,
The Django MS SQ
Hi Russ,
Thanks for th tip on where to splunk for the offending code.
The SQL that is arriving at the sever is in the folowing format:
select foo from bar where foo = %sfooName
The query parser dies at %s with an invalid syntax exception...
The syntax that MS SQL expects:
select foo from bar w
On 1/10/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
> The Django MS SQL support is still in alpha status, mostly because we
> don't have many people who've tried to use it with MS SQL. We're very
> keen on getting that driver up to speed, though, and you can help.
Which version of MS SQL do you
On 1/10/06, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote:
> Which version of MS SQL do you initially want to target Adrian? I can
> probably get some basic testing done here to clear the majority of the
> issues.
Thanks for the offer! Knowing next to nothing about MS SQL, I don't
have
On Tuesday 10 Jan 2006 8:20 pm, Jeroen Ruigrok van der Werven wrote:
> Which version of MS SQL do you initially want to target Adrian?
best to target the latest open source version
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
On 1/10/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> The syntax that MS SQL expects:
> select foo from bar where foo = @fooName
Are we talking about literals or parameters?
That is, are you expecting:
select colname from tablename where colname = 'somevalue'
or
select colname from tablename whe
On 1/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> On Tuesday 10 Jan 2006 8:20 pm, Jeroen Ruigrok van der Werven wrote:
> > Which version of MS SQL do you initially want to target Adrian?
>
> best to target the latest open source version
I assume you're being ironic there.
The majority
On Tuesday 10 Jan 2006 8:39 pm, Jeremy Dunck wrote:
> > best to target the latest open source version
>
> I assume you're being ironic there.
>
> The majority of users are on SQL Server 2000. A significant
> minority are on 7. A tiny minority still use 6.5. And in a
> year, a significant minori
On 1/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> and which is opensource? and if it is not, why waste our time?
>
If you're going to take that position, I think you mean Free.
But we're not wasting your time, we're wasting ours. Feel free to
ignore the discussion.
Hey all,
My first post and I wish it was something positive (and maybe a little
shorter). I'm migrating from winXP to linux(Fedora4) and I'm at a
loss. First off everything works perfectly from the dev server -
'dango-admin.py runserver'.
I see my app(really just the tutorial 'polls' at this p
On Tuesday 10 Jan 2006 9:06 pm, Jeremy Dunck wrote:
> On 1/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > and which is opensource? and if it is not, why waste our time?
>
> If you're going to take that position, I think you mean Free.
>
> But we're not wasting your time, we're wasting our
On Tuesday 10 Jan 2006 9:08 pm, Hale wrote:
> This was so easy on winxp, and I'm not the linux expert
if you are new to linux i would suggest mandriva
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
On 1/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > The majority of users are on SQL Server 2000. A significant
> > minority are on 7. A tiny minority still use 6.5. And in a
> > year, a significant minority will be using 2005.
>
> and which is opensource? and if it is not, why waste our
On Tuesday 10 Jan 2006 9:24 pm, Adrian Holovaty wrote:
> On 1/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > > The majority of users are on SQL Server 2000. A significant
> > > minority are on 7. A tiny minority still use 6.5. And in a
> > > year, a significant minority will be using 2005
On 1/10/06, Hale <[EMAIL PROTECTED]> wrote:
> >From the errors you'd think I was spelling something wrong in my
> settings.py - but it wouldn't work from the dev server would it? I was
> thinking permissions - so I chmod/chgrp/chown'd so much I don't even
> remember what it was before :-) I star
On 1/10/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> sorry, adrian, i dont agree - there is a limit to pandering to these
> ppl - i think that open source is now powerful enough to start
> demanding that these ppl respect our terms. anyway - i think you
> should spend more time on what you d
David S. wrote:
> Anyone familiar with this error running Apache and SQLite?
>
> SQLite objects created in a thread can only be used in that same thread
The restriction is due to a bug found in many versions of Linux
(ex: Redhat 9) which prevents a fcntl lock created in one thread
from being re
Jeremy Dunck wrote:
I'm philosophically in line with much of the Free philosophy, but FSF
didn't decide not to run on Unix while developing the tools to replace
it; some compromises are necessary. There exists a huge install base
locked into MS SQL; denying django to those folks won't help the
On Tuesday 10 Jan 2006 9:46 pm, Jeremy Dunck wrote:
> I'm philosophically in line with much of the Free philosophy, but
> FSF didn't decide not to run on Unix while developing the tools
> to replace it; some compromises are necessary. There exists a
> huge install base locked into MS SQL; denying
On Tuesday 10 Jan 2006 9:57 pm, Dody Suria Wijaya wrote:
> > Nonviolence is the way. ;-)
> >
>
> +1
>
> $_$
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
Django supporting MSSQL strikes me a bit like iTunes running on
Windows. As in it's a great thing for the platform. If somebody locked
in to a MSSQL environment has the chance to try a real project with
Django and be exposed to great, useful open-source software that
doesn't turn its nose up at th
On Tuesday 10 Jan 2006 10:10 pm, Wilson wrote:
> Django supporting MSSQL strikes me a bit like iTunes running on
> Windows. As in it's a great thing for the platform. If somebody
> locked in to a MSSQL environment has the chance to try a real
> project with Django and be exposed to great, useful o
On 1/10/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
> Nonviolence is the way. ;-)
Or, as Voltaire said over 200 years ago:
"The perfect is the enemy of the good."
(Well, okay, maybe he didn't say it in English.) :-p
Kenneth,
> maybe i was jumping to conclusions - what i am saying is that a
> rdbms has the capacity to implement a lot of business logic within
> the rdbms itself, so one should attempt to put the maximum of the
> business logic there, where it will be looked after by the db
> itself rather than
Dody,
Thanks for your clear explanation.
Regards,
Mike
Wilson wrote:
Django supporting MSSQL strikes me a bit like iTunes running on
Windows. As in it's a great thing for the platform. If somebody locked
in to a MSSQL environment has the chance to try a real project with
Django and be exposed to great, useful open-source software that
doesn't turn i
On 1/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
On 1/4/06, Colleen Owens <[EMAIL PROTECTED]> wrote:> I'm having trouble figuring out how to customize the appearance of a> foreign key that's edited inline in the admin interface. For example, if I
> wanted to change how the poll choices from t
Adrian,
Thanks and I got it. Just to document for people who come after me -
I did all these tests from within mod_python as well as outside it.
First off python version - from within mod_python and I looked all over
I can't find any other versions "2.4.1 (#1, May 16 2005, 15:19:29) [GCC
4.0.0
On 1/10/06, Colleen Owens <[EMAIL PROTECTED]> wrote:
> Thanks for the reply, Adrian. I want to be able to change the field order
> and which fields are displayed while I'm editing something inline. Changing
> the field order and which fields are displayed for the Choice model using
> the "fields"
>total waste of time - foss rulz - let them come to us
There are people having a real job and those might stumble over mssql
servers (I know for sure that I will from time to time) and they might
find it comforting to know that they can continue to use their
framework of choice. And no, they won
Adrian Holovaty wrote:
Hi Adrian,
> Could you paste the entire traceback you get? Also, would any other MS
> SQL users in the audience be able to help?
Here is an entire traceback I get when attempting to access the /admin
site:
Traceback (most recent call last):
File "C:\Python24\lib\site
Jeremy Dunck wrote:
Hi Jeremy,
> > The syntax that MS SQL expects:
> > select foo from bar where foo = @fooName
>
> Are we talking about literals or parameters?
I'm talking about parameters.
> That is, are you expecting:
>
> select colname from tablename where colname = 'somevalue'
> or
> sel
> [snip] Pysqlite2 is in an egg in the site-packages. This is
> the important part - mod_python doesn't like zipped eggs. Unzip it,
> did some cleanup of the easy_install.pth, restart apache, and it's all
> good.
Sweet! You just identified and fixed the problem with my one fancy
page--simple
On Jan 10, 2006, at 10:21 PM, Adrian Holovaty wrote:
On 1/9/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
I am experimenting with Django and MS SQL and it appears that
Django is
passing parameters to MS SQL in an incorrect format.
The params are being passed in as a format string style (%s),
On 1/10/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> Here is the exact SQL that is passed to MS SQL:
>
> SELECT
> [core_sessions].[session_key],[core_sessions].[session_data],[core_sessions].[expire_date]
> FROM [core_sessions] WHERE [core_sessions].[session_key] = %s
>
> As you can see, it has sto
> The restriction is due to a bug found in many versions of Linux
> (ex: Redhat 9) which prevents a fcntl lock created in one thread
> from being removed or modified in a different thread. Since
> SQLite uses fcntl-locks for concurrency control, running SQLite
> on a system that has the bug would
On 1/10/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
>
> On 1/10/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> > Here is the exact SQL that is passed to MS SQL:
> >
> > SELECT
> > [core_sessions].[session_key],[core_sessions].[session_data],[core_sessions].[expire_date]
> > FROM [core_sessions] WH
David S. wrote:
> So anyway, is it a reasonable assertion that if the app is actually to have
> more
> than 1 user--and in fact if it is going to run with Apache--then SQLite is
> right
> out?
No, trac for example uses sqlite, too and it runs fine. I don't know
about this particular behaviour,
> No, trac for example uses sqlite, too and it runs fine. I don't know
> about this particular behaviour, but maybe the sqlite faq will give you
> some answers about that.
> Are you creating a thread in your app that makes changes on your database ?
I am just using the Django ORM.
But I did fi
Jeremy Dunck wrote:
Hi Jeremy,
> Yeah, adodbapi was doing something weird with the executeHelper, so we did
> this:
Yeah I worked that out but haven't gotten too far. I had to make a
modification to function_get_sql_clause to support the MS TOP keyword.
Also had to modify method_save to provi
I have also had problems with editable=False.
See http://code.djangoproject.com/ticket/611
But in this case I do not think that you want that anyhow.
You can use the fields argument when you create your admin
object to only show what you want as in:
class META:
admin = meta.Admin(
field
On Tue, 10 Jan 2006 14:33:18 -0600 Adrian Holovaty wrote:
> The problem is that the SQL Server database backend (the "adodbapi"
> library) assumes placeholders use "?" for placeholders. So the Django
> layer needs to convert all "%s" placeholders in the query to "?".
>
> It looks like the curren
I use uft-8 encoding, and in admin page, when I insert a record, the Chinese character will become ?
David S. wrote:
No, trac for example uses sqlite, too and it runs fine. I don't know
about this particular behaviour, but maybe the sqlite faq will give you
some answers about that.
Are you creating a thread in your app that makes changes on your database ?
I am just using the Django ORM.
Hi
I am implementing such a function. I have a textarea that will be
inputted many characters, when they are showed in page, they will be
displayed in one line, very ugly.So I want to change the '\n' in the
texts to ''. I know this can be implemented by wysiwig editor(e.g.
tiny_mce), and I have
sorry.
I have got it resolved. Seems i was in a totally wrong direction.
please ignore this question.
>:) But in 2.3.X version, there are also have pygettext.py and
>msgfmt.py exist, in windows version. I have 2.3 and 2.4 version
>installed in my box.
On Debian the 2.3 installation doesn't include msgfmt.py AFIK. And
msguniq.py doesn't exist at all - as I wrote, we need _all_ those tools
and we n
>what are the best practices for translating content in the database,
>and storing that?
My current idea runs around just having tables that ForeignKey to the
primary table with the primary table carrying the "default language"
and the dependent table carrying other translations.
class Thing(met
On Wednesday 11 Jan 2006 12:50 pm, hugo wrote:
> class Thing(meta.Model):
> title = ...
> description = ...
>
> class TranslatedThing(meta.Model):
> thing = ForeignKey(Thing)
> language = CharField(... choices=settings.LANGUAGES)
> title = ...
> description = ...
> class META:
59 matches
Mail list logo