sions, but hey
-- if it works, it works.
Owen Nelson
On Tue, Aug 31, 2010 at 12:38 PM, Karim Gorjux wrote:
> Try to modify the flatpages source! You can find it directly in your
> django installation.
>
>
> --
> Karim Gojux
> www.karimblog.net
>
> --
> You re
The meta class instance is accessed through ClassName._meta -- not
ClassName.meta
I tried this when I got back last night and had (other) issues myself, so
this might not be the right approach anyway.
--
You received this message because you are subscribed to the Google Groups
"Django users" gro
Sorry to be guessing here, but I was looking at something similar recently.
My attempt (untested at this point) would be something like:
from copy import copy
class NewFlatpage(FlatPage):
_meta = copy(FlatPage._meta)
_meta.verbose_name_plural = "foo"
--
You received this message because
Sounds good. Thanks for the advice!
--
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 this group, send email to
django-users+unsubscr...@googlegroups.com.
Fo
> With the hack i think you mean, it doesn't matter, just pick one, the
> point of the hack is you just shamelessly lie to the django ORM. So make
> sure to make your model ummanaged and _don't_ try to save.
>
Excellent. Yeah, I'd been planning on overriding save() to make it raise
NotImplemented
Something I've seen that isn't particularly well documented (if at all)...
If you have a model that isn't in your foo.models (ie, the top models.py
for the app), and have a package setup, you need to add an app_name
property to your model classes.
Example
myproject/
foo_app/ <-- needs to be in
The comments are already ordered... by pk I assume, which would mean
they are also ordered by date (unless you're messing with the comment
id's or the dates themselves).
If you simply want to switch the order from ascending to descending,
maybe try the "reversed" parameter for the "for" tag:
http:/
Opps! Since it's an alias, you need to tell apache what server location
to map.
For example, if you want http://localhost/ to map to your application:
WSGIScriptAlias / /path/to/my/wsgi/my.wsgi
Or if you wanted http://localhost/myapp to map instead
WSGIScriptAlias /myapp /path/to/my/wsgi/my.wsgi
-
The WSGIScriptAlias directive should point directly to the wsgi script
-- in your case the line should read:
WSGIScriptAlias /home/carlo /home/carlo/mysite/django.wsgi
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, s
I came from a job where I had been crafting applications using zend
framework - probably the closest thing php has to django. The more object
oriented my php code became, the more it looked, and smelled, like java.
I ended up taking a new job, where my projects started to have dependencies
on othe
Although, I guess you could argue that a proxy class with a @property method
could achieve the same thing.
from django.contrib.auth.models import User as DjangoUser
class User(DjangoUser):
class Meta:
proxy = True
@property
def is_new(self):
return None == self.last_log
I guess it depends on the implementation of the auth backend you're using.
Really though, it seems like using a bool flag involves less "magic", and is
perhaps more descriptive than making assumptions based on timestamps.
if user.is_new: redirect(somewhere)
rather than...
if user.last_login is Non
> it does feel a little bit dirty to me.
Me too, that way leads to deciding something is a witch just because it floats.
Can't argue with a Bool, and also, it might eventually be nice to be able to
flip the bit on a whim (say a user wanted that "out of the box" experience all
over again).
--
That would be the strategy I'd employ - however I'd recommend you not
add the field to the user itself, but rather its profile.
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
--
You received this message because you are subscribed to the Google Groups
Tim Shaffer wrote:
> I haven't tested this at all, but maybe try putting all the tagging
> stuff, include {% load tagging_tags %}, in a separate template, then
> wrapping the if statement around an include for that template:
>
> {% if object.tags %}
> {% include "tag_stuff.html" %}
> {% endif %}
15 matches
Mail list logo