> Okay, I get it now. Sorry, I need to read more carefully. It would save
> me a lot of time.
>
> Colleen
No worries, just glad someone is finding this stuff useful ;-)
Robert
Shannon -jj Behrens wrote:
>> You don't *need* recursion on templates for threaded messages like
>>your example app, that's exactly the point :)
>
>
> Julio, with all due respect for your programming prowess, I *like*
> recursion. It can often make hard problems easy, even when generating
> HT
Colleen Owens wrote:
> On 09 Feb, 2006, at 13.21, Robert Wittams wrote:
>
>
>
> I'd be happy to write this up once I get it working. The problem I'm
> having right now is that there seems to be no elegant way of updating
> the dictionary bound_related_object_
Colleen Owens wrote:
>>Did you read the line:
>>
>>Inline editing can be customised. rather than using
>>edit_inline=meta.TABULAR or meta.SOURCE, you can define a custom inline
>>editing mode. This is done by subclassing BoundRelatedObject?, and using
>>that class. eg edit_inline=HorizontalScrolle
Colleen Owens wrote:
>>There is a simple way to create special admin templates for one object.
>>See
>>http://code.djangoproject.com/wiki/NewAdminChanges#Adminconvertedtoseparatetemplates
>>
>>HTH,
>>Edgars
>
>
> Thanks for the link, I hadn't seen this before. I basically derived the
> same solu
Adrian Holovaty wrote:
> On 1/29/06, Pasi Savolainen <[EMAIL PROTECTED]> wrote:
>
>>class Foo (meta.Model):
>> name = meta.CharField (maxlength=100):
>> def __repr__(self):
>> return name;
>>- -
>>
>>note missing 'self.' from __repr__.
>>
>>The surprising result was that I got a _
Adrian Holovaty wrote:
> On 1/12/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
>>On Jan 12, 2006, at 8:09 AM, Simon Willison wrote:
>>
>>>Maybe it would be useful for all Django model objects to gain
>>>themselves a duplicate() method which does exactly this - returns
>>>an identical object
[EMAIL PROTECTED] wrote:
> I've spent some time experimenting with Nevow's LivePage (aka LiveEvil)
> fuctionality that allows the server to "send" events to the web page.
> It seems to do this by doing an AJAX-style request to the server, and
> then the server doesn't send any data back until eith
Emanuele wrote:
> Hi,
> I'd like to give read-only access to some objects in admin interface to
> selected users. I know that django admin interface is CRUD and I can
> give only create/update/delete permissions to users, but is there a way
> to solve my problem (other than creating my templates a
Adrian Holovaty wrote:
>
>
>>- we have automatic fields for createdate and updatedate (auto_now,
>>auto_now_add). what about automatically inserting the logged in user who
>>creates (or updates) the record? i don´t know about anybody else, but i need
>>that all the time. that´s especially intere
[EMAIL PROTECTED] wrote:
> Hi!
>
> After reading tutorial about Django, try to write simple app. App
> contain only one model:
> class PressureRecord(meta.Model):
> record_date = meta.DateField()
> record_time = meta.TimeField()
> sys_press = meta.IntegerField()
> dia_press = meta
PythonistL wrote:
> Robert,
> Thank you for your reply.
> I am not still an expert( only a beginner) on Django. I tried to copy
> the example from
> http://www.djangoproject.com/documentation/forms/
> and there was no mention about manipulator.flatten_data() .
> Is there any example /description
PythonistL wrote:
> Robert,
> no manipulator.flatten_data() is not nescessary for that.
But, it is extremely stupid not to use it, because that will cause your
form to break if you use any of a wide number of features : foreignkeys,
dates, inline editing, raw_id admin, etc etc. It pretty much
> (FYI, the method I was referring to is created by "magic", and has
> probably already been removed from the magic-removal branch. It is
> django.core.meta.manipulator_flatten_data(), but since this is tied so
> closely into the admin code it probably wouldn't do much for you. Sorry
> to send you
Burhan wrote:
> class META:
> admin = meta.Admin(
> list_display=('name','price'),
> list_filter=('price'),
This list_filter value is not a tuple. It is just a string in brackets.
This means that we iterate th
[EMAIL PROTECTED] wrote:
> Please take a look at this:
>
> from django.core import meta
> from django.models.core import sites
>
> class Group(meta.Model):
> site = meta.ForeignKey(sites.Site)
>
> class Product(meta.Model):
> group = meta.ForeignKey(Group)
> class META:
>
braver wrote:
> A symbol which is a unique string is not the story here, it turns out
> -- dynamic language is!
>
> has_many :milestones
>
> is apparently a call which generates code inside of the class! Can it
> be replicated in python for ORM purposes?
>
>
Not really. Read up on metaclasse
Great!
Shame we're going to break the apis ;-)
So a couple of points -
* the app template loader would probably have seemed less tedious than
the full path thing. Ie just 'templates' in the app directory.
Things that might be worth showing in a slightly longer screencast:
Templates:
* T
Joel wrote:
> I gave django a try at work to develop a survey application. Turned out
> pretty sweet, I felt very productive and spent most of my time
> concentrating on survey tasks. I felt frustrated twice, these are the
> hurdles I faced that I feel I have probably missed obvious solutions
>
>
tonemcd wrote:
> Whoa, this is very neat...
>
> I see the /admin/csv_thing/ URL getting dispatched to (presumably) a
> method in the target app, - is this correct?
>
> If so (big drum roll here), does that mean a method in my_app can get
> the content of 'result_list' from change_list.html, and
olive wrote:
> In template
> C:\soft\Python24\lib\site-packages\django\contrib\admin\templates\admin/change_form.html,
> error at line 80
> 'block' tag with name 'extrahead' appears more than once
> 70
> 71{% endfor %}
> 72{% endif %}
> 73{% endif %}
> 74{% endif %}
> 75
>
Brett Hoerner wrote:
> Robert Wittams wrote:
>
>>both auto_now and auto_now_add are quite hackish little puppies.
>>
>>auto_now should really be equivalent to a _pre_save that sets the field
>>to the current time.
>>
>>auto_now_add should really be equi
both auto_now and auto_now_add are quite hackish little puppies.
auto_now should really be equivalent to a _pre_save that sets the field
to the current time.
auto_now_add should really be equivalent to a non-editable field that
gets set to the current time on insert, and is just statically displ
There really is no sensible way around the requirement for transactions,
unless you want to check every constraint yourself.
It is planned to go in before 0.91, AFAIK.
> Yep, this worked, thanks, except that it was
> admin//change_list.html (or my_app, dunno, name is the same,
> anyway just one subdir needed, not one),
Both should work.
> and of course no .html
Doh! ;-)
> extension in "extends". Good stuff.
>
Jaanus wrote:
> Hi,
>
> Django is cool :-) Im currently looking at it to possibly use it in
> several high-profile initiatives. So far so good.
>
> One thing I came across is a question of whether I can easily customize
> subsections of admin. Now the tutorials explain it nicely about
> admin_ba
Ian Holsman wrote:
> shouldn't a warning/informational message be generated in this case.
> something like
>
> $ django-admin install markup
> INFO: no models found to install.. skipping markup
>
> ?
Given that the command acts on a model module, *not* on an app, this
wouldn't work. It will ins
Robert Wittams wrote:
> Maniac wrote:
>
>>Robert Wittams wrote:
>>
>>
>>>Why are you flattening the data again? You only do this once, when
>>>extracting the data out of the object instance (or the defaults). The
>>>data is already 'flat
Maniac wrote:
>
> Robert Wittams wrote:
>
>> Why are you flattening the data again? You only do this once, when
>> extracting the data out of the object instance (or the defaults). The
>> data is already 'flat' when it comes out of a POST. do_html2python get
Kenneth Gonsalves wrote:
> On Saturday 03 Dec 2005 4:48 pm, Robert Wittams wrote:
>
>>Kenneth Gonsalves wrote:
>>
>>>hi,
>>>when using AddManipulator and returning the form for correcting
>>>errors, the select field does not get populated with the
James Bennett wrote:
> While setting up a new project tonight, I was running through and
> doing a 'django-admin.py install' for each of the apps from
> django.contrib I'll be using, and when I got to the markup app, I got
> the following error:
>
> Error: No module named markup. Are you sure you
Kenneth Gonsalves wrote:
> hi,
> when using AddManipulator and returning the form for correcting
> errors, the select field does not get populated with the choice
> selected. I could do this manually, but does django have a way of
> doing it automatically?
If using trunk, are you using flatten
> @inclusion_tag("myapp/menu")
That should be
@register.inclusion_tag("myapp/menu")
Jiri Barton wrote:
> Hello there,
>
> I have the following problem. Here's my template fragment; it defines a
> menu:
>
>
> mushrooms
> cheese
> tomatoes
> onion
>
>
> Now, I'd like to be able to highlight one item in some templates, and
> another item in other templates. Only
[EMAIL PROTECTED] wrote:
> Hi
>
> I know this has been talked about before but I'm having real trouble
> getting a handle on customising template tags
>
> What i want to do is alter the admin change list screen to show some
> related values. Now the python's easy it's just a couple of lines in
>
Medium wrote:
>
> hi,
>
> i'm very new to django (basically a few days) and have read almost all
> the docs, wikis and mailing list archives (well the topics which
> interest me at least). I have a few questions I was hoping anyone on the
> list could help me with concerning customizing the beha
Ksenia wrote:
> Hi,
>
> I have quite a big form, with all kind of fileds. All fields might be
> blank, so i use everywhere blank=True and with integer- float- and
> datefields also null=True.
> When I am trying to save existed record, I get the message "Please
> correct the errors below.", but no
stava wrote:
> I'm trying to use generic views together with the newly separated admin
> templates, but it's failing miserably.
>
> I specify the generic view I want to use in url.py:
> countries = {
> 'app_label': 'ttime',
> 'module_name': 'countries',
> }
> urlpatterns = patterns('',
> (r
David Ascher wrote:
> I'm trying to figure out how best to do per-user data (think of the
> relationship between users and her photos on flickr).
>
> I notice that there's a nifty concept of "permissions", which in some ways
> is per-user binary data. There is also the mostly undocumented (?)
>
plisk wrote:
> Anyone working on this ? Would be great to have such functionality, so
> if noone started to do it i could give a look. Also where will this
> bidirectional ManyToMany select appear in itemtypes, below all the
> controls it has in model ?
>
>
I am working on core-fields removal a
Simon Willison wrote:
>
>
> On 18 Nov 2005, at 15:26, Robert Wittams wrote:
>
>> Hm, maybe when DEBUG is on, CommonMiddleware should put up an
>> interstitial page to tell the developer what is happening? It does seem
>> to bite a lot of people.
>
>
[EMAIL PROTECTED] wrote:
> Hi
>
> I've just defined a manytomany relationship in the following way
>
> class ItemType(meta.Model):
> name = meta.CharField(maxlength=100)
> descritpion = meta.CharField(maxlength=250)
>
> class PropertyType(meta.Model):
> name = meta.CharField(maxleng
David Ascher wrote:
> Stumbling blocks:
> * figuring out that I had to do "import
> django.contrib.markup.templatetags.markup" to get the markup filters
> registered was harder than it should have been.
Did {% load markup %} not work? Maybe this tag needs to be pointed out
more prominently - it is
limodou wrote:
>>This isn't very well documented right now.
>>See "http://www.djangoproject.com/documentation/model_api/";, under
>>DateTimeField:
>>
>>"the admin represents this as two fields, with
>>JavaScript shortcuts. "
>
>
> But there are no JavaScript shortcuts in output code of generic
limodou wrote:
>>Fields can create multiple FormFields.
>
>
> So you mean Fields is not the same as FormFields, and the splited
> FormFields can be combine again as auto saving to DB? But if I want to
> manually create a form in template, what rule should I followed with ?
> Is there some docume
limodou wrote:
> I want to use generic view to create my model polls's form html code,
> but I found pub_date is split to pub_date_date and pub_date_time, I
> want to know if there are some documents remind this. I used below
> code:
>
> {% for field in form.fields %}
> {{field}}
> {% endfor %}
>
Sean Perry wrote:
>
> I have the following classes in my model:
>
> class Category:
> description = charField()
>
> class Thing:
> self.description = charField()
> self.category(ForeignKey, Category)
>
> I would like a page layed out like:
>
> Category1
> * foo
> * bar
> * baz
>
Simon Willison wrote:
>
>
> On 14 Nov 2005, at 06:06, Tom Tobin wrote:
>
>> A bit stumped here . . . Is there a recommended convention for
>> repeating blocks within a template? e.g., I have a paginated
>> object_list generic view, and I want to repeat my pager code (i.e.,
>> "back", "next")
tonemcd wrote:
> Thanks for the info Robert - I was aiming at using some of the forms
> etc. functionality from the admin interface in my own applications
> (trying to not re-invent the wheel).
>
> I will have a look around the admin_list.py code and see whether I can
> pick things up from there.
frank h. wrote:
> hello,
> how can i reuse some features of the admin app in my external
> applications?
> the search_fields and date_hierarchy features are so nice!
> is there a simple way?
> -frank
>
>
Your best bet is the new-admin branch. However, the particular features
you have mentioned
tonemcd wrote:
> I hate to do this, but - me too!
>
> I've svn'ed the new-admin branch in the hope that it would be easier to
> do it from that checkout, but no joy as yet.
>
>
Not really sure what you want to do, so I hope the reply to frank h will
help you too.
[EMAIL PROTECTED] wrote:
> Incredible. I checked this out yesterday and it was revisions 1157
>
> This morning, 1168, things are really moving fast on this branch
>
> Thanks this version doesn't have the same problem
>
>
This was due to me forgetting to save/commit a few files after merging
A
[EMAIL PROTECTED] wrote:
> Hi
>
> I currently have the trunk django running a little prject on my server
> (it's working well its a great product)
>
> However when I come to make a second application some of the things I
> need to do I'm told are only possible in the new admin branch.
>
> I nee
Adrian Holovaty wrote:
> On 11/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>>It's a bit of a problem for me because i want to do this.
>>
>>Allow users to create a Purchase Order which has several Items (of
>>equipment) so item's are edited inline with purchase orders.
>>
>>Then for each
Ian Holsman wrote:
> is anyone else interested in joining? I was thinking of similar to
> what phpBB does.
>
> If so I propose we open up a sourceforge project, or perhaps we could
> even host it on code.djangoproject.com if they let us ;-)
>
> any volunteers?
>
> regards
> Ian
>
> --
> [EMAIL
kmh wrote:
>>On 10/20/05, kmh <[EMAIL PROTECTED]> wrote:
>>
>>>Shouldn't we encourage a model where site templates are able to
>>>explicitly "include" application templates, rather than the other way
>>>around?
>
>
>>On 10/20/05, Sune Kirkeby <[EMAIL PROTECTED]> wrote:
>>That's not how applicati
Ian Maurer wrote:
> I didn't get very far with the new branch. My template is failing to
> render right off the bat... I haven't had a chance to investigate
> this, but my templates were/are working just fine under the main
> branch. Below is the end of my traceback... any thoughts?
>
> -ian
>
>
Ian Maurer wrote:
> I didn't get very far with the new branch. My template is failing to
> render right off the bat... I haven't had a chance to investigate
> this, but my templates were/are working just fine under the main
> branch. Below is the end of my traceback... any thoughts?
>
> -ian
I c
Alice wrote:
> thanks :)
>
> did anything ever come of it?
>
> I agree that if a clean implementation cannot be done, it shouldn't.
> There was another interesting idea that a block could be referenced as
> a variable
>
> {% block content %}
> {% endblock %}
>
> {{ content }}
>
> or perhaps
>
Andreas Stuhlmüller wrote:
> Robert Wittams wrote:
>
>>I can't really work this out without more information. Could you file a
>>ticket with a minimal example. ( or at least include a backtrace. )
>
>
> I didn't expect you to solve the probl
Andreas Stuhlmüller wrote:
> Robert Wittams wrote:
>
>>Alternatively, the easy way to do this would be to use
>>template_decorators.py from the new-admin branch
>
>
> The simple tag decorator looks like an extremely useful enhancement. At
> the moment I'm not
Ian Maurer wrote:
> That's a pretty slick implementation, I'd like to try it out... some
> questions:
>
> Is it in a usable format?
> Are there any directions for pulling this branch down to my local environment?
> What happens if the main branch gets updated?
>
>
> thanks...
> ian
>
>
>
W
Ian Maurer wrote:
> Is there a way to create a manipulator that will span a foreign key
> relationship, similar to the "edit_inline" feature in the Admin tool?
>
> I know I cannot leverage the edit_inline feature now (ticket #535 may
> fix that) but is there a "smart" way of leveraging the valida
Andreas Stuhlmüller wrote:
> Hi Adrian,
>
>
>>In your case, pass ITEM_NAMES[item.type]
>>to the template context.
>
>
> Easier said than done. The template was intended to do something like
> this:
>
> {% for item in items %}
> {{ ITEM_NAMES[item.type] }}
> {% endfor %}
>
> Is it possibl
> >
> Hm, I don't know how you're implementing it (maybe I'll switch to the
> new-admin trunk tomorrow, just to take a look), but I think you can
> implement it fairly simply without the problems you describe above.
Well, it is not implemented fully yet. The main changes for this will be
in djan
[EMAIL PROTECTED] wrote:
> Hi there,
>
> I'm very new to Django and I'm learning it by adapting the stuff from
> the tutorial to a new (test) application, a Forum. The tutorial nicely
> explains that you don't want "Polls" and "Choices" in the main menu,
> because "Choices" is a part of "Poll". W
David S. wrote:
> I am wondering how best to serve PDF files in Django.
>
> I am using ReportLab to generate a file.
>
> So should I name it and place it where the server can fetch it?
>
> Does the URL have to end in pdf for it to be handled by the browser?
>
> Can I configure the develo
[EMAIL PROTECTED] wrote:
> Hi All
>
> I would like to be able to implement onchange functionality for form
> fields in my django app.
>
> My app has a Questions Module which has related Module Answers edited
> inline (just like in django admin)
>
> Questions can be correct or incorrect and only
Adrian Holovaty wrote:
> On 9/28/05, Robert Wittams <[EMAIL PROTECTED]> wrote:
>
>>However, the patch I have been making to clean up the admin and
>>metasystem, on ticket #535, includes a feature that may help.
>>
>>Rather than doing edit_inline=meta
mortenbagai wrote:
> Hello,
>
> I have two model objects, Section and Page. Each Page is mapped to a
> Section through a regular ForeignKey field. On the Section edit detail
> display in the Django admin app, I'd like to list the Page objects
> belonging to that Section and having a few fields be
Have you got PIL installed?
http://www.pythonware.com/products/pil/
Adrian Holovaty wrote:
> On 9/18/05, Eric Walstad <[EMAIL PROTECTED]> wrote:
>
>>I'd like to make a base class for my model classes that defines some
>>fields but doesn't result in a table in the database. If my base class
>>is derived from meta.Model, then django makes a table for it in the
>>d
scottpierce wrote:
> See http://code.djangoproject.com/ticket/338. The patch works.
>
> Scott Pierce
>
>
So basically, mainipulators are completely useless when it comes to
ForeignKeys and ManyToManys and need to be hacked around in the view
function?
This is a horrible fix. I'm going to fix
I have a problem wherein no select field is prepopulated in any update
form, or a create form where I provide some already filled fields.
I investigated this, and now I have no idea how this has ever worked :
in
http://code.djangoproject.com/browser/django/trunk/django/core/formfields.py#l114
Milton Waddams wrote:
> I'm trying to associate multiple users with a team and each user having a
> specific role within that team.
>
> eg. not my situation though easiest way to make it clear what I'm attempting
> to achieve...
> CEO = meta.ForeignKey(User)
> CFO = meta.ForeignKey(User)
>
> w
75 matches
Mail list logo