2008-8-6

23:32 Magus-
ascii1011: do this - import django
23:32 Magus-
then django.get_version()
23:32 clad007
Magus-: I am using the SVN version
23:33 ned
when i change tips.user to tips.name it says name_id not found.
23:33 clad007
Magus-: as regards __unicode__, what do you mean exactly?
23:33 Magus-
ned: you can't do self.name in __str__ obviously
23:33 Magus-
ned: Tips has no name
23:33 Magus-
ned: if you want to show the user, do return str(self.user) or such
23:33 ascii1011
magus-: returns this: u'1.0-alpha-SVN-8194'
23:33 Magus-
although you should NOT be using __str__ in svn
23:33 Magus-
ascii1011: ok good
23:33 Magus-
ascii1011: what if you do this: Poll.objects.all()[0]
23:34 ned
magus- why does it even need a name?
23:34 ascii1011
returns same answer
23:34 Magus-
ned: because you're telling it to use self.name@!
23:35 Magus-
it doesn't actually need one
23:35 Magus-
but you're telling it to look for that
23:35 Magus-
so obviously it dies when it doesn't have one
23:35 Magus-
line 20 in your paste
23:35 ned
ahh i'm an idiot
23:35 Magus-
ascii1011: how about unicode(Poll.objects.all()[0])
23:35 Magus-
shouldn't be required, but worth a test
23:36 vicvicvic
if i have an instance specified for a modelform, can i access that instance in a template?
23:36 Magus-
vicvicvic: why?
23:36 vicvicvic
i want to output stuff about it
23:36 Rambling
I've created some permissions on a model using its Meta class. How do I specify those permissions in my permission_required decorator?
23:36 Rambling
Modelname.Permission?
23:37 ascii1011
magus-: returns : u'Poll object' ... this thing really hates my objects:)
23:37 ned
all fixed, thanks magus- :)
23:37 clad007
Magus-: as regards __unicode__, what do you mean exactly?
23:37 vicvicvic
more precisely, i have an imagefield in my model, and it would be nice to display the image next to the fields...
23:37 Magus-
ascii1011: test to make sure your files don't have tabs instead of spaces or anything
23:37 Magus-
I've seen some editors cover up issues there on copy/paste
23:37 ascii1011
will do
23:38 Magus-
Rambling: no, app_label.permission_name
23:38 Magus-
the model name is never involved unless you use it in the perm name
23:38 Rambling
So I can create permissions in the model's Meta class, but they're accessible through the app name?
23:39 Magus-
yes, they're not tied to the model at all
23:39 Rambling
Thanks.
23:42 clad007
Magus-: as regards __unicode__, what do you mean exactly?
23:42 ascii1011
magus-: took out all spaces, tried Poll.objects.all(), Poll.objects.all()[0], unicode(Poll.objects.all()[0]) again, with the same result. could this be something more rudimentary like i forgot to install something?
23:42 Magus-
ascii1011: no
23:42 Magus-
clad007: about what?
23:43 Magus-
clad007: if you mean 'how could I have messed it up?' there's too many ways to say
23:43 Magus-
so pastebin your code
23:44 clad007
Magus-: I just followed the tutorial. I have "poll objeect" instead of poll titles in the poll list
23:44 kanyukuk
23:44 clad007
Magus-: you told me it might be related to unicode
23:44 Magus-
grr, wrong button
23:44 ascii1011
clad007-: does your code look like this? http://dpaste.com/69882/
23:44 ascii1011
:)
23:45 Magus-
clad007: and the tutorial shows a __unicode__
23:46 clad007
Magus-: I don't have any def __unicode__ line
23:46 Magus-
then you didn't follow the tutorial, did you? :)
23:47 Magus-
23:47 Magus-
down slightly from there
23:50 neybar
I have a model, then in that model I'm registering it with admin.site.register(Model). The Admin works great. The problem is when I go to use that Model in a view. from mysite.models import Model. Then I get an error about the model Model is already registered.
23:50 Rambling
I see permissions in the admin interface for creating, updating, and deleting objects. Are these only for the administration interface?
23:50 Rambling
If I want to restrict deletion of an object by the end user, should I define a can_delete permission of my own?
23:50 Magus-
neybar: because 'appname.models' should be 'projectname.appname.models'
23:50 Magus-
and register calls go in admin.py normally
23:51 Magus-
Rambling: you can use them for anything you want
23:51 Rambling
Magus-: what are their code names?
23:52 neybar
Magus-: thanks. I was shortcutting the projectname.
23:52 Magus-
Rambling: probably stuff like app.change_model
23:52 Magus-
or delete_model or add_model
23:52 jedoig
hey guys
23:53 jedoig
any of you guys have a blogging application you would reccomend?
23:53 jedoig
...other than coltrane
23:54 Glenjamin
most recommendations i've seen say its worthwhile building your own
23:55 Glenjamin
http://www.b-list.org/weblog/2007/nov/29/django... <- this is worth a read on the subject
23:55 vicvicvic
uh, is there at least any way to just get the value of a field in a template?
23:55 vicvicvic
not the widget
23:56 vicvicvic
or, well, i guess i could make an "imgwidget" which displays itself as an <img>-tag
23:56 vicvicvic
:T
23:57 wattz
not getting any help in #python, may i ask a python question here?
23:58 Rambling
Magus-: You're right, they're of the form delete_model, add_model, change_model.
23:58 wattz
here goes.
23:58 wattz
here is my error from SOAPpy's setup.py: http://dpaste.com/69890/
23:58 Magus-
yah, no
23:58 Magus-
that's not a django issue at all :)
23:58 Magus-
go bug soappy people :)
23:59 wattz
im actually trying to use this to write my SOAP handler for django
23:59 Magus-
it looks like they broke it
23:59 Magus-
that's nice
23:59 Magus-
its still not something we can fix, its their code :)
23:59 Glenjamin
try easy_install?
23:59 wattz
Glenjamin: it couldnt find it
Page 41 of 41   ← Previous  (4,088 total)