On Jan 12, 2006, at 5:38 AM, Adrian Holovaty wrote:
On 1/11/06, Cheng Zhang <[EMAIL PROTECTED]> wrote:
class Entry(meta.Model):
submission_user = meta.ForeignKey(users.User)
class Friend(meta.Model):
myself = meta.ForeignKey(users.User, related_name="myself",
verbose_name="m
Hello,
a simple question for the experts: if I need a publishing workflow
(usual stuff: author, editor, approver, etc. etc.) within a Django app,
I've to build everything from scratch or I've some library helper?
Thanks for your time.
Ciao.
Marco.
Time: the only thing that taken up can't be retur
On 1/11/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
On 1/11/06, Colleen Owens <[EMAIL PROTECTED]> wrote:> My latest question - I want to have some settings that apply to an> application (not the objects within that application's model but to the
> application as a whole). For example, I want to
Adrian Holovaty wrote:
> On 1/12/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
>>On Jan 12, 2006, at 8:09 AM, Simon Willison wrote:
>>
>>>Maybe it would be useful for all Django model objects to gain
>>>themselves a duplicate() method which does exactly this - returns
>>>an identical object
akaihola wrote:
Ok, I'll take a look at the _pre_save() mechanism. By the way, isn't
that one of the things changing in magic-removal branch?
Yes, it goes away. Instead one would be able to override save() and do
everything in it.
I still wonder about the default values question though.
I see. I'll try to work around it somehow.
Thanks,
Mike
On 1/12/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
> On Jan 12, 2006, at 8:09 AM, Simon Willison wrote:
> > Maybe it would be useful for all Django model objects to gain
> > themselves a duplicate() method which does exactly this - returns
> > an identical object but with id set to None.
>
>
It seems that _pre_save() is never called if the manipulator catches
missing fields. So customizing the manipulator seems to be my quick fix
after all.
I also checked the manipulator objects' attributes, and default values
defined in models don't even end up there. So it might require quite a
few
Jeremy Dunck wrote:
> On 1/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > think adodbapi DOES use parameterization. It's just slightly
> > non-standard. (thus, the %s -> ? stuff above)
>
> I was surprised by this, by the Python DB API allows for parameters in
> the string supplied to the
Hi Rich,
On 1/12/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> The pymssql driver only supports DB-LIB, which is way outdated and you
> wont have access to functionality added to MSSQL after version 6.5.
> This is not the best option IMHO.
Yeah, spoke too soon.
The adodbapi seems the way forward f
Ok, I'll take a look at the _pre_save() mechanism. By the way, isn't
that one of the things changing in magic-removal branch?
I still wonder about the default values question though.
I tried to create a Django object in an interactive Python shell, and
the fields are indeed filled with default
On 12 jan 2006, at 15.40, Grigory Fateyev wrote:
Hello!
In my project need lots of time to create class Category for any apps
(news, faq, clubs) and now whant to create global class Category that
will many-to-one for other classes. How this class can be done?
Put your Category model in a sep
On 1/12/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
> On 1/12/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> > The pymssql driver only supports DB-LIB, which is way outdated and you
> > wont have access to functionality added to MSSQL after version 6.5.
> > This is not the best option IMHO.
>
> Ada
On 1/12/06, Rich Bakos <[EMAIL PROTECTED]> wrote:
> The pymssql driver only supports DB-LIB, which is way outdated and you
> wont have access to functionality added to MSSQL after version 6.5.
> This is not the best option IMHO.
Adapter class over adodbapi where supported, falling back to pymssql
Jeroen Ruigrok van der Werven wrote:
Hi Jeroen,
> Can a bunch of us get together to get a/the pymssql driver fully
> operational and Django running as it should?
The pymssql driver only supports DB-LIB, which is way outdated and you
wont have access to functionality added to MSSQL after versio
On Jan 12, 2006, at 8:09 AM, Simon Willison wrote:
Maybe it would be useful for all Django model objects to gain
themselves a duplicate() method which does exactly this - returns
an identical object but with id set to None.
+1 -- obj.copy() might be a better syntax to mimic dict.copy().
Ja
Simon Willison wrote:
Maybe it would be useful for all Django model objects to gain
themselves a duplicate() method which does exactly this - returns an
identical object but with id set to None.
There is still complication for non autofield primary key. And it's just
3 lines or under.
--
Hello!
In my project need lots of time to create class Category for any apps
(news, faq, clubs) and now whant to create global class Category that
will many-to-one for other classes. How this class can be done?
Or this is not good idea?
--
Всего наилучшего!
greg [at] anastasia [dot] ru Григор
I should clarify that my project does work when I run Django's server.
On 12 Jan 2006, at 05:43, Eric Walstad wrote:
The following approach ('shallow' copy) has worked well for me:
import copy
b = copy.copy(a)
b.id = None
b.save()
Maybe it would be useful for all Django model objects to gain
themselves a duplicate() method which does exactly this - returns an
>> have you created any models in ~/models/resumes.py?
Yep, I have a Resume model in /modes/resumes.py
On 1/12/06, Adrian Holovaty <[EMAIL PROTECTED] > wrote:
>
> You can do it in two queries:
>
> my_friends = friends.get_list(myself__exact=my_id)
> entries.get_list(submission_user__in=[f.id for f in my_friends])
If you are using the magic-removal branch, there is an alternative
approach that onl
akaihola wrote:
So, if I'm not mistaken, the default values for a model's fields are
not used when saving an object,
They are used to prefill form elements in the Admin (don't know about
custom forms though, never tried). So it's just a hint for the user.
and I must create a custom manipul
In the admin interface, I can't omit fields from "admin =
meta.Admin(fields=...)" even if they do have default values. If I do
that, I get errors for required fields.
In my own forms, I first assumed I could just leave out fields with
default values in the model, but my form.error_dict gets fille
24 matches
Mail list logo