I am relatively new to django. I've been reading the docs endlessly
and hacking to try to get something to work, but I'm hoping to not re-
create functionality that either exists or is part of the framework.
I have a class named UserProfile that I'd like to use to extend the
User object. I set it
Do django developers use the Form API any time form elements need to
be displayed to users? Or do you just code the form yourself in the
templates and manually process them for smaller forms?
In general, is it always better to use the Form API for any form you
display, regardless how simple, becau
Try something like this:
users = User.objects.filter(job__done=False).annotate(Count('job'))
Then each object returned will be a 'User' object with a property
named 'job__count'
ex:
users[0].job__count
On Aug 29, 5:17 am, muzhig wrote:
> Hello!
> I have model Job, that is linked to User.
No it shouldn't be dependent on anything like that.
Im curious to know what the issue is for you. I know this might be a
pain in the butt, but if you could put together a small sample program
that demonstrates something like this, I would be more than happy to
help you debug through it.
On Aug 28,
I do most of the html code for my django templates in PyCharm and just
write the code by hand. I've been evaluating WYSIWYG html/web
designers recently (Dreamweaver). But, I find myself using the 'split'
mode of Dreamweaver where I write the code and watch the auto-updating
visual editor. But i don
Hi,
You're trying to cache a pdf file/attachment? why? What's the purpose
of trying to do it that way? Why don't you just send it to the client
when they ask for it?
Also, there's no way on the server to 'force' content to be cached on
the client. The browser has to specifically allow it. All I c
I'm not sure I completely understand your question, but let me provide
an answer and maybe that'll get us started on the right track.
For the dynamic parts of the application, you could absolutely use
django and view methods/classes to return json/xml or whatever data
format you use. The data can
I'm trying to understand the best way to redirect a user to their
profile once they successfully login to the application.
I'm using django-profiles to manage a custom user profile. By default,
the redirect url is specified in settings.py as LOGIN_REDIRECT_URL.
However, the url entry in the django
Yes, you will want to do this within the __init__ method.
Run the super class's init method first so that everything's
initialized as normal.
Then you will have to grab the field for that instance within the
__init__ method (self.fields['vaihtoehdot']) and set the choices
property for it.
On M
so, is that what you wanted? sounds like when the user is done with
the session, and they navigate away (by closing the browser or closing
the tab which browser are you using btw, chrome?), then the
session closes as is indicated by the SESSION_EXPIRE_AT_BROWSER_CLOSE
setting. Isn't that what y
Create a different ModelForm that contains your readonly fields (and
populate them however you want) and set this on your ModelAdmin form.
See the ModelAdmin.form option in the docs.
https://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-options
On Jun 7, 6:01 am, mf wrote:
> Let
lds': (('id', 'fecha_emision', ), ('obra',
> 'num_pres_ext',),
> 'proveedor', 'descripcion', 'observaciones',
> 'importe_contratado',)
> }),
> )
> readonly_
Looks like you may have literally just uncommented the line without
replacing the {{project_name}} token with what your project name
really is. Did you use django-admin.py startproject to create the
project?
After doing so, use manage.py startapp to create the app.
See the django tutorial for more
Are you using your own fixtures (like initial_data.json)?
Is it possible that in your initial_data.json ( or whatever fixture
you're using) that you're including entries into the content_types
table? You should probably remove that from your fixtures and let
django build the content types dynamical
Yes, it is. Any reason why you want the content-types to be part of
your fixtures? Why not let django build that up by itself?
On Jun 14, 1:21 am, Amit Sethi wrote:
> On Tue, Jun 14, 2011 at 1:41 AM, christian.posta
> wrote:
> > Are you using your own fixtures (like initial_data.j
14, 10:06 am, Amit Sethi wrote:
> On Tue, Jun 14, 2011 at 8:00 PM, christian.posta
> wrote:
> > Yes, it is. Any reason why you want the content-types to be part of
> > your fixtures? Why not let django build that up by itself?
>
> Well essentially it was just a dumpdata
Forgive me if this might be more of a python-centric or text-handling
question more than Django, but it does come up within the context of
web development, processing user input, etc in all web frameworks
including django. I did a quick search on the forum and couldn't find
an answer. (I've also go
Awesome, I'll take a look! Thanks!
On Jul 26, 9:38 am, Kirill Spitsin wrote:
> On Tue, Jul 26, 2011 at 07:19:46PM +0300, Kirill Spitsin wrote:
> > On Tue, Jul 26, 2011 at 08:48:24AM -0700, christian.posta wrote:
> > > For user input, I would like to format what th
Is this something that can work for you?
https://docs.djangoproject.com/en/1.3/ref/models/options/#order-with-respect-to
If not, then the only thing i can do is recommend you review the
source code for how the ordering happens in the admin module for a
model.
The main spots to look at would be t
It's possible I'm a little slower this morning, so could you help me
understand what you mean?
What do you mean you want to use the index for the filename instead of
the pk?
On Jul 28, 7:36 pm, Jonathan of Cambridge wrote:
> I've been working on using django-filetransfers.
>
> Curious whether it
If you point me to exactly what part of the tutorial shows Choice
objects being saved instantaneously, I can explain it to you.
On Aug 3, 5:36 pm, Gall wrote:
> I'm working through the introductory tutorial @ djangoproject.com. Why
> does the poll object require an explicit save() call, while cho
where did you read that?
you don't say it explicitly, but i'm guessing you're trying to change
the way things are edited/displayed within the admin application?
On Aug 4, 3:29 am, Hayyan Rafiq wrote:
> Hi i read that
> "By default, the admin application will look for a template in several
> plac
Which session are you losing?
The django authenticated session, or the facebook session?
On Jan 29, 10:30 pm, CrabbyPete wrote:
> I managed to log into facebook using the graph api, I store the FB id
> and tie it to a User, like this
>
> class FacebookUser(models.Model):
> user = m
Does latest()[0] work exactly as the original poster was looking for?
latest() works based on a date field, not the pk field (which *could*
return a result different than expected).
Tom's approach, explicitly ordering by pk, would work exactly as
desired.
On Feb 23, 6:08 am, Mike Ramirez wrote:
Your template file checks to see whether a variable named
"latest_poll_list" exists.
I don't see anywhere in your views where you add this to your context.
Look at part 3 of the tutorial about half way down. They add the
"latest_poll_list" object to the Context that gets passed to your
template. Tr
I would like to get some feedback on how others display the version of
their apps to the users of the app.
I tag each build/version of the app in SVN when I deploy to my
clients, but i'm trying to figure out a good way to report that tag
name. I could manually try to put it into the settings.py mo
Thank you so much for the suggestion. I did find the python-svn
bindings and came up with a fairly cogent solution. I blogged about it
here: http://www.christianposta.com/blog/?p=74
On Apr 2, 8:53 pm, Aryeh Leib Taurog wrote:
> On Apr 2, 1:42 am, "christian.posta"
> wrote:
>
27 matches
Mail list logo