Re: CRUD generic views do not work on model with foreign key

2006-10-24 Thread doubtintom
Yep, that did it. Thanks. Actually, my urls.py was OK, it was decoupled into the application directory. But that darn template got imported into the project sort of late at night, and foxed me into misinterpreting the symptoms. I have seen some template errors caught by django. Some but not all,

Re: CRUD generic views do not work on model with foreign key

2006-10-23 Thread Russell Keith-Magee
Ok; there are a few problems 1) in urls.py, new_dict pushes post_save_redirects to "/invoices/". However, no URL handler is set up for that url. However, you haven't hit this problem yet - the main problem is... 2) ticket_form.html doesn't contain a form.theater element. As a result, submitting

Re: CRUD generic views do not work on model with foreign key

2006-10-23 Thread doubtintom
Russell, thanks for looking into this! See comments & code below. Tom Russell Keith-Magee wrote: > > - Are you sure that the database has been synced to match the 'with > foreign key' version of the model? Drop the db and recreate to be > sure. Yes, I had done that. > - What does the developmen

Re: CRUD generic views do not work on model with foreign key

2006-10-23 Thread Russell Keith-Magee
On 10/24/06, doubtintom <[EMAIL PROTECTED]> wrote: > > Similarly for django.views.generic.create_update.update_object. They > work fine on the cheetsheet model, but when a foreign key is added to > the Theater model that I made up for testing, changes do not take, > browser does not forward. > > I

Re: CRUD generic views do not work on model with foreign key

2006-10-23 Thread doubtintom
Sure, Russ, I'll be more explicit, hopefully less Zen-like. The cheetsheet model as-is works just as expected with django.views.generic.create_update.create_object, i.e. 1. url kicks off generic view add to template with empty fields as expected 2. I enter data, click save 3. I get whisked back t

Re: CRUD generic views do not work on model with foreign key

2006-10-23 Thread Russell Keith-Magee
On 10/24/06, doubtintom <[EMAIL PROTECTED]> wrote: > However, nearly the same model with a foreign key to another model in > the same app (or project, I've tried it both ways) does not: Help us help you. What does "does not work" mean? What success did you have with the cheatsheet model? What pro

CRUD generic views do not work on model with foreign key

2006-10-23 Thread doubtintom
That is, create/update/delete generic views do not create, update, or delete on a model (table) with a foreign key within the app or project. At least I cannot figure out how. They do, however, work fine on a model with a foreign key to django.contrib.auth.models.User. I got this from the http

Re: generic views serialization support (json, xml, etc.)

2006-10-23 Thread Russell Keith-Magee
On 10/23/06, zenx <[EMAIL PROTECTED]> wrote: > > Hi, are there any plans to add serialization support to generic views? It sounds like a good idea to me. There are no specific plans (that I am aware of) to implement this feature, all the core developers are pretty busy with their

generic views serialization support (json, xml, etc.)

2006-10-23 Thread zenx
Hi, are there any plans to add serialization support to generic views? I think it won't be difficult to implement it because generic views are already programmed and they should only get one extra parameter to know which type of document they have to return (html (default), xml, json). It&#

Search in generic views

2006-10-12 Thread ElGranAzul
Hi, i'm developing an application and i need a search function like admin search in some models. I've tryed modifying generic views, but i can't make it work. The idea is something like: [ CODE ] def object_list([...] search_fields=None, q=None [...]): """

Re: Callable hooks for generic views after validation with no errors?

2006-10-05 Thread wam
st_update_validation' signals) in the generic views associated with creation, update. I don't feel this could easily be handled by the existing pre_save signal because it doesn't seem to have access to information contained in the request. There doesn't seem to be any current facilit

Re: Re: Callable hooks for generic views after validation with no errors?

2006-10-05 Thread Malcolm Tredinnick
Hey James, On Thu, 2006-10-05 at 10:12 -0500, James Bennett wrote: > On 10/5/06, John Melesky <[EMAIL PROTECTED]> wrote: > > Does that mean it's ready for inclusion in the django docs tree? It > > would be nice to get topics like this covered in the core documentation. > > If one of the committe

Re: Re: Callable hooks for generic views after validation with no errors?

2006-10-05 Thread James Bennett
On 10/5/06, John Melesky <[EMAIL PROTECTED]> wrote: > Does that mean it's ready for inclusion in the django docs tree? It > would be nice to get topics like this covered in the core documentation. If one of the committers thinks it's good enough, then by all means. I'll happily submit it in ReST

Re: Callable hooks for generic views after validation with no errors?

2006-10-05 Thread John Melesky
James Bennett wrote: > On 10/4/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >> There is some documentation on how Django's signals system works and how >> to hook into it here: http://code.djangoproject.com/wiki/Signals > > I just went through and completely re-wrote that to cover signals in

Re: Callable hooks for generic views after validation with no errors?

2006-10-04 Thread wam
James Bennett wrote: > This is probably the way to do it; adding special-case hooks to the > generic views doesn't sound like a good solution to me. Well, callables which can be sent into generic views and are executed just prior to handing off to the template in order to populate

Re: Re: Callable hooks for generic views after validation with no errors?

2006-10-04 Thread James Bennett
On 10/4/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > There is some documentation on how Django's signals system works and how > to hook into it here: http://code.djangoproject.com/wiki/Signals I just went through and completely re-wrote that to cover signals in as much detail as I could mu

Re: Callable hooks for generic views after validation with no errors?

2006-10-04 Thread Malcolm Tredinnick
object from create_object is an instance of > > HttpResponseRedirect() I can determine if the addition/edit was > > successful; however, I still don't have access to the new/editted > > object. > > This is probably the way to do it; adding special-case hooks to the >

Re: Callable hooks for generic views after validation with no errors?

2006-10-04 Thread James Bennett
termine if the addition/edit was > successful; however, I still don't have access to the new/editted > object. This is probably the way to do it; adding special-case hooks to the generic views doesn't sound like a good solution to me. For getting access to the object, I believe that

Callable hooks for generic views after validation with no errors?

2006-10-04 Thread wam
I make extensive use of generic views in one of my apps. Now that the app is nearly finished, I'm being asked to do change tracking/audit trail on the objects managed in the generic views. Recognizing that I could just create and save django.contrib.admin.models.LogEntry() objects and pos

Re: urls and generic views with 2 slugfields

2006-10-02 Thread zenx
I will take a look at it. Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send emai

Re: urls and generic views with 2 slugfields

2006-10-02 Thread RajeshD
request execution to the generic list view for songs. See Malcolm Tredinnick's excellent article on extending generic views for more on this: http://www.pointy-stick.com/blog/2006/06/29/django-tips-extending-generic-views/ --~--~-~--~~~---~--~~ You received

Re: urls and generic views with 2 slugfields

2006-10-02 Thread RajeshD
request execution to the generic list view for songs. See Malcolm Tredinnick's excellent article on extending generic views for more on this: http://www.pointy-stick.com/blog/2006/06/29/django-tips-extending-generic-views/ --~--~-~--~~~---~--~~ You received

urls and generic views with 2 slugfields

2006-10-02 Thread zenx
Hi, I've got 3 models: Artist, Album and Song. For getting an artist info I use: (r'^artists/(?P[-\w]+)/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, slug_field='identificador')), I want an url like www.mysite.com/artists/black_eye_peas/albums/album_name for getting all

Re: generic views : how i'd like to have it

2006-09-26 Thread xaranduu
Thanx for the link! I solved the problem by simply forwarding to my own generic viewmethod and taking request.path to build my own namespace. I want general views of *All* my contentobjects without the need to customize any templete ( but still be able to customize if wanted) --~--~-~--

Re: generic views : how i'd like to have it

2006-09-25 Thread Malcolm Tredinnick
to the view . > > Target is to get completely automated generic views, without having to > edit any template > (maybe have a set of templates designed once, but valid for all > objects) > > So I dont want to pass the parameter to the template but to the second > urls.py > &

generic views : how i'd like to have it

2006-09-25 Thread xaranduu
I want to build a generic view for all of my objects and according to the documentation (http://www.djangoproject.com/documentation/url_dispatch/#captured-parameters) it is possible to capture a parameter and forward it to the view . Target is to get completely automated generic views, without

filers into generic views

2006-09-22 Thread Allan Henderson
Hi all, Currently I have a setup whereby a user navigating to a product category is met with the list of products in that category using generic views. In urls.py I have the 'info_dicts' handling the categories so that in the generic view the correct category is presented to u

RE: generic views and forms

2006-09-14 Thread Benedict Verheyen
rm involving two models? >Or made to receive specific information that will not be stored in a model? You need special forms that are not automatically done. >The generic views seem to be 'shorcuts' for very common (and>specific!) views. They are very handy, but you find their l

Re: generic views and forms

2006-09-14 Thread Guillermo Fernandez Castellanos
wo models? Or made to receive specific information that will not be stored in a model? You need special forms that are not automatically done. The generic views seem to be 'shorcuts' for very common (and specific!) views. They are very handy, but you find their limits pretty quickly as

generic views and forms

2006-09-14 Thread Benedict Verheyen
Hi,in the "docs forms, fields, and manipulators" documentation,it's stated that you can't have the forms automatically created so you need to createyour own forms.In there there's an example that deals with a view & manipulators and a template. However, if you use "django.views.generic.create_updat

Re: Generic views table sort

2006-09-06 Thread Robert
Hello Aidas, I will try to implement your view :) As for pagination, I've found a great templatetag at: http://code.djangoproject.com/wiki/CookBookTemplateTags Thanks, Robert --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Generic views table sort

2006-09-05 Thread Aidas Bendoraitis
list and now I need to add > column sorting in my table. > > I am new to both python & Django, and read > contrib/admin/teamplates,tamplatetags many times and can't understand > how > pagination & column sorting works in Admin panel. > > Also tried a javascript

Re: Generic views table sort

2006-09-05 Thread charles sibbald
take a look at http://www.softcomplex.com table sorting and pagination, simply amazing- Original Message From: Robert <[EMAIL PROTECTED]>To: Django users Sent: Tuesday, September 5, 2006 11:13:55 AMSubject: Generic views table sortHi,I'm using 'object_list' for gettin

Generic views table sort

2006-09-05 Thread Robert
used for column sorting ? (not talking about django admin, it's too hard coded for me at least at the moment). If generic views are the problem here I can ommit it, though pagination will not be so easy then. I was considering using a schema below: model name "Test" with field

Re: Displaying comments in reverse date order in generic views

2006-09-02 Thread James Bennett
On 9/2/06, keukaman <[EMAIL PROTECTED]> wrote: > {% get_free_comment_list for blog.entry object.id as comment_list %} > > But when I display the comments they are in the order they were entered > in the database. Could someone share with me the way to display > comments to that they display with

Displaying comments in reverse date order in generic views

2006-09-02 Thread keukaman
I am showing comments on a generic view page by using {% get_free_comment_list for blog.entry object.id as comment_list %} But when I display the comments they are in the order they were entered in the database. Could someone share with me the way to display comments to that they display with t

Re: Generic views and manipulating data before saving

2006-08-27 Thread konryd
I guess manipultors are made for this purpose. I'm not sure but you can probably override AddManipulator in order to use generic views. Hope this is the answer to your queston. This is an example from my excercise blog app (it doesn't use generic view actually): #model c

Re: generic views for ajax ?

2006-08-27 Thread dummy
ich is true for all time, but I would prefer a much more generic way to > > get the response from the views. > > I think the ideal would be to have generic views accept an additional > parameter which tells them how to format the response -- whether to > return HTML, or to serialize

Re: generic views for ajax ?

2006-08-26 Thread James Bennett
generic way to get > the response from the views. I think the ideal would be to have generic views accept an additional parameter which tells them how to format the response -- whether to return HTML, or to serialize to XML or JSON (since we've got object serialization already). See ticke

Re: generic views for ajax ?

2006-08-26 Thread Corey Oordt
Dirk, I think that it's a great option. It doesn't advocate a specific framework or method even. AJAX views will be very similar to html views and I agree that having some generic views for AJAX is a great addition to the Django community, even if it doesn't get added to the

generic views for ajax ?

2006-08-26 Thread dummy
Hi, I know the discussion about django and ajax compatible response. The 'hardliners' say that you only need to implement your own kind of template - which is true for all time, but I would prefer a much more generic way to get the response from the views. I made a server-side django library

Re: Generic views and pagination links

2006-08-26 Thread hugh4life
Gnissem wrote: > I am using generic views to produce a paginated specimen list. In the > list, you can click on a specimen to get the generic view detail. > After viewing the detail, the user will likely want to go back to the > specimen list, on the page where the link came from.

Re: Generic views and reverse url lookup?

2006-08-26 Thread Ivan Sagalaev
Petar Marić wrote: > I'm checking out reverse url resolving and I can't help but wonder: > What happenes when we use generic views? Will it still work? Hm... Looks like they wouldn't :-(. This'll require some thinking... --~--~-~--~~~---~

Generic views and manipulating data before saving

2006-08-26 Thread Andres Luga
Hi, I've spent many hours trying to get the following to work (I'm not blaming Django - I'm very new to Python and Django, it was late etc). To hopefully make the solution easier to find in Google, I write it here. Suggestions for improvement are welcome. Question: using generi

Generic views and pagination links

2006-08-25 Thread Gnissem
I am using generic views to produce a paginated specimen list. In the list, you can click on a specimen to get the generic view detail. After viewing the detail, the user will likely want to go back to the specimen list, on the page where the link came from. Pressing the back button works, but

Generic views and reverse url lookup?

2006-08-25 Thread Petar Marić
Hi, I'm checking out reverse url resolving and I can't help but wonder: What happenes when we use generic views? Will it still work? Regards, -- Petar Marić *e-mail: [EMAIL PROTECTED] *mobile: +381 (64) 6122467 *icq: 224720322 *skype: petar_maric *web: http://www.peta

yet again | sorting & generic views

2006-08-16 Thread jelle
Hi, Sorry to bring this question up again, since it passed over this list earlier today. I thought that Malcolm Tredinnick post on extending generic views is very insightful http://www.pointy-stick.com/blog/2006/06/29/django-tips-extending-generic-views/ as simple as that actually is. Using

Re: Sorting entries using generic views

2006-08-15 Thread keukaman
Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

Re: Sorting entries using generic views

2006-08-15 Thread Jay Parlar
On 8/15/06, keukaman <[EMAIL PROTECTED]> wrote: > > I'm using generic views to display some blog entries. It's a very > simple app that i'm using to learn django. > > The problem I'm having is trying to sort the output with the newest > entry showing at

Sorting entries using generic views

2006-08-15 Thread keukaman
I'm using generic views to display some blog entries. It's a very simple app that i'm using to learn django. The problem I'm having is trying to sort the output with the newest entry showing at the top. Does anyone have a simple model.py and template.html I could look at th

Re: Re: Re: More complex QuerySets and generic views

2006-08-15 Thread Jon Atkinson
> You're using a variable "feedtype" that's not defined. > > It's the same thing as doing this in the Python interactive prompt: > > print a + 1 > > The variable "a" is not defined yet, so Python raises a NameError. > > The problem in your case is that your view won't know the value of > feedt

Re: Re: Re: More complex QuerySets and generic views

2006-08-15 Thread Jon Atkinson
> > I think it's worth raising a feature request in the Django Trac for > this functionality. I can imagine that this would be very useful to a > lot of people in the future. > > Michael Done! http://code.djangoproject.com/ticket/2544 --Jon --~--~-~--~~~---~--~~

Re: Re: More complex QuerySets and generic views

2006-08-15 Thread Adrian Holovaty
On 8/15/06, Jon Atkinson <[EMAIL PROTECTED]> wrote: > (r'^/?(?P\w+)/$', > 'django.views.generic.list_detail.object_list', {'queryset': > Item.objects.filter(feed__feedtype__feedtype__iexact=feedtype).order_by('-time'), > 'paginate_by': 15, 'extra_context': {'is_first_page': True}}), > > And oddly

Re: Re: More complex QuerySets and generic views

2006-08-15 Thread Michael van der Westhuizen
Hi Jon, On 8/15/06, Jon Atkinson <[EMAIL PROTECTED]> wrote: [snip] > I've just tried removing the regular expression - so the line looks like: > > (r'^/?(?P\w+)/$', > 'django.views.generic.list_detail.object_list', {'queryset': > Item.objects.filter(feed__feedtype__feedtype__iexact=feedtype).orde

Re: Re: More complex QuerySets and generic views

2006-08-15 Thread Jon Atkinson
On 15/08/06, Michael van der Westhuizen <[EMAIL PROTECTED]> wrote: > > Do you really need the RE in the query? I think the problem is that > the re call is being evaluated immediately, which the query is lazily > evaluated. Would the "iexact" not work without the regular expression? > > If you do

Re: More complex QuerySets and generic views

2006-08-15 Thread Michael van der Westhuizen
Hi Jon, On 8/15/06, Jon Atkinson <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm dabbling with generic views (thanks to wise advice from others on > this list), and I'm trying to convert one of my slightly more > complicated views to use a generic view. The vie

Re: More complex QuerySets and generic views

2006-08-15 Thread Chris Long
You could simplify your urls.py by extending the generic view with another view, e.g. an example from the authorization document: from django.views.generic.date_based import object_detail @login_required def limited_object_detail(*args, **kwargs): return object_detail(*args, **kwargs) It mi

More complex QuerySets and generic views

2006-08-15 Thread Jon Atkinson
Hi, I'm dabbling with generic views (thanks to wise advice from others on this list), and I'm trying to convert one of my slightly more complicated views to use a generic view. The vie itself is a simple list, but my queryset is generated as follows: Item.obje

Re: Re: Using custom forms with generic views

2006-08-12 Thread Jeff Mikels
Great! That's exactly what I wanted! Thanks. On 8/8/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > another alternative you may want to consider is to piggybak ontop of the > generic view > > have a look > at > http://svn.zyons.python-hosting.com/trunk/zilbo/common/utils/views/create_update.py

Re: Using custom forms with generic views

2006-08-08 Thread Ian Holsman
another alternative you may want to consider is to piggybak ontop of  the generic viewhave a look at http://svn.zyons.python-hosting.com/trunk/zilbo/common/utils/views/create_update.py for a examplewhich adds a 'change_user' and 'last_change' fieldseg.    if request.POST:        new_data = request.

Re: Using custom forms with generic views

2006-08-08 Thread Gábor Farkas
jeffmikels wrote: > Thanks for your help. I ended up creating a view to do the work. If the > data is simple enough and just plain text, is there a compelling reason > to use AddManipulator or other manipulators instead of just > object.save()? > > hi, for example, if you want to validate that

Re: Using custom forms with generic views

2006-08-07 Thread jeffmikels
Thanks for your help. I ended up creating a view to do the work. If the data is simple enough and just plain text, is there a compelling reason to use AddManipulator or other manipulators instead of just object.save()? --~--~-~--~~~---~--~~ You received this messa

Re: Using custom forms with generic views

2006-08-07 Thread Michael van der Westhuizen
> In my models, I have a > > > > tags = models.ManyToManyField(Tag, blank=True, > > filter_interface=models.HORIZONTAL, related_name="tags") > > > > when using generic views and form.tags, I get a select box; however, i > > would rather have a single text box into whic

Re: Using custom forms with generic views

2006-08-06 Thread Malcolm Tredinnick
s.HORIZONTAL, related_name="tags") > > when using generic views and form.tags, I get a select box; however, i > would rather have a single text box into which I can type a string of > comma separated tags, and then have them parsed behind the scenes. Can > I still use ge

Using custom forms with generic views

2006-08-05 Thread jeffmikels
I'm trying to create a site that has entries of different types and tags that can link to any type of entry. In my models, I have a tags = models.ManyToManyField(Tag, blank=True, filter_interface=models.HORIZONTAL, related_name="tags") when using generic views and form.tags, I g

Re: generic views object_list & custom template tags

2006-08-04 Thread Malcolm Tredinnick
On Fri, 2006-08-04 at 21:50 -0700, bernie2004 wrote: > when using a generic views object_list, > i would like to know if there is a faster way to get all > the extra variables inside a custom template tag: > > {% navigation pages page has_previous has_next %} > > and >

generic views object_list & custom template tags

2006-08-04 Thread bernie2004
when using a generic views object_list, i would like to know if there is a faster way to get all the extra variables inside a custom template tag: {% navigation pages page has_previous has_next %} and @register.simple_tag def navigation( pages, page, has_previous, has_next ): ... create

Re: Generic views and dates in the future

2006-07-27 Thread Ian Holsman
On 08/07/2006, at 12:12 AM, Jan Claeys wrote:On do, 2006-07-06 at 17:03 -0400, Jay Parlar wrote: On 7/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: If I were to write a backwards compatable patch, is it something you'dbe willing to put in? I'm thinking along the lines of a keywordargument 'allow

Re: hide drop-down items with generic views?

2006-07-27 Thread jrs
I have used custom manipulators to do this http://www.djangoproject.com/documentation/forms/ class PollAddManipulator(Poll.AddManipulator): def __init__(self, season): super(Poll.AddManipulator, self).__init__() newfields = [] for field in

Re: hide drop-down items with generic views?

2006-07-27 Thread hotani
Let's say I have a list of categories: - category 1 - category 2 - hide me! Then on the template side, I (obviously) want to hide the one that says "hide me!" How to do this? In PHP it would be a matter of modifying the query that builds the drop-down: [SELECT WHERE active=1].

Re: Generic views and dates in the future

2006-07-27 Thread Adrian Holovaty
On 7/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > If I were to write a backwards compatable patch, is it something you'd > be willing to put in? I'm thinking along the lines of a keyword > argument 'allow_future' which has a default value of False. Just for the record (and to close this thread),

hide drop-down items with generic views?

2006-07-26 Thread hotani
I'm using a generic view for a form and have a few drop-downs on the page. However, I don't want to display every item in the drop-down. I thought I would put in an "active" switch on them, but can't figure out how to only show the active items on the template. would this be A: a filter set up in

Re: Related objects in generic views

2006-07-26 Thread Sean
Hi, Malcolm Tredinnick wrote: > In the object_list view, you are given an "object_list" parameter, which > is a list of all the objects for that page. To display them, you will be > doing something like > > {% for folder in object_list %} > > to iterate over that list. Inside that loop, y

Re: Related objects in generic views

2006-07-25 Thread Malcolm Tredinnick
On Mon, 2006-07-24 at 06:30 -0700, sean wrote: > Thanks for the reply. > That solution would involve the object_detail view for the folder, > right? > I am currently using that one, but pagination would be nice to use on > the media list, so I would rather get the object_list working. In the obje

Re: Related objects in generic views

2006-07-24 Thread sean
Thanks for the reply. That solution would involve the object_detail view for the folder, right? I am currently using that one, but pagination would be nice to use on the media list, so I would rather get the object_list working. I don't think I completely understand the queryset parameter. In the

Re: Related objects in generic views

2006-07-24 Thread Malcolm Tredinnick
On Mon, 2006-07-24 at 11:41 +, sean wrote: > Hi, > I'm having a hard time getting the generic list view to work for a set > of related objects. > I have two models, Folder and Media, where Media has a foreign key > relationship to Folder. I want to use generic views to ac

Related objects in generic views

2006-07-24 Thread sean
Hi, I'm having a hard time getting the generic list view to work for a set of related objects. I have two models, Folder and Media, where Media has a foreign key relationship to Folder. I want to use generic views to access all the media related to a specific folder but I can't seem

Re: How get user, included in generic views?

2006-07-12 Thread hotani
I got it finally... changed this: return render_to_response('main/index.html') to this: return render_to_response('main/index.html', RequestContext(request, {'request': request})) and that took care of it. Only took a few hours of staring at the generic

Re: How get user, included in generic views?

2006-07-12 Thread hotani
this is what I'm sending out in the view. Basically this is an empty section of the site that will be created later. However, it bothers me that the menus and such will not work correctly since it seems I'm not passing the correct info. from views.py: def index(request): return render_to_

Re: How get user, included in generic views?

2006-07-12 Thread Guillermo Fernandez Castellanos
rote: > > I think I'm missing something in my own views. Everything created by > django (admin area, generic views) will get the user info, but when I > do a view myself it doesn't work. What little tid-bit am I missing here? > > > > > --~--~-~--~~---

Re: How get user, included in generic views?

2006-07-12 Thread hotani
I think I'm missing something in my own views. Everything created by django (admin area, generic views) will get the user info, but when I do a view myself it doesn't work. What little tid-bit am I missing here? --~--~-~--~~~---~--~~ You received th

Re: How get user, included in generic views?

2006-07-12 Thread Guillermo Fernandez Castellanos
Ok, got my problem. May be your problem as well, mamcxyz. I was using the user variable in a menu. In order to make my webpage as generic as possible, I had defined a menu.html that I included with a tag: register = Library() def make_menu(context): pass make_menu = register.inclusion_tag('s

Re: How get user, included in generic views?

2006-07-12 Thread hotani
I am having this problem as well, but only for part of my site. The admin area works normally, one of my apps works well, but another app (happens to be the one at '/') does not see the user. {{ user.username }} returns "". It sees someone logged in, so user.is_anonymous is false, but everything a

Re: How get user, included in generic views?

2006-07-11 Thread Joshua Tacoma
I don't know how to replicate it right now (I tried logging out and deleting cookies, no dice) but it did happen to me once or twice while I was developing something. If you only find this problem when you aren't logged in then treating 'not user' as equivalent to 'user.is_anonymous' should be ok

Re: How get user, included in generic views?

2006-07-11 Thread Guillermo Fernandez Castellanos
en, I only can see in my browser: Welcome, . Thanks for logging in. Any hint would be greatly apreciated, thanks! G On 7/11/06, mamcxyz <[EMAIL PROTECTED]> wrote: > > I don't get the USER from context in generic views. I have configured > the context procesors with django.core.c

How get user, included in generic views?

2006-07-11 Thread mamcxyz
I don't get the USER from context in generic views. I have configured the context procesors with django.core.context_processors.request, but not work in generic views...Why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: Generic views and dates in the future

2006-07-07 Thread Jan Claeys
On do, 2006-07-06 at 17:03 -0400, Jay Parlar wrote: > On 7/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > > > On 7/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > > What's the justification for the date based generic views not showing > > >

Re: Generic views and dates in the future

2006-07-06 Thread Ian Holsman
TECTED]> wrote: >> What's the justification for the date based generic views not showing >> dates in the future? > > The justification is: The system was built for displaying "archival" > information, not future information. We've just never had that need

Re: Generic views and dates in the future

2006-07-06 Thread Adrian Holovaty
On 7/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > If I were to write a backwards compatable patch, is it something you'd > be willing to put in? I'm thinking along the lines of a keyword > argument 'allow_future' which has a default value of False. Sure, feel free to submit! Adrian -- Adrian

Re: Generic views and dates in the future

2006-07-06 Thread Jay Parlar
On 7/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 7/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > What's the justification for the date based generic views not showing > > dates in the future? > > The justification is: The system was built for

Re: Generic views and dates in the future

2006-07-06 Thread Adrian Holovaty
On 7/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > What's the justification for the date based generic views not showing > dates in the future? The justification is: The system was built for displaying "archival" information, not future information. We've j

Generic views and dates in the future

2006-07-06 Thread Jay Parlar
What's the justification for the date based generic views not showing dates in the future? I've got a model for community events that looks as follows: class Event(models.Model): title = models.CharField(maxlength=200) slug = models.SlugField(prepopulate_from=("title&q

Re: Problem with date_based generic views

2006-06-21 Thread Patrick J. Anderson
Well, that fixed it. I guess development using mod_python can be a little cumbersome. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegro

Re: Problem with date_based generic views

2006-06-21 Thread Patrick J. Anderson
I'm trying to display my records based on date. I've removed object.list... same result, page returns the same error message. It's weird, because it was working fine just a few minutes ago. --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Problem with date_based generic views

2006-06-21 Thread Malcolm Tredinnick
On Thu, 2006-06-22 at 03:47 +, Patrick J. Anderson wrote: > Hi, I've been working with date_based generic views in my application, > and while everything was going great, all of a sudden I'm getting this > error on, while trying to access records for a specific month: >

Problem with date_based generic views

2006-06-21 Thread Patrick J. Anderson
Hi, I've been working with date_based generic views in my application, and while everything was going great, all of a sudden I'm getting this error on, while trying to access records for a specific month: ViewDoesNotExist at /projects/2006/jun/ Could

Re: get_absolute_url + date_based generic views

2006-06-17 Thread Jay Parlar
On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 6/17/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > def get_absolute_url(self): > > return "/articles/" + self.pub_date.replace("-","/") + "/" + self.slug > > > > But it seems like there'd be a cleaner way (ie. not having to call > >

Re: get_absolute_url + date_based generic views

2006-06-17 Thread James Bennett
On 6/17/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > def get_absolute_url(self): > return "/articles/" + self.pub_date.replace("-","/") + "/" + self.slug > > But it seems like there'd be a cleaner way (ie. not having to call 'replace') def get_absolute_url(self): return "/articles/%s/%s" %

get_absolute_url + date_based generic views

2006-06-17 Thread Jay Parlar
ugField(...) pub_date = models.DateField(...) And I want the url for a given article to be something like /articles/2006/06/31/slug Of course, I use the date_based generic views for that, but what about get_absolute_url? I was thinking something like: def get_absolute_url(self): return "/arti

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Wow! I didn't know it would be that simple! > > > > What about convenience functions, get_relatedobjectname()? > > Can 'relatedobjectname' be a field name passed as a parameter? > > Yes,

<    2   3   4   5   6   7   8   >