2008-8-29
| 22:35 | grigora | Magus-: hmmm, but am i loosing anything by not using the default form that comes with django-registration? |
| 22:36 | Magus- | why would you start fresh? |
| 22:36 | Magus- | subclass it... |
| 22:36 | Magus- | x.x |
| 22:37 | grigora | Magus-: right, I just wasn't sure if it was intended to be subclassed ... and how the profile form would fit in, cause there would really be two forms since both registration and profile have their own forms ... |
| 22:38 | grigora | Magus-: would I be inheriting from both form? |
| 22:41 | Magus- | the profile form doesn't fit |
| 22:41 | Magus- | at all |
| 22:41 | Magus- | you inherit from the registration form |
| 22:41 | Magus- | add your fields |
| 22:41 | Magus- | add your validation |
| 22:41 | Magus- | all done |
| 22:41 | grigora | Magus-: ok, so essentially no need to use django-profile, correct? |
| 22:42 | Jacolyte | has anyone used photologue? |
| 22:43 | Magus- | grigora: for signup |
| 22:43 | Magus- | you'd use it later |
| 22:44 | grigora | Magus-: ah ... then I would just inherit from their form to let users change their info, makes sense |
| 22:44 | grigora | Magus-: thank you |
| 22:49 | nick125 | If I'm using my Django models in another non-Django application, I should be able to just define DJANGO_SETTINGS_MODULE somewhere and it should work? |
| 22:49 | mattmcc | Yep. |
| 22:52 | SeJo | if i get this where can i see what goes wrong? NewsletterUser matching query does not exist. |
| 22:52 | SeJo | i don;t understand, the class is defined in the models.py |
| 22:53 | robvdl | how do we do validators now, they seem completely removed |
| 22:54 | Magus- | they are removed |
| 22:54 | Magus- | you validate in forms, as the forms docs show you |
| 22:54 | robvdl | ok, and would this work in admin as well? |
| 22:54 | Magus- | of course |
| 22:55 | ubernostrum | Well, since the admin is just a set of forms and processing rules... |
| 22:55 | Magus- | as the admin docs show, you can give a form to a ModelAdmin class |
| 22:55 | ubernostrum | And has hooks for letting you customize those... |
| 22:55 | ubernostrum | Even the old admin wasn't some special non-form-based system. |
| 22:55 | robvdl | ok |
| 22:55 | ubernostrum | The old validator_list attribute just set a list of validation methods which were used by the old forms system. |
| 22:55 | anders | quick question, i'm using django.contrib.auth.views.login, and user.is_authenticated is true on the /accounts/login page, but not in the other apps (/quotes) |
| 22:55 | ubernostrum | It was forms all the way down before. It's forms all the way down now. |
| 22:56 | anders | what could i be doing wrong? |
| 22:56 | robvdl | another thing, since my last svn update a fem models won't validate anymore, something to do with m2m fields |
| 22:56 | robvdl | having to add a related name |
| 22:56 | robvdl | fem/few |
| 22:56 | Magus- | robvdl: related_name behavior hasn't changed at all |
| 22:56 | Magus- | so if they die due to that, its been bad forever |
| 22:56 | Magus- | you're only just now seeing it |
| 22:57 | robvdl | hehe |
| 23:00 | SeJo | when doing a query on a value, it apparently fails when the value is not found, how can i check it without failing (need to know if a user already exists or not) |
| 23:03 | Magus- | anders: you likely forgot RequestContext |
| 23:03 | Magus- | no RequestContext = no context processors = context is 100% empty at start |
| 23:03 | Magus- | so no magic addition of 'user' |
| 23:03 | shadfc | SeJo: you can catch the exception when it does fail. Im assuming you're using Model.objects.get( field=someval) and you're getting a Model.DoesNotExist exception |
| 23:03 | shadfc | SeJo: or you can use .filter( field=someval) and then test for an empty set |
| 23:03 | SeJo | ok thanks shadfc |
| 23:03 | anders | Magus-, ahh, that's probably it :) thanks |
| 23:04 | shadfc | SeJo: if you will only ever have 1 or 0 results, use get (it complains if > 1 returned). If you'll have more than one result at some point, then use filter |
| 23:05 | shadfc | well, i guess get complains on zero as well, but itll throw a diff exception when more than 1 are returned |
| 23:16 | Jacolyte | |
| 23:17 | nick125 | Jacolyte: It appears that your code is trying to use a named URL pattern, which doesn't exist. |
| 23:18 | _azeth_ | hello |
| 23:18 | _azeth_ | i followed all documentation |
| 23:19 | _azeth_ | and I don't know what is the whole difference between project and app |
| 23:19 | nick125 | _azeth_: A project is a collection of apps. |
| 23:20 | _azeth_ | in exmplae i have a site that consists of login system and stats system |
| 23:20 | _azeth_ | how should i divide it into apps |
| 23:20 | _azeth_ | ? |
| 23:21 | nick125 | _azeth_: You could have a login "app" and a "stats" app..but you really don't need a "login" app, as Django provides authentication/authorization for you. |
| 23:22 | _azeth_ | but even site with only login system must contain one app to work |
| 23:22 | Magus- | each app is a logical unit |
| 23:22 | _azeth_ | i know |
| 23:22 | Magus- | _azeth_: a site that does nothing but accept a login isn't a site... |
| 23:23 | Magus- | what would you view? nothing? |
| 23:23 | _azeth_ | i had only example |
| 23:23 | Jacolyte | has anyone used photologue |
| 23:23 | Jacolyte | with success... |
| 23:25 | nick125 | Looking at photologue, it appears that it IS defining a named URL for 'pl-gallery'...odd. |
| 23:26 | Jacolyte | is that after you create a gallery or what |
| 23:26 | Jacolyte | Because |
| 23:26 | Jacolyte | I created a gallery, uploaded a photo.. put the photo in the gallery (all within the admin interface) |
| 23:26 | nick125 | url(r'^gallery/(?P<slug>[\-\d\w]+)/$', 'object_detail', {'slug_field': 'title_slug', 'queryset': Gallery.objects.filter(is_public=True), 'extra_context':{'sample_size':SAMPLE_SIZE}}, name='pl-gallery'), |
| 23:26 | nick125 | That's just looking at the SVN copy |
| 23:26 | _azeth_ | i have a site where on the same page is menubar with login panel and content from user profile |
| 23:27 | nick125 | Jacolyte: It shouldn't be dependent on whether or not a gallery is added..it's just a named URL, that's all. |
| 23:27 | Jacolyte | well where does it lead to? a gallery right? |
| 23:28 | SeJo | HttpResponseRedirect should redirect me to a page right? (after submitting my form?) |
| 23:28 | nick125 | right |
| 23:28 | _azeth_ | oh, i understand my mistaken understanding |
| 23:28 | Jacolyte | so it should depend on a gallery being made... |
| 23:28 | nick125 | Jacolyte: not necessarily. |
| 23:28 | _azeth_ | sorry for spam and wasted bandwidth |
| 23:28 | nick125 | Well...the function call that is generating the error (and the URL) IS defined in the model for a gallery. |
| 23:29 | nick125 | Jacolyte: And you ARE including the urls.py for photologue, right? |
| 23:29 | SeJo | If i still get the original page, HttpResponseRedirect('/v2/newsletter/exists/') |
| 23:29 | SeJo | then that one isn't called? |
| 23:29 | Jacolyte | does autodiscover() take care of that? |
| 23:30 | nick125 | Jacolyte: No. |
| 23:30 | nick125 | Jacolyte: That's for admin |
| 23:31 | Jacolyte | It's in my installed apps |
| 23:31 | Magus- | that's nice |
| 23:31 | Magus- | are you including the urls or not? |
| 23:31 | Jacolyte | which is all the readme says to do |
| 23:31 | Jacolyte | no |
| 23:31 | Magus- | then the readme is stupid |
| 23:31 | Magus- | you always have to include urls |