2008-8-6

22:56 Magus-
but we don't know jack about app engine
22:56 Magus-
its completely different in many areas
22:56 Ced2
its a patch for django
22:56 Ced2
which is why i thought it was worth a shot, sure appengine is different entirely :)
22:56 Magus-
a 3rd-party, unsupported patch
22:56 Ced2
no arguments from me on that!
22:58 Ced2
i think it is a simple pythonpath problem, but im never too sure about how they shoudl all be setup
22:58 gcarrier
i'd like to declare many urlpatterns... is it possible?
22:58 Magus-
huh?
22:59 gcarrier
like, urlpattern = patterns('something',(),(),(),) + patterns('somethingelse'),(),(),(),)
22:59 Magus-
sure, why not
22:59 gcarrier
s/e')//
22:59 Magus-
you can even do urlpatterns += patterns() down below it
22:59 gcarrier
perfect, thx
23:01 FunkyBob
but can you import() from the same file? ... more, if I have a common prefix among a dozen URL patterns, can I save myself the effort of maintaining a dozen copies?
23:02 Magus-
no you can't include() from the same file
23:02 Magus-
that doesn't make sense
23:02 FunkyBob
include... that's the one
23:02 FunkyBob
no, but I want the same effect... here's a bunch of URL patterns with a common prefix
23:02 Magus-
hello infinite loop
23:03 Magus-
so make another file that sets the prefix and includes the other
23:03 FunkyBob
yeah, no.. no infinite loop... I was wondering if I could reference another list of URL patterns that are defined in the same file
23:03 FunkyBob
of course I don't want to import the same file
23:03 Magus-
and no, you can't, as I said
23:03 Magus-
and it doesn't make sense, as I said
23:04 Magus-
the desire makes sense, but the action doesn't
23:04 markvandenborre
is there a djangonic way to upload a csv file into admin and create objects out of that?
23:04 Magus-
since you're not including the object inside the urls.py file
23:04 Magus-
you include the file
23:04 Magus-
it finds it from there
23:04 Magus-
so there's no way to reference one part of the file
23:04 Magus-
markvandenborre: no, django has no magic csv import
23:04 markvandenborre
Magus-: but is it the right thing to try and do
23:04 Magus-
I don't see an issue with the idea
23:04 FunkyBob
markvandenborre: no, but it takes very little effort to write an importer
23:05 FunkyBob
especially with Pythons built in CSV lib
23:05 markvandenborre
FunkyBob: I have extended a Manager class
23:05 Ced2
also whilst im popping by may as well ask does anyone know what is happening with aggregates as the project had gone quiet last time i looked...
23:05 markvandenborre
so that it can import csv files
23:06 FunkyBob
markvandenborre: care to pastebin it?
23:06 markvandenborre
but it's not this clear to me where the best place to integrate a ui for that is, and what the best way to integrate that is
23:07 markvandenborre
23:07 markvandenborre
Verbruik.objects.importcsv("file.csv") does what I want
23:07 markvandenborre
but it's really the integration with the ui
23:08 markvandenborre
I'd like to integrate it with the admin interface
23:08 FunkyBob
markvandenborre: if you put field headings in the first line, you can use dictreader and lose the positional constraint
23:10 markvandenborre
yes, that would be preferable, obviously
23:10 markvandenborre
but I'm trying to get the big picture asap
23:10 vicvicvic
it's not possible to use formset_factory with something like "instances=[list_of_model_objects]" to have a bunch of modelforms?
23:10 vicvicvic
that would be neat though :B
23:11 markvandenborre
of how to integrate the csv import with the admin uit (if at all possible)
23:11 brosner
vicvicvic: erm, formset_factory has nothing to do with models.
23:11 brosner
you want a modelformset
23:11 vicvicvic
oh there are those?
23:11 markvandenborre
FunkyBob: I'm making a note of your suggestion though, for further improvement
23:11 vicvicvic
silly me
23:11 markvandenborre
FunkyBob: thx
23:11 FunkyBob
markvandenborre: then you can introspect the model _meta, and set up proper type conversion :)
23:15 markvandenborre
FunkyBob: I guess that from the quality of my current code, you can guess how much I still have to learn
23:15 markvandenborre
:)
23:15 FunkyBob
when we stop learning... then there's a problem
23:17 markvandenborre
FunkyBob: maybe I should start by just setting it up outside the admin ui
23:17 markvandenborre
getting to grasps with ordinary and simple things django better first
23:17 FunkyBob
yes
23:19 FunkyBob
Magus-: from looking at the url() and patterns() code, it seems if your 'view' is a list, it will do what I want
23:19 Magus-
huh?
23:21 Zetx
I've been trying to follow this tutorial (http://www.webmonkey.com/tutorial/Install_Djang...) and I've run into some trouble... it tells me that once I create an admin.py I should be able to see some changes in /admin/ of the dev server, but I don't see that and I'm not seeing any errors either...
23:21 FunkyBob
(r'^foo/', [ list of URL rules ] ) will prefix all those rules with foo/
23:23 Magus-
I don't see how that does much
23:23 Magus-
you'd still need different files for different prefixes?
23:23 __machine
can i use Q() in get or create?
23:24 ascii1011
magus-: re: __unicode__; I tried stopping and restarting apache2 in different ways; tried __str__ which is also not returning anything; even searched the forums for answers, coming up empty; any insite, thx?
23:24 Magus-
you can also do things like r'^%sfoo/' % prefix and define prefix = 'bar/' somewhere
23:24 Magus-
ascii1011: pastebin your code as I suggested before?
23:24 FunkyBob
Magus-: it may not do much but it does what I want.
23:24 __machine
get_or_create(Q(track=N) | Q(title=T), defaults=D) ?
23:25 ascii1011
magus-: ya, meant to ask you.. i am new and not sure what that is.. looked it up online.. are you referring to a section in the djangoproject?
23:26 Magus-
no...
23:26 Magus-
note in topic
23:26 Magus-
Don't paste in the channel, use http://dpaste.com/
23:26 Magus-
go to that website
23:26 Magus-
see box to paste code in
23:26 Magus-
paste code there, submit
23:26 Magus-
see URL at top for your code
23:26 Magus-
paste URL here
23:26 Magus-
we can then see code without it flooding channel
23:27 ascii1011
will do, thank you... your a super resource
23:29 ascii1011
23:29 neybar
with the limit_choiced_to arg on a FK can you refer to the current object?
23:29 Magus-
neybar: no
23:29 Magus-
ascii1011: odd, looks fine there
23:30 Magus-
ascii1011: so does it do anything in the shell either?
23:30 ascii1011
magus-: this is the commands I am attempting: >>> Poll.objects.all() and returns this:[<Poll: Poll object>]
23:31 clad007
I am following the Polls tutorial, wand when adding new polls, int the admin section in the list of polls it's listing each obect as "poll object", not with their title as in the screenshots. Is that normal?
23:32 ascii1011
not sure, but that sounds similar to mine issue
23:32 ned
can someone take a look at this: http://pastebin.com/m24406b0e and give me a hand
23:32 Magus-
ascii1011: and you're using svn? not 0.96?
23:32 ascii1011
i am using the most up-to-date one... even did svn update today..
23:32 Magus-
clad007: if you made __unicode__ wrong or you're using the wrong django version, yah that'd be normal :)
23:32 ned
thats the error thrown when i try to add a tip using the admin panel.
Page 40 of 41   ← Previous  Next →(4,088 total)