Hello,
Suppose I get an object from a non-default database:
ob = MyModel.objects.using('somedb').get(pk=1)
Is it possible later to retrieve the database name just from the object?
ob.db??
Regards,
Juan Pablo
--
You received this message because you are subscribed to the Google Groups
My fault. I was testing from the console. Within an actual test the
request does have the templates.
Juan Pablo
El día 28 de agosto de 2011 17:50, Juan Pablo Romero Méndez
<jpablo.rom...@gmail.com> escribió:
> Hello,
>
> I'm using the django test client, like this:
>
>&g
Hello,
I'm using the django test client, like this:
>>> c = Client()
>>> r = c.get("/content/new/")
>>> r.status_code
200
>>> r.templates
[]
Is this normal?
Regards,
Juan Pablo
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Thanks for the feedback Gelonida!
2011/8/9 Gelonida N <gelon...@gmail.com>:
> On 08/09/2011 03:33 PM, Juan Pablo Romero Méndez wrote:
>> Hey guys,
>>
>> This is the first part of a series of blog posts I'm writing about
>> class based generic views:
>>
>
Hey guys,
This is the first part of a series of blog posts I'm writing about
class based generic views:
http://pseudocorta.blogspot.com/2011/08/django-generic-views.html
Cheers!
Juan Pablo
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
Hello,
I've just put a very rough prototype of a db.models.Manager that
allows queries to be specified with lambdas:
Choice.objects.where(lambda c: c.votes >= 1)
Choice.objects.where(lambda c: c.votes != 1)
Choice.objects.where(lambda c: c.poll.question.exact('aaa'))
Choice.objects.where(lambda
Hello,
I'm trying to use a custom javascript file in the admin app with Media:
class MyAdmin(admin.ModelAdmin):
class Media:
js = ('js/my.js',)
the problem is that after installing the staticfiles app (in
INSTALLED_APPS) and after setting STATIC_URL = '/media/', the admin
app is
I think i solved it. This is the chain of method calls of admin.ModelAdmin:
...
change_view
get_form
formfield_for_foreignkey
...
get_form receives the current object as parameter, so all I had to do was to
inject obj in the request:
def get_form(self, request, obj=None, **kwargs):
Hello,
Is it possible to obtain a reference to the modified object
in ModelAdmin.formfield_for_foreignkey?
Thanks!
Juan Pablo
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Ok, I learned about ModelAdmin.formfield_for_foreignkey, which let's me
access the current user.
What I can't find now is the instance asociated the db_field parameter.
El 3 de mayo de 2011 14:19, Juan Pablo Romero Méndez <
jpablo.rom...@gmail.com> escribió:
> Hello,
>
> I wo
Hello,
I wonder if there's an easy way to do the following (besides modifying
"contrib.admin.templates.admin.includes.fieldset.html"):
I have a model which uses django-workflows, so for each instance and every
user I can do: get_allowed_transitions(obj,user), and
obtain a list of Transition
For this, django-google-toolbar is invaluable. It tells you exactly which
templates were used in rendering some url.
Coupled with pycharm's "find file by name" feature (Ctrl+Shift+N) it names
really easy to jump to any name file.
Regards,
Juan Pablo
2011/5/3 Rich
>
Hello,
I'm developing several personalized admin sites (by subclassing
admin.ModelAdmin).
Is it possible to use different Field.choices in a particular field
for each admin site?
The problem is that the choices option is set within the model
definition, not in the ModelAdmin.
Regards,
Juan
Hello,
Is it possible to create unidirectional relations within django's orm?
What I mean is a situation where a parent has a children_set of
references to children, but the children don't have any reference to
the father.
Regards,
Juan Pablo
--
You received this message because you are
Chequen este sitio web que estamos lanzando, a ver que les parece:
http://www.quetanprincipeeres.com.mx/
Saludos,
Juan Pablo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
I remember that there were some issues, but unfortunately I didn't
document how I resolved them :(
Juan Pablo
2009/7/14 Kevin <hekevint...@gmail.com>:
>
> Thanks a lot Juan! It works fine on my machine. Would you be able to
> share your compilation steps?
>
> On Jul 14
Mhh... I don't fully understand your question. Regarding the radio
buttons I think it is in the tutorial.
What search fields are you talking about?
Juan Pablo
2009/7/8 Divesh Gidwani :
>
> Hey,
>
> Newbie to Django, and have just finished part 2 of the tutorial on the
>
17 matches
Mail list logo