how can i properly append decorator to admin.ModelAdmin function (custom view function)...decorator takes first parameter (self, not request, as it is normal in view functions)?
daschel
meridiandev, nothing that I can think of specifically on those topics other than stackover flow and google :)
meridiandev
would you agree the best way might be to start with a TemplateView and make it do List/Detail first to learn the basics?
eagle2990
meridiandev: oh...now i get it...i mean...i thought that i had to do that for the 2 or more objects join
sPiN- joined the channel
meridiandev
don't overthink things : )
Sweetman joined the channel
(that's how i wound up accidentally making half a CMS.)
iggy joined the channel
daschel
meridiandev, your last comment seems reasonable, but im bouncing between a couple conversations, watching a movie, and am a bit less-than-sober, so it's hard to know for sure
eagle2990
daschel: i understoodthat so the commented lines will be in the views.py and obviously the rest in the template
daschel: the idea is that in that page you can see the details of the project (like name, description...) and also the notes, probably later i will join another model, but the idea is to join everything is just one thing...like some sort of dashboard
lvella
I am trying to migrate do Django 1.7, but the my initial fixtures for auth_group table no longer works.. it seems that my app models and fixtures are loaded before django auth models are created
daschel
ok, so on the dashboard you want a series of objects that will remain more or less constant?
stickperson has quit
constant between pages i mena
mean
scott_w joined the channel
eagle2990
yes
daschel
ok
well, what we want to do is use a context processor to pass these "standard" context objects to the view, then simplify your generic view. the point of generic views is to not have to write a bunch of code.
context processors aren't as scary as they sound
it's just a helper function that returns a context variable
scott_w has quit
generic views automatically receive all context data defined in your context processor list
so
in your app folder, create a file...let's be creative...call it....context_processors.py
eagle2990
done
honestemu joined the channel
honestemu
daschel: When I tried the solution you suggested, I get the error: blog is not a namespace. I think that has to do with how I am referring to the view in my template. Right now, I want the index view to show links to all of the blog posts I've ever created. They should link to the detail view of each blog post. I am identifying them based on the slug. So, I create the links using the following url function: <li><a href="{% url '
eraldo has quit
daschel
eagle2990, ok, now define a function (it doesn't matter the name, but pick something that makes sense) and just put "pass" as the first line so we can get things working.
eagle2990, now in settings.py, you need to modify TEMPLATE_CONTEXT_PROCESSORS. add your new context processor here, like "<app_name>.context_processors.<function_name>"
scott_w joined the channel
honestemu, you can just delete where it says name="blog" in the urls.py
nethop joined the channel
wait, im confusing myself. i dont know who im talking to anymore
eagle2990
daschel: ok i'm done
honestemu has quit
burhan joined the channel
daschel
ok, wel honestemu left, so that'll make things easier
ok, now what do you want to display in each view? or in other words, what do you want to pass to your dashboard?
heihei has quit
timtim joined the channel
burhan
its been a while since I visited the front end part of django, is there an application that can handle multiple user profiles + social authentication? I am finding one or the other, but not one that does both.
maybe I am missing something.
honestemu joined the channel
naro joined the channel
eagle2990
right now a project detail and that it loads all the notes related to it
daschel
burhan, allauth
timtim
is there any limitations to naming attributes in your model when it comes to using get_FOO_display() ?
daschel
eagle2990, wait, so the dashboard doesn't remain constant between projects?
burhan
I saw that, it will take care of the authentication; but not custom user profiles, I still have to handle that myself.
wenzhixue joined the channel
timtim: what's the problem you are facing?
mmcardle joined the channel
eagle2990
yeah...it's the same, as in if you pick project 1, it will show notes related to project 1
if you pick 2, you pick notes related to project 2
timtim
i have attributes with underscores which return nothing when i do {{ partner.get_my_attribute_display }} but {{ partner.get_status_display }} works
honestemu has quit
maryokhin joined the channel
if i do {{ partner.my_attribute }} it prints out the raw answer but in my model i'm following the examples of using tuples to do CharField
maryokhin has left the channel
wait, i'm pretty sure i'm an idiot
yeah my_attribute isn't doing the tuple thing for multiple choices so there is nothing to return
ekke85 joined the channel
stickperson joined the channel
thanks burhan ! if only i had asked earlier and thought about it i could have saved some time