Alexander Boldakov wrote:
> Django deployment documentation claims the need of flup as the FastCGI
> library. Are there any flup features that Django relies on?
Nothing specific. Flup is recommended because it's pure Python and
easier to install.
Also documentation *strongly* recommends not to
Paul Rauch wrote:
> Template:
> {% url cvh.view.login %}
Here you have "view".
> urlpatterns = patterns('mysite.cvh.views',
> (r'^$','index'),
> (r'^login/$','login'),
> )
And here you have "views". {% url %} doesn't find your pattern and
returns '' (empty string) that browser translates to
hoamon wrote:
> Course|Trainee|Company
> C1| T1 | Com1
> C1| T2 | Com1
> C1| T3 | Com1
> C2| T1 | Com2
> C2| T3 | Com1
> C2| T4 | Com2
> C3| T1 | Com2
You really can't do it using standard ManyToManyField. The common way is
to create this r
Ross Burton wrote:
> then in the view:
>
> {% for paper in object_list|dictsort:"title" %}
> {% if paper.has_voted( TODO ) %}
>
Not related to your question, but this is called 'template' in Django.
'View' means a different thing (a controller).
> I then discovered that you can't pass a
johnny wrote:
> What I want to do is set HTTP Error manually in my view, when a
> request is made to certain url, without post data.
>
> At a particular url, my view is looking for XML document to be sent
> over http, by post. If a request come in without post, I want to
> raise an error "405 Me
Kai Kuehne wrote:
> With this
>
> Team:
> {% for team in object.squad.team_set.all %}
> {% appearance_count_for_team team.id %}
>
> and
>
> class AppearanceCountForTeamNode(template.Node):
> def __init__(self, team_id):
> print team_id
> ...
>
> I get "team.i
Simon Willison wrote:
> Hi all,
>
> I've just released the first version of an OpenID consumer package for
> Django. The idea is to make it ridiculously easy to add OpenID
> consumer support to any Django application - and hence allow users of
> OpenID to sign in without having to set up a new us
I am developing a non-intrusive javascript syntax highlighter for use in
blogs. Recently I've added support for highlighting Django templates and
now I feel it can be indeed useful for people writing about Django.
Check it out: http://softwaremaniacs.org/soft/highlight/en/
--~--~-~--~-
hoamon wrote:
> how can i customize the fields in the newforms, or i walk the wrong
> way ??
What you described is an issue but I want to advice a different
technique that doesn't suffer from this issue and also considered more
robust.
You shouldn't mix your HTML with Javascript, instead you s
hoamon wrote:
> no.setAttribute("onKeydown", 'Element.update("NO_CHECK", " src=http://mydomain/arrows.gif>");');
Instead of assigning a raw onkeydown attribute it's better to attach an
event. Look into prototype.js' docs, I bet it can do this in a
cross-browser fashion. Something like Event(
Hello!
I'd like to ask everyone's opinion on implementing a search
functionality in an app. The app is a forum that tends to be simple and
pluggable. Now I'm on a quest of picking a right solution for searching
and have stuck.
My current thoughts and decision:
- Searching using "like" db que
[EMAIL PROTECTED] wrote:
> I'm reimplementing an in-database tree system and I'm using custom SQL
> queries. I want to use % in LIKE but Django doesn't let me.
>
> The code:
> ##
> def getBranch(table_name, parent_depth, parent_cutLevel, max_depth):
> cursor = connection.cursor(
Malcolm Tredinnick wrote:
> The unicode branch, [1], is now at a point where it is essentially
> feature-complete and could do with a bit of heavy testing from the wider
> community.
Switched my site today to the branch. Works like a charm (translations,
admin, multilingual content).
--~--~
Michal wrote:
> It seems like the test database is created in SQL_ASCII encoding. I
> looked into psql terminal and found:
>
> List of databases
>Name | Owner| Encoding
> -++---
> gr4unicode | pgsql | UNICODE
> te
[EMAIL PROTECTED] wrote:
> Oh..I meant to mention that this is using the default
> ChangeManipulator for the class.
Then set to the field 'editable=False' and manipulator won't touch it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Russell Keith-Magee wrote:
> On 6/1/07, char <[EMAIL PROTECTED]> wrote:
>> Obviously, the performance deteriorates rapidly as the number of
>> GamesOfInterest added to a Profile increases. Is there any way to
>> avoid this?
>
> This is a known problem, and one of the many reasons that the forms
>
Ken wrote:
> Sorry if this is a stupid question, but why do forms output HTML as
> unicode strings? Is this arbitrary or is there some grand convention
> we are all supposed to be following?
The general convention is that all strings inside your project are
supposed to be unicode. They are only
Rufman wrote:
> hey guys
>
> I need a little help reversing urls with a get parameter.
>
> I'm using urlresolvers.reverse() in my view to reverse the url as
> follows:
> reverse(pageName, kwargs={'page' : page})
>
> If i try passing thre request.GET object as so:
>
> reverse(pageName, args=[re
Kenneth Gonsalves wrote:
> ProgrammingError at /web/admin/web/fosscalendar/add/
> ERROR: character 0xe28099 of encoding "UNICODE" has no equivalent in
> "LATIN1" INSERT INTO
> "web_fosscalendar" ("name","year","startdate","enddate","city_id","venue
> ","organiser","scope","website","contact")
Greg wrote:
> request.session['info'].update(shape=ProductShape.objects.get(id=request['shape']))
> return render_to_response('search.htm', {'pinfo':
> request.session['info']}
This might be because of your first line here doesn't work as expected.
Session is not exactly a dict and one of the th
Hello!
I'm about to convert my apps to play well with recently introduced
autoescaping but I have to confess that I don't get mark_safe, is_safe
and needs_autoescaping.
First, I don't get why .is_safe attribute is needed at all. If my filter
returns any HTML I should escape it and mark_safe
Ken wrote:
> For instance, I
> cant pass a dict or a list of lists to the template.
Actually it's not true, you can perfectly pass and access dicts and
lists and whatever in templates. Can you describe your specific case
that didn't work?
--~--~-~--~~~---~--~~
Y
SmileyChris wrote:
> It's explained here:
> http://www.djangoproject.com/documentation/templates_python/#filters-and-auto-escaping
Yes, I've asked the group after I've read those docs, twice :-). First
time I thought that I was just slow but the second time I didn't
understand again and asked f
Malcolm, first of all, I should apologies. I actually intended my letter
being 'funny' but after your answer I understand that it was just harsh
:-(. I'm sorry. And let me again express that I never stopped to wonder
how you manage to do so many great things in Django. Thank you very much!
Sti
Thanks for clarification! I have couple more things to iron out though...
Malcolm Tredinnick wrote:
> If we didn't have is_safe, every filter that did some kind of string
> manipulation such as input = intput + 'x' would need to end with lines
> like
>
> if isinstance(orig_input, SafeDat
_numb = models.IntegerField().
>
> Since 'ticket_numb' is an integer, you cannot return it unadorned form
> __unicode__. Return unicode(self.ticket_numb) instead.
>
> Regards,
> Malcolm
>
> --
> Two wrongs are only the beginning.
> http://www.pointy-stick.com/blog/
&
Thanks to Malcolm for helping me out, and thanks l5x for the help too!
On Dec 11, 2007 2:40 PM, l5x <[EMAIL PROTECTED]> wrote:
>
> Oops, Malcolm answered first :)
>
> >
>
--
Best Regards,
Ivan Levchenko
[EMAIL PROTECTED]
--~--~-~--~~~-
Przemyslaw Wroblewski wrote:
> When I started using django I create sth like this in my views:
>
> Somemodel.objects.filter(user = request.user)
>
> But I don't like that scheme, I just want to create something similar
> to rails like:
>
> "current_user.somemodel.find_by_name('x')"
You want th
Enrico wrote:
> Ivan, I think it's not a problem on the DB side, I'm using MySQL and
> AFAIK it just crops the string without any warning.
Then may be I am mistaken... What I'm talking about is that maxlength is
validated properly on manipulator level (method TextFi
Enrico wrote:
> Hi,
>
> It raises a "programming error":
>
> (1064, "You have an error in your SQL syntax. Check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'WARNINGS' at line 1")
Oh... Then I'm out, don't know much about MySQL in this regard. B
gabor wrote:
> so, how do you name your 'main' app in a django-project?
For me it depends on project's type.
If a project is autonomous and serves one purpose then, yes, I call the
main app 'main' and it could even be the only app in the project.
If a project is multi-purpose and just powers a
va:patrick.kranzlmueller wrote:
> self.fields = (
> forms.CheckboxSelectMultipleField(field_name="music",
> choices=MUSIC_CHOICES),
> ...
> )
I guess I know what is it... CheckboxSelectMultipleField
worksinexplicably different from SelectMultipleField i
patrickk wrote:
> thanks. the data is sent now, but
> - how do I save the data in my custom manipulator, referring to:
> temp.set_music(data['music'])
It looks like 0.91 syntax. If you're using contemporary Django it should
look like this:
temp.music = Music.objects.filter(id__id=data['mus
Aidas Bendoraitis wrote:
> Has your Music model a __str__ method? Maybe you get nothing using {{
> form.music }} because it is represented in no way.
In fact {{ form.music }} has nothing to do with the model itself. It's a
manipulator's field and should be represented as a group of
checkboxes
patrickk wrote:
> are there any workarounds?
> I´m still not able to save and retrieve the m2m-data. and since I
> have to meet a deadline I´m getting kind of nervous.
In your view code you use flatten_data() but I can't see it defined in
your custom manipulator. This must raise an exception b
patrickk wrote:
> flatten_data() doesn´t relate to the custom manipulator but to model
> resp. the changemanipulator.
I see now... And if I'm guessing correctly you're creating a FormWrapper
from user_profile_manipulator that just doesn't have that checkbox field.
Anyway making two manipulato
patrickk wrote:
> well, now I´m totally confused.
> I though that´s exactly what custom manipulators are here for:
> "You can easily create your own custom manipulators for handling
> custom forms." (django documentation).
All manipulators handle forms:
- prepare initial data
- validate data
-
patrickk wrote:
> I don´t want to stress your help, but do you know where to find an
> example on using a custom manipulator for *updating* data.
>
> question is, where does the custom manipulator gets the data (stored
> in the database) from.
> the way I did it so far:
> 1. using a changmani
patrickk wrote:
> thanks, I think I´ve got it now.
>
> the documentation of custom manipulators really lacks advanced examples.
> I don´t know how one should find out what you explained in the last
> few mails by reading the documentation.
> e.g., I´m quite sure that there´s no explanation of "
Tamara D. Snyder wrote:
> Hi all,
>
> I'm sorry, I'm sure this is an extremely simple thing that I am just
> stupidly missing. But I can't seem to figure out which revision of
> the django code I am using. I use subversion to download the "latest
> version" - but I only do it every so oft
James Mulholland wrote:
> Suppose I have a dictionary like this:
>
> data = { 'a':'1', 'b':'2', 'c':'3' }
>
> and a model like this:
>
> class Test(models.Model):
> a = models.CharField(maxlength=8)
> b = models.CharField(maxlength=8)
> b = models.CharField(maxlength=8)
>
> I would
James Bennett wrote:
> Default values are *only* filled in when the field is displayed on an
> end-user form. If you don't want to display a field, but still
> automatically fill it in, you have two options:
>
> 1) Have your view code fill it in before doing manipulator validation
> 2) Set 'blank
Greg Plesur wrote:
> But I would _not_ expect to see this:
>>>> x=SomeModel.objects.all() # This gets a QuerySet into x
>>>> value = x[0] # Some operation to actually fill x's cache
>>>> print len(x) # Verify that there are some entries in the table
>2
>
>>>> y=SomeMode
access to apache's error log and
the CGI Output Monitor they have on the control panel simply says
"Network Error".
Does anyone have an idea why I get a 500 Error on every few requests?
Thank you.
Ivan
--~--~-~--~~~---~--~~
You received this messag
Bedros Hanounik wrote:
> thanks for the quick response; that should work for me for now (low
> traffic); but I wonder how it scales with high traffic site. Also, any
> idea how this may apply to lighttpd.
In Lighty there is a "secure download" module
(http://trac.lighttpd.net/trac/wiki/Docs%3A
zenx wrote:
> Hi,
> I was wondering if it was possible to create project level template
> tags that can be called by any app template.
Create an app specially for such tags, name it like "common_tags",
include it in INSTALLED_APPS and then you can use those tags throughout
the project using {%
Sean Schertell wrote:
> Instead of
> providing some simple facility to let you override parts of the
> standard manipulators
In fact you can do just that. Though it's not clearly documented. I
recently wrote about it here:
http://groups.google.com/group/django-users/tree/browse_frm/thread/f
DavidA wrote:
> I agree that the UI could be tweaked to make it more obvious, like
> changing "Local vars" to "Click here to show local vars".
This will just make this pile of text look more scary :-). You and
Daniel didn't read it in the first place so changing text won't help.
But what will h
Wilson Miner wrote:
> That was actually a conscious decision to keep from needing support
> images for the debug pages. I wanted them to be completely
> self-contained, which is why we used the unicode glyph for the
> disclosure triangle (a pretty universal UI indicator) to indicate that
> those s
Marco Amato wrote:
> and URL.py
>
> ###
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
> # Example:
> (r'^base/$', include('test.selecto.views')),
>
> # Uncomment this for admin:
> (r'^admin/$', include('django.contrib.admin.urls')),
> )
> ###
Ice9 wrote:
> In my app1/urls.py I have something like:
>
> urlpatterns = patterns('probob.app1.views',
> (r'^$', 'index'),
> (r'^test/', 'XXX'),
> )
>
> where XXX I want to refer to 'probob.app2.views.foo'; however django is
> going to make it refer to 'probob.app.views.probob.a
[EMAIL PROTECTED] wrote:
> I
> need a clean separation between the data that is changed by
> interacting with apps and data that isn't.
You can store your data in the form of templates and use
'direct_to_template' to bind it to certain urls:
http://www.djangoproject.com/documentation/generic_vi
John M wrote:
> Curious, does that give you the full user context too?
Yes, all generic views use RequestContext. Which means you have not only
'user' available but everything that your context processors provide.
They are listed in settings as TEMPLATE_CONTEXT_PROCESSORS and you can
use your
Dirk Eschler wrote:
> In theory i can just use utf-8, but what if one participant in the line (os,
> db, browser, whatever) can't handle it?
Talking about client side, only very old browsers can't handle utf-8
(NN4 and IE4 can). Same goes for email clients. And even such simple and
'legacy'
RajeshD wrote:
> See Ivan's example code here for a hint on this:
> http://groups-beta.google.com/group/django-users/msg/f1635e9a27c6ae68
For this particular case (where you only need disable, not replace
fields) that example is an overkill. For disabling it's better to use
'follow' (James Benn
Baurzhan Ismagulov wrote:
> I'm using django 0.96 r3709. I have base.html, page1.html, and
> page2.html templates. The latter two extend the former one. base.html
> creates a box with all supported LANGUAGES. This works as
> expected in page1, but not in page2. page1 is a verdjn templatepage
> (r
gkelly wrote:
> I have been struggling with timezones in my application as well. I've
> looked into using the PyTZ module from http://pytz.sourceforge.net/
BTW it weighs about a megabyte :-). The reason is that it's not enough
to just store a deviation from UTC to get the right local time.
Diff
carlwenrich wrote:
> I have a view A that passes values (via dictionary pairs) to template
> B, which has a form that posts values to a view C. I'd like to pass a
> value from view A to view C through template B without having it appear
> as a value in a visual element of the form.
There are a co
carlwenrich wrote:
> Thanks. I like the hidden input type idea.
In practice it's harder. You will clutter your code with unnecessary
serialization and deserializations, you will have to always remember to
add values both in views and templates. And if you want to pass them not
over form submit
()' which is illegal in MySQL (5.0.24a).
Ouch... Thanks, I'll fix it shortly.
> The reason I'm posting this on django-users instead of just reporting
> the bug to Ivan directly, is because I'm curious whether this is
> "correct" behavior. If 'IN ()' i
Grigory Fateyev wrote:
> http://softwaremaniacs.org/blog/2006/10/18/highlight-js-java/
> You should try Ivan Sagalaev's code!
The actual app is here: http://softwaremaniacs.org/soft/highlight/
And until I translate it into English it's usage should be
understandable just from
Andres Luga wrote:
> I've set up MySQL to log all queries to the database. In Django I'm
> using generic views. I have the following models/tables:
> 1. Firm
> 2. Person ( ForeignKey( Firm ))
I suppose you are using a generic view from 'create_update' package that
deals with forms for object? Th
Vizcayno wrote:
> info_dict = { 'data': lst,
>'poscol': ( 2,0,11,29,18,..)
> return render_to_response('pres_marcaciones.html', info_dict)
Instead of passing this two pieces into template and handle them there
you should do this right in the view and pass already constructed tabl
Andy wrote:
> http://paste.e-scribe.com/2598/
>
> Check it out!
Wouldn't {% ifequal forloop.counter 1 %} ) (without quotes around 1) do
the trick?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gr
Vizcayno wrote:
> but the only idea
> that this recommended solution represents a double processing
> (accommodate the list) and double use of memory with 'table' restrained
> me to continue and send this message
'Premature optimization is the root of all evil' :-). In this case, if
only your da
[EMAIL PROTECTED] wrote:
> I'm using django.views.generic.list_detail.object_detail to show a
> page. Beside text it has optional "leftmenu" field. What I want to do
> is to show it in a html block if it exists (there is somethign in
> "leftmenu"). The problem is that it shows always or never.
>
Rachel Willmer wrote:
> I have a complicated query which should return the subset of a table
> whose objects match one of several conditions.
>
> What's the easiest way of doing this, given that I can't just do a SQL
> statement, because some of the conditions require me to feed the
> object's va
Carlos Yoder wrote:
> As to URLs, I'd need to support at least the following three schemes:
>
> * Language codes mapped to directories (http://maindomain.com/en/ and
> http://maindomain.com/sl/ and http://maindomain.com/es/)
> * Language codes mapped to subdomains (http://en.maindomain.com/ an
David Abrahams wrote:
> I've been running into a problem that seems very similar to
> http://code.djangoproject.com/ticket/170, although I see that that
> issue was fixed so I am betting the bug is on my end somewhere.
> Unfortunately, I'm a little green w.r.t. unicode issues so I'm hoping
> someo
David Abrahams wrote:
> Oh, wow; I may well be doing that all over. Is it possible to
> instruct Python to make that an error rather than silently succeeding
> to do something that I shouldn't do?
I'm not sure but I remember reading that in Python 2.5 it becomes a
Warning...
>> The question is
Twitchmedia wrote:
> Does anyone know if it's possible to assign tabindex values to forms in
> a Generic View within the template? Since the INPUT fields are
> automatically generated
Yet still you have access to raw data. Instead of:
{{ form.myfield }}
you can write something like:
> class Container(models.Model):
> # This is my container model. It will later be displayed as its
> # title and a list of *Thing instances which all are formatted
> # in a different fashion.
> # ofc each Container can contain any number of any *Thing model
> # instance
>
Tom Smith wrote:
> For example, I have made a change to my models.py file and I am
> logging all sql to a log file... But when I sit and watch it, the OLD
> sql is still getting executed...
>
> Could it be that having caching turned on is causing this?
>
> Does Django automatically reload py
Merric Mercer wrote:
> I'm still a little uncertain of how to put a wrapper around a generic
> view. Given the following code below how does one handle pagination and
> other
> work that generic views does automatically.
>
> from django.views.generic.list_detail import object_list
>
> def gen
Tom Smith wrote:
> So.. when doing a ps -ux I get...
>
> tomsmith 22106 0.0 0.0 6836 8 ?? SN Thu11AM 0:03.42 [python]
> tomsmith 22107 0.0 0.0 14772 8 ?? SN Thu11AM 0:06.32 [python]
> tomsmit h 22108 0.0 0.0 15352 8 ?? SN Thu11AM 0:04.84 [python]
> tomsmith 23
Grigory Fateyev wrote:
> If I undastand, your MIDDLEWARE code checks any permissions through any
> view, right?
You and Andrew use different approaches.
Your backend is checking a password against a foreign database and then
creates a new Django user corresponding to that account. You don't nee
James Bennett wrote:
> The fact that the model defines some default
> values doesn't actually mean you can leave those out -- default values
> are *only* used when displaying a form to the user, they're not
> "auto-filled" by Django in other cases.
James, the code says otherwise (or I am really l
[EMAIL PROTECTED] wrote:
> Hey,
>
> I was just wondering if someone could help me out. I want to paginate
> some views, but they are not generic. This is one of the views I want
> to paginate:
>
> def category_list(request):
> categories = Category.objects.order_by('name')
>
> retur
Karsten W. Rohrbach wrote:
>
>
> This is a very neat idea.
> Two questions arise for me as a Django newbie:
> - How do I convince django.contrib.admin to edit "*thing" contents
> inline?
> - What's the preferred method to implement a tree view for the
> resulting structure in admin (for example
[EMAIL PROTECTED] wrote:
> Specifically:
>
> unsupported operand type(s) for -: 'str' an
Oh... I've forgot to cast a string to an int :-). The line:
int(request.GET.get('page', '1'))
In fact you should also check for errors here because user can submit
something with "page=blah" and it w
Giorgio Salluzzo wrote:
> I've got some Organization, where each one has some User. A User can
> write a Ticket.
>
> How can I filter all the Ticket for a single Organization?
Ticket.objects.filter(user__organization__name='SomeOrg')
('user' and 'organization' should be the names of foreign key
Karsten W. Rohrbach wrote:
> Thanks for the quick reply. However, configurable containers with
> configurable collections of content is one of the more prominent use
> cases for a publishing platform (IMVHO) and I somehow took the "Django
> is for creating CMSes" phrase too literally, it seems.
T
[EMAIL PROTECTED] wrote:
> What is the exact status of Oracle support with Django?
> Is it fully supported? With caveats? In trunk branch?
Today was a call for test of this backend in django-developers list. So
I'd say it's roughly equivalent to "beta".
> In other words, can I finally tell my b
Guillermo Fernandez Castellanos wrote:
> In that case, people tend to hardcode teh /event/ part into the
> get_absolute_url function of the model.
There's a better (IMHO) way to do this with reverse url lookup for a
given view that Adrian has added not long before 0.95. Usually an app
knows its
Guillermo Fernandez Castellanos wrote:
> But then, is this not going against the DYR principle? In my case, if
> I have to change my mind I simply have to change a varialbe, while in
> your case I've to change the whole lot of templates, even if your
> option might be 'cleaner'.
No you shouldn't.
Guillermo Fernandez Castellanos wrote:
> And what about the admin "view on site" and the feeds? They both
> depend on the get_absolute_url. How could this be 'integrated' as well
> into your solution?
Reverse is not designed to replace get_absolute_url. It's just a more
general solution because
ElGranAzul wrote:
> Hi all.
>
> I'm creating a custom template and I'm following the instructions in
> http://www.pointy-stick.com/blog/2006/07/03/django-tips-forms-multiple-inline-objects/.
> Al works good, but when i modify the main model, the children are
> duplicated.
You're probably don't i
Benedict Verheyen wrote:
> There are about 7 possible risks types and every risk is coupled to a
> patient. Every patient has a room.
> When i display all the risks of a certain type, i also need the patient
> info and the room, sorted by the room.
> That's why is was trying to get the roomnumber
Rob Hudson wrote:
> The place I need it is the:
> class CommentFormNode(template.Node):
You probably need it in this node's 'render' method. There you have a
context passed to it and this context is exactly the thing that holds
all the variables including 'user'. So this is it:
class
[EMAIL PROTECTED] wrote:
> Now with django, I am trying to run through the "Are you generic"
> tutorial. When I go out to the URL, I get a 404 "Page not found"
> message, but absolutely no more information as to where to look! I
> thought by using the devel version with the verbosity flag, i
Le Roux Bodenstein wrote:
> Surely if I put it
> in a model or a view or whatever somewhere it will only be called the
> first time that module gets loaded?
The settings module is always imported so you can import your handling
code there and put dispatch.connect beside the handling code.
--~--
[EMAIL PROTECTED] wrote:
> Sorry if this is poorly explained, but how do you efficiently get
> around circular dependency problems like this in Python? I'd hate to
> have to drop my import of functions_db to the individual methods on
> "Object" to avoid whatever collision is happening.
Another (i
Marcin Jurczuk wrote:
> Hello,
> I'm writing my own validator based on shipped with django and wondering
> how get validated object.id field ?
Validators come in two varieties: those linked to field definitions in
models and those that linked to field definitions in custom manipulators.
With fi
Milan Andric wrote:
> I was told in IRC to extend AutomaticManipulator. But I don't really
> know what this means in terms of Django/Python code.
Basically you create a manipulator class inherited from an automatic
manipulator of a model. It will create all the needed FormFields based
on model
dchandek wrote:
> I've looked at authentication backends and middleware, but it looks
> like the default Django installation expects users to login through a
> Django form.
Default system insist on storing logged user credentials in a session
(though they can be of any nature). In your case you
Ivan Sagalaev wrote:
> request.user = User.objects.get_or_create(
>username=username,
>defaults={...})
This one should be:
request.user, created = User.objects.get_or_create(...)
`get_or_create` returns an object and a flag if it was newl
Brian Beck wrote:
> I just wanted to add that if you want to use this method in combination
> with the bundled admin interface, you're gonna have to intercept any
> admin requests and do the authentication
... which is achieved by placing this middleware before standard auth
middleware.
--~--~-
Brian Beck wrote:
> I don't understand how this is related to the admin interface.
Admin interface won't display a login page if you already have
request.user set to an existing user. (if I'm not mistaken :-) ).
> Anyway,
> shouldn't it go after the standard auth middleware, so that
> django.co
Kai Kuehne wrote:
> models.py:
> def genres_title_list(self, separator=', '):
> return separator.join([x.title for x in self.genres])
If I reconstruct the case correctly and `genres` is a relation to child
objects with ForeignKey to a Movie then `self.genres` by default should
look
marksibly wrote:
> I couldn't find a 'HttpResponseStaticFile' class or anything, so what
> other options do I have?
You can pass an open file to a usual HttpResponse:
f = open(filename, 'rb')
return HttpResponse(f, mimetype='application/octet-stream')
> Also, how efficient would it be
101 - 200 of 514 matches
Mail list logo