Re: Best way to pass data to a HttpResponseRedirect?

2007-07-27 Thread patrick k.

we are using a context_processor.

e.g., the view for a login-page could look like this:

if everythins is ok:
request.session['messages'] = ['message', 'You are logged in.']
return HttpResponseRedirect(referer)
else:
 messages = ['error', 'Some error message.']

and then, you can use a context_processor:

TEMPLATE_CONTEXT_PROCESSORS = (
 
 'www.views.context_processors.get_messages',
)

get_messages could look like this (get_messages checks the session  
and returns a message-dict):

def get_messages(request):

 messages = []
 if request.session.get('messages'):
 messages = [request.session['messages'][0], request.session 
['messages'][1]]
 del request.session['messages']

 return {
 'messages': messages,
 }

patrick


Am 27.07.2007 um 08:57 schrieb Michael Lake:

>
> Hi all
>
> Nis Jørgensen wrote:
>> The argument to HttpResponseRedirect is a url. You seem to be  
>> confusing
>> it with a template.
>
> OK I can do this:
>
>   code 
>   # some error occurs
>   message = 'You have ... tell admin that '
>   return HttpResponseRedirect('error/')
>
> and have in views.py
>
> def error(request, message):
> {
>return render_to_response('error_page.html', {'message':message})
> }
>
> But how to get the message into error() without passing it as a GET?
>
>> If you want to display different content, you need
>> to pass a different url or (not recommended) store the data you  
>> want to
>> display, then display it to the user at the new url
>
>> But if you have the data available, there is no reason to do a  
>> redirect.
>> Just render the error message etc to the relevant template, then  
>> return
>> that to the user.
>
> Why I dont want to pass it like this ?message='You have ... tell  
> admin that '
> is that its long and if the error is something like main?delete=100  
> but the user cant
> delete that id then a Redirect goes to a nice clean valid URL.
> A render_to_response leaves the incorrect URL in the browser.
>
> Mike
> -- 
>
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: html sanitizers

2007-07-13 Thread patrick k.

it´s easy to write a customized sanitizer using beautifulsoup.
http://www.crummy.com/software/BeautifulSoup/

1) place beautifulsoup.py somewhere in your pythonpath
2) build your sanitizer and save it somewhere on your pythonpath
in my case it´s called eatMe and looks like this:
http://dpaste.com/hold/14305/

your sanitizer will probably be less complicated ...

3) in your models.py, do something like this:

def isGoodHTML(field_data, all_data):
 from eatMe import doEatMe
 if field_data:
 new_field_data = doEatMe(field_data)
 if new_field_data != all_data['summary']:
 all_data['summary'] = new_field_data
 raise validators.ValidationError, "The errors in your  
document were automatically corrected. Please check again!"

isGoodHTML.always_test = True

...

summary = models.TextField(validator_list=[isGoodHTML])

note: I know this looks complicated, but if you built your sanitizer  
once you can always reconfigure and reuse it.
we use the above example for text-fields in the admin (with TinyMCE).

patrick

Am 13.07.2007 um 11:23 schrieb Derek Anderson:

>
> hey all,
>
> could anyone point me to a python html sanitizer implementation (or
> example)?  i don't mean to strip all html, just tags and attributes  
> not
> on a whitelist, such as I/B/A href/U/etc.
>
> danke,
> derek
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Beginner's question (take two)

2007-07-10 Thread patrick k.

there was a discussion about this issue a while ago - adrian said  
that he wants to add the possibility to translate app_names (don´t  
know if this feature has been added though).
changing index.html is a rather uncomfortable solution from my point  
of view.

thanks,
patrick

Am 10.07.2007 um 01:11 schrieb Chris Rich:

>
> Cool thanks,
>   Yeah I was didn't think there was a meta class for the app names.
> I'll go fiddle around with it.
>
> Chris
>
> On Jul 9, 3:23 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
>>> Quick question.  Is there any way to add a verbose name for
>>> one of my apps?  I have an app named my_transfers and in the
>>> admin index view
>>
>> Ah...I missed that it was the *app* not the Model that you were
>> looking for.
>>
>> According to django/contrib/admin/templates/admin/index.html
>>
>> you want to affect the value of {{app_list.name}}  This is
>> assigned in the django/contrib/admin/templatetags/adminapplist.py
>>
>> Tracing this back to db/models/base.py where it's assigned, and
>> looking at several other places in the code, this looks like this
>> needs to be a name that can be used in identifier contexts.
>>
>> However, since it's just being pulled into the template, you can
>> tweak the django/contrib/admin/templates/admin/index.html and its
>> kin to pull a prettified app-name if desired for presentation
>> purposes, and fall back to the original code if not specified.
>>
>> -tim
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: caching and authentication

2007-07-07 Thread patrick k.


Am 07.07.2007 um 19:36 schrieb Honza Král:

> On 7/7/07, patrick k. <[EMAIL PROTECTED]> wrote:
>>
>>
>> Am 07.07.2007 um 02:13 schrieb Jeremy Dunck:
>>
>>>
>>> On 7/6/07, patrickk <[EMAIL PROTECTED]> wrote:
>>>>
>>>> when having a header where the username and a logout-button is
>>>> displayed, how do you cache this page/view?
>>>
>>> There's a CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting if you want to  
>>> only
>>> do anonymous caching.
>>>
>>> But I think you must have your cache middleware in the wrong  
>>> order if
>>> you're seeing this problem.
>>
>> I�m not using the cache middleware.
>>
>>>
>>> page_cache and the cache middleware both are keyed by the Vary  
>>> header,
>>> and the Vary header will contain 'Cookie' if you've accessed the
>>> session object-- which you must have done if you have the  
>>> request.user
>>> in your template.
>>
>> I�m currently using the per-view cache (well, actually I�m  
>> using the
>> low-level cache because of the mentioned problems).
>>
>> I�d like to cache individual views - the only thing changing is the
>> header (either "username/logout" or "login/register"), everything
>> else is the same.
>
> if its that case, you could write your own middleware that would
> rewrite the page - just put some placeholder where this information is
> supposed to go, and let the middleware handle it

I have to check that ... currently, I´ve no idea how this could be  
done (but I guess the docs will tell me).

>
> OR
>
> do not cache the entire page, but rather some reusable blocks or  
> data...

that was the initial question. when caching part of the page, I have  
to render the templates twice.
first render the cached part and then the dynamic part. this leads to  
strange templates though (because I´m caching the whole page except  
for one line of code).

I don´t understand why the page_cache is keyed by the vary header and  
the view_cache is not. is there a reason for this?

thanks,
patrick

>
>>
>> thanks,
>> patrick
>>
>>
>>>
>>> Please post your MIDDLEWARE_CLASSES tuple.
>>>
>>>> is this (using the low-level cache) the best way doing this?
>>>>
>>>
>>> I'm not convinced you need it.
>>>
>>>>
>>
>>
>>>
>>
>
>
> -- 
> Honza Kr�l
> E-Mail: [EMAIL PROTECTED]
> ICQ#:   107471613
> Phone:  +420 606 678585
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: caching and authentication

2007-07-07 Thread patrick k.


Am 07.07.2007 um 02:13 schrieb Jeremy Dunck:

>
> On 7/6/07, patrickk <[EMAIL PROTECTED]> wrote:
>>
>> when having a header where the username and a logout-button is
>> displayed, how do you cache this page/view?
>
> There's a CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting if you want to only
> do anonymous caching.
>
> But I think you must have your cache middleware in the wrong order if
> you're seeing this problem.

I´m not using the cache middleware.

>
> page_cache and the cache middleware both are keyed by the Vary header,
> and the Vary header will contain 'Cookie' if you've accessed the
> session object-- which you must have done if you have the request.user
> in your template.

I´m currently using the per-view cache (well, actually I´m using the  
low-level cache because of the mentioned problems).

I´d like to cache individual views - the only thing changing is the  
header (either "username/logout" or "login/register"), everything  
else is the same.

thanks,
patrick


>
> Please post your MIDDLEWARE_CLASSES tuple.
>
>> is this (using the low-level cache) the best way doing this?
>>
>
> I'm not convinced you need it.
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Attributes for ManyToMany

2007-07-06 Thread patrick k.

here it is:
http://code.djangoproject.com/browser/django/trunk/tests/modeltests/ 
m2m_intermediary/models.py

Am 06.07.2007 um 11:03 schrieb Thomas Güttler:

>
> Hi,
>
> How can you add attributes to ManyToMany Relations?
>
> Given the example:
> http://www.djangoproject.com/documentation/models/many_to_many/
>
> Publication -- N:M -- Article
>
> How can you store the page number of the published article?
>
>  Thomas
>
> -- 
> Thomas Güttler, http://www.tbz-pariv.de/
> Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917
> TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
> Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Attributes for ManyToMany

2007-07-06 Thread patrick k.

usually, if you want to have additional fields with a m2m-relation  
you have to use an intermediary table with a foreignkey (e.g. with  
edit-inline).
if this page is working, there´s an example:
http://www.djangoproject.com/documentation/models/

howerver, if you want to have the page-number for an article you may  
just add a field "page_number" to your article-model.

patrick

Am 06.07.2007 um 11:03 schrieb Thomas Güttler:

>
> Hi,
>
> How can you add attributes to ManyToMany Relations?
>
> Given the example:
> http://www.djangoproject.com/documentation/models/many_to_many/
>
> Publication -- N:M -- Article
>
> How can you store the page number of the published article?
>
>  Thomas
>
> -- 
> Thomas Güttler, http://www.tbz-pariv.de/
> Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917
> TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
> Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms view-question

2007-06-25 Thread patrick k.

I do agree. helper methods for every special case is not the solution.
on the other hand, it´s just not clear sometimes how things could/ 
should be done. I´d just wish for more "best practice" advice and  
more complex examples (esp. in the docs).

regards,
patrick

Am 25.06.2007 um 16:51 schrieb Malcolm Tredinnick:

>
> On Mon, 2007-06-25 at 16:41 +0200, patrick k. wrote:
>> thanks malcolm.
>>
>> get_initial_data should be defined in the form, I think. because the
>> form doesn´t necessarily relate to a model, so the model is probably
>> the wrong place.
>> I´m a bit surprised that this isn´t easier/cleaner with newforms.
>
> You can't really be surprised that Django doesn't include helper  
> methods
> for every special case. Particularly when writing your own method  
> takes
> four lines of code. There's a limit on how easy something can be,  
> given
> that the model, the field list, the form field names and the mapping
> between form fields and model fields are all variables.
>
> Regards,
> Malcolm
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms view-question

2007-06-25 Thread patrick k.

thanks malcolm.

get_initial_data should be defined in the form, I think. because the  
form doesn´t necessarily relate to a model, so the model is probably  
the wrong place.
I´m a bit surprised that this isn´t easier/cleaner with newforms.

nevertheless, looks a bit better now:

def do_save(form, model, fields):
 for field in fields:
 setattr(model, field, form.cleaned_data[field])

def get_initial_data(model, fields):
 return dict([(f, getattr(model, f)) for f in fields])

def chg_userdata(request, user_id):
 user_data = User.objects.get(pk=request.user.id)
 user_profile = UserProfile.objects.get(user=request.user)

 if request.method == 'POST':
 form = UserProfileForm(request.POST)
 if form.is_valid():
 do_save(form, user_profile, ['sex', 'date_of_birth',  
'phone_number', 'place_address', 'place_zip_code', 'place_location',  
'place_state'])
 user_profile.save()
 do_save(form, user_data, ['first_name', 'last_name'])
 user_data.save()
 else:
 initial_data = get_initial_data(user_profile, ['sex',  
'date_of_birth', 'phone_number', 'place_address', 'place_zip_code',  
'place_location'])
 initial_data['place_state'] = user_profile.get_state_id
 initial_data['first_name'] = user_data.first_name
 initial_data['last_name'] = user_data.last_name
 form = UserProfileForm(initial=initial_data)

 return render_to_response('site/user/form_userdata.html', {
 'form': form,
 }, context_instance=RequestContext(request))


thanks again,
patrick


Am 25.06.2007 um 16:07 schrieb Malcolm Tredinnick:

>
> Hi Patrick,
>
> On Mon, 2007-06-25 at 15:50 +0200, patrickk wrote:
>> here´s my view (I think the form-class is not so important for my
>> question):
>>
>>  if request.method == 'POST':
>>  form = UserProfileForm(request.POST)
>>  if form.is_valid():
>>  # SAVING
>>  user_profile.sex = form.cleaned_data['sex']
>>  user_profile.date_of_birth = form.cleaned_data
>> ['date_of_birth']
>>  user_profile.phone_number = form.cleaned_data
>> ['phone_number']
>>  user_profile.place_address = form.cleaned_data
>> ['place_address']
>>  user_profile.place_zip_code = form.cleaned_data
>> ['place_zip_code']
>>  user_profile.place_location = form.cleaned_data
>> ['place_location']
>>  if form.cleaned_data['place_state']:
>>  user_profile.place_state_id = int(form.cleaned_data
>> ['place_state'])
>>  else:
>>  user_profile.place_state_id = ""
>>  user_profile.save()
>>  user_data.first_name = form.cleaned_data['first_name']
>>  user_data.last_name = form.cleaned_data['last_name']
>>  user_data.save()
>>  else:
>>  # INITIAL_DATA
>>  initial_data = {'sex': user_profile.sex,
>>  'first_name': user_data.first_name,
>>  'last_name': user_data.last_name,
>>  'date_of_birth': user_profile.date_of_birth,
>>  'phone_number': user_profile.phone_number,
>>  'place_address': user_profile.place_address,
>>  'place_zip_code': user_profile.place_zip_code,
>>  'place_location': user_profile.place_location,
>>  'place_state': user_profile.get_state_id,
>>  }
>>  form = UserProfileForm(initial=initial_data)
>>
>> problem is: I´d like to clean this view by eliminating SAVING and
>> INITIAL_DATA,
>
> Good design question. You're right, there should be a way to make this
> easier. You could define methods like get_initial_data on your  
> model, as
> you suggest. However, the drawbacks are that it will be a bit  
> repetitive
> if you have to do this for many models and it doesn't play nicely with
> models from other applications (e.g. a model from Django's core) that
> you can't really edit.
>
> Another approach is to write a couple of functions that take a list of
> fields and a model instance. For example (untested code):
>
> def do_save(form, model, fields):
>for field in fields:
>   setattr(model, field, form.cleaned_data[field])
>
> def get_initial_data(model, fields):
>return dict([(f, getattr(model, f)) for f in fields])
>
> If you were always going to be working with *all* the fields on the
> model, you could even leave out the 'fields' parameter and get that
> dynamically by iterating through model._meta.fields, but that is a
> little more fiddly -- you might need to leave out auto_pk fields and
> stuff like that.
>
> Regards,
> Malcolm
>
> -- 
> I don't have a solution, but I admire your problem.
> http://www.pointy-stick.com/blog/
>
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this 

Re: newforms, unicode and umlauts

2007-06-22 Thread patrick k.

thanks for your answer. I´ve been trying to solve this for about 8  
hours ... finally giving up.
so, I´ll switch to the unicode-branch.

Am 22.06.2007 um 02:02 schrieb Malcolm Tredinnick:

>
> On Thu, 2007-06-21 at 16:23 +0200, va:patrick.kranzlmueller wrote:
>> the code below does not give a validation error when typing umlauts,
>> but the umlauts are not saved to the database.
>>
>> al_re = re.compile(r'^\w+$', re.UNICODE)
>>
>> def clean_last_name(self):
>>  if 'last_name' in self.cleaned_data:
>>  if not al_re.search(self.cleaned_data['last_name']):
>>  raise forms.ValidationError('Error message.')
>>  return self.cleaned_data['last_name']
>>
>> when doing "print self.cleaned_data" I´m getting this:
>> 'last_name': u'M\xfcller',
>>
>> how am I supposed to deal with umlautes when using newforms?
>> btw: all our data is utf-8
>
> There are lots of little bugs like this on trunk at the moment. If you
> want to use non-ASCII characters, switch to using the Unicode branch.
> It's completely up-to-date with trunk (merged about twice a week,
> providing there are no risky changes on trunk that haven't settled).
>
> Part of the problem is that newforms (on trunk) tries hard to be
> unicode-aware, but the transition from unicode to byestrings is not
> handled well in other places in the framework. That is why we are  
> making
> all the changes on Unicode branch (which will soon be on trunk).
>
> Regards,
> Malcolm
>
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How is profile_callback in django-registration supposed to work?

2007-06-19 Thread patrick k.

profile_callback, defined in registration.models (of course, you  
could also define it somewhere else ...)

from www.user.models import UserProfile
...

def profile_callback(user):
new_user_profile = UserProfile.objects.create(user=user,
 status="1")
new_user_profile.save()

hope that helps,
patrick




Am 19.06.2007 um 20:13 schrieb [EMAIL PROTECTED]:

>
> Patrick, could you share your def profile_callback, or at least the
> important parts of it. I'm still not getting anything created.
>
> On Jun 19, 1:04 pm, "patrick k." <[EMAIL PROTECTED]> wrote:
>> I´m using profile_callback=True and then def profile_callback 
>> (user) ...
>>
>> it works.
>>
>> patrick
>>
>> Am 19.06.2007 um 20:02 schrieb [EMAIL PROTECTED]:
>>
>>
>>
>>> I've set:
>>> def create_inactive_user(self, username, password, email,
>>> send_email=True, profile_callback=create_site_user):
>>
>>> also tried profile_callback=create_site_user() -- wrong number of
>>> arguments and profile_callback=create_site_user(new_user) but  
>>> new_user
>>> doesn't exist yet.
>>
>>> I have a create_site_user function:
>>
>>> def create_site_user(new_user):
>>> site_user = SiteUser.model(
>>> user = new_user,
>>> city = '',
>>> state = '',
>>> country = '',
>>> zip = '',
>>> show_real_name = True,
>>> interests = '',
>>> occupation = '',
>>> gender = '',
>>> birthday = None,
>>> homepage = '',
>>> icq = '',
>>> aim = '',
>>> yahoo = '',
>>> msn = ''
>>> )
>>> site_user.save()
>>
>>> But I can't seem to get this to work.
>>> profile_callback=create_site_user doesn't seem to call the function
>>> (there's definitely nothing being created), and I can't pass the  
>>> user,
>>> since they don't really exist yet.
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How is profile_callback in django-registration supposed to work?

2007-06-19 Thread patrick k.

I´m using profile_callback=True and then def profile_callback(user) ...

it works.

patrick

Am 19.06.2007 um 20:02 schrieb [EMAIL PROTECTED]:

>
> I've set:
> def create_inactive_user(self, username, password, email,
> send_email=True, profile_callback=create_site_user):
>
> also tried profile_callback=create_site_user() -- wrong number of
> arguments and profile_callback=create_site_user(new_user) but new_user
> doesn't exist yet.
>
> I have a create_site_user function:
>
> def create_site_user(new_user):
> site_user = SiteUser.model(
> user = new_user,
> city = '',
> state = '',
> country = '',
> zip = '',
> show_real_name = True,
> interests = '',
> occupation = '',
> gender = '',
> birthday = None,
> homepage = '',
> icq = '',
> aim = '',
> yahoo = '',
> msn = ''
> )
> site_user.save()
>
> But I can't seem to get this to work.
> profile_callback=create_site_user doesn't seem to call the function
> (there's definitely nothing being created), and I can't pass the user,
> since they don't really exist yet.
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Survey: FileBrowser and FancyUpload

2007-06-18 Thread patrick k.

thanks for the feedback so far. I´m just waiting, if there´s more  
feedback.

so far, it´s very clear that the integration of fancyupload is disliked.

thanks,
patrick

Am 16.06.2007 um 17:54 schrieb itsnotvalid:

>
> By the way I like the idea of Gmail upload methods too.
> But a flash plugin could do something like "drag 'n drop" file
> uploading which, javascript doesn't seem to cut right now.
> It could be integrated as an option, not a requirement.
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FileBrowser v 2.0

2007-06-11 Thread patrick k .

I personally wouldn´t want anybody except trusted editors to work  
with the filebrowser.

besides that, you only have to change
{% extends "admin/base_site.html" %}} to your own base-file
and change
myview staff_member_required(never_cache(myview))
to
myview = login_required(myview)

you may want to change the urls also (as well as the styles, but that 
´s up to you).

so, the filebrowser basically _is_ a "project app", it just _looks_  
like a django.contrib add-on.

patrick

Am 11.06.2007 um 15:27 schrieb oliver:

>
> sorry i mean more as a project application. with out running it via
> the admin side.
>
> On Jun 11, 9:01 am, "patrick k." <[EMAIL PROTECTED]> wrote:
>> what exactly do you mean by "django app"?
>> do you mean that it could be installed into /django/contrib/?
>>
>> if yes, what´s the advantage of doing that?
>> moreover, should external applications be installed there (I thought
>> about that, but it doesn´t seem quite the right thing to do ...)?
>>
>> patrick
>>
>> Am 11.06.2007 um 09:47 schrieb oliver:
>>
>>
>>
>>> hi patrick,
>>
>>> could your filebrowser be also made as a django app? I think that
>>> would be pretty handy or?
>>
>>> On Jun 10, 10:41 am, patrick k. <[EMAIL PROTECTED]> wrote:
>>>> image-editing with picnik is also possible now.
>>>> see the installation-guide for more details:http://trac.dedhost-
>>>> sil-076.sil.at/trac/filebrowser/wiki
>>
>>>> that´s it for this version of the filebrowser - there´ll  
>>>> probably be
>>>> some minor changes due to user-feedback within the next couple of
>>>> weeks.
>>
>>>> patrick
>>
>>>> Am 08.06.2007 um 08:38 schrieb patrick k.:
>>
>>>>> integration of basic image-editing with SNIPSHOT is done.
>>>>> just set USE_SNIPSHOT to True in fb_settings and change the
>>>>> SNIPSHOT_CALLBACK_URL and you´re ready to go.
>>
>>>>> NOTES:
>>>>> ### be aware that it´s not possible to edit pictures in the popup-
>>>>> window.
>>>>> ### security issue: because of snipshots callback_agent, it´s not
>>>>> possible to set staff_member_required.
>>>>> ### right now, it´s a very simple integration which will probably
>>>>> change in the future.
>>
>>>>> patrick
>>
>>>>> Am 07.06.2007 um 18:52 schrieb patrickk:
>>
>>>>>> I´ve just released a new version of the filebrowser:
>>>>>> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
>>
>>>>>> I´ve tested it and it works fine with my settings (OSX with  
>>>>>> firefox
>>>>>> 2, safari 2, opera 9) - however, additional testing is never
>>>>>> senseless.
>>>>>> so, if you find the time to do some testing, please give me some
>>>>>> feedback ...
>>
>>>>>> list of updates/improvements:
>>>>>> ### better coding (well, ...) and improved readability of the  
>>>>>> code
>>>>>> ### renaming files is now possible
>>>>>> ### thumbnails are clickable (also when using the  
>>>>>> FileBrowseField)
>>>>>> ### make thumbs for a whole directory
>>>>>> ### seperate settings-file (fb_settings.py) - maybe the settings
>>>>>> will
>>>>>> be stored in the database with the next version
>>>>>> ### set thumbnail size
>>>>>> ### improved thumbnail quality
>>>>>> ### improved error handling with multiple file upload
>>>>>> ### and some other minor updates/improvements
>>
>>>>>> notes:
>>>>>> ### the filebrowser is prepared for i18n, although it´s not fully
>>>>>> integrated yet
>>
>>>>>> things to come:
>>>>>> ### i18n
>>>>>> ### integration of snipshot and picnik for basic image-editing
>>>>>> (already working on that one)
>>
>>>>>> where the community could help:
>>>>>> ### check the english phrases before i18n is done (since  
>>>>>> english is
>>>>>> not my first language, that´d be very helpful)
>>>>>> ### testing with different browsers (esp. the js-section with the
>>>>>> FileBrowseField and TinyMCE)
>>>>>> ### if someone is able to do a FileBrowseField that´d be great
>>>>>> (so we
>>>>>> can get rid of the javascript-hooks) - unfortunately, I don´t  
>>>>>> have
>>>>>> the time and knowledge doing that
>>>>>> ### integrating patch for large streaming uploads resp. upload
>>>>>> progress bar
>>>>>> ### don´t know if it makes sens to use newforms for multiple  
>>>>>> file-
>>>>>> upload
>>
>>>>>> thanks,
>>>>>> patrick.
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FileBrowser v 2.0

2007-06-11 Thread patrick k.

what exactly do you mean by "django app"?
do you mean that it could be installed into /django/contrib/?

if yes, what´s the advantage of doing that?
moreover, should external applications be installed there (I thought  
about that, but it doesn´t seem quite the right thing to do ...)?

patrick

Am 11.06.2007 um 09:47 schrieb oliver:

>
> hi patrick,
>
> could your filebrowser be also made as a django app? I think that
> would be pretty handy or?
>
>
>
> On Jun 10, 10:41 am, patrick k. <[EMAIL PROTECTED]> wrote:
>> image-editing with picnik is also possible now.
>> see the installation-guide for more details:http://trac.dedhost-
>> sil-076.sil.at/trac/filebrowser/wiki
>>
>> that´s it for this version of the filebrowser - there´ll probably be
>> some minor changes due to user-feedback within the next couple of  
>> weeks.
>>
>> patrick
>>
>> Am 08.06.2007 um 08:38 schrieb patrick k.:
>>
>>
>>
>>> integration of basic image-editing with SNIPSHOT is done.
>>> just set USE_SNIPSHOT to True in fb_settings and change the
>>> SNIPSHOT_CALLBACK_URL and you´re ready to go.
>>
>>> NOTES:
>>> ### be aware that it´s not possible to edit pictures in the popup-
>>> window.
>>> ### security issue: because of snipshots callback_agent, it´s not
>>> possible to set staff_member_required.
>>> ### right now, it´s a very simple integration which will probably
>>> change in the future.
>>
>>> patrick
>>
>>> Am 07.06.2007 um 18:52 schrieb patrickk:
>>
>>>> I´ve just released a new version of the filebrowser:
>>>> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
>>
>>>> I´ve tested it and it works fine with my settings (OSX with firefox
>>>> 2, safari 2, opera 9) - however, additional testing is never
>>>> senseless.
>>>> so, if you find the time to do some testing, please give me some
>>>> feedback ...
>>
>>>> list of updates/improvements:
>>>> ### better coding (well, ...) and improved readability of the code
>>>> ### renaming files is now possible
>>>> ### thumbnails are clickable (also when using the FileBrowseField)
>>>> ### make thumbs for a whole directory
>>>> ### seperate settings-file (fb_settings.py) - maybe the settings  
>>>> will
>>>> be stored in the database with the next version
>>>> ### set thumbnail size
>>>> ### improved thumbnail quality
>>>> ### improved error handling with multiple file upload
>>>> ### and some other minor updates/improvements
>>
>>>> notes:
>>>> ### the filebrowser is prepared for i18n, although it´s not fully
>>>> integrated yet
>>
>>>> things to come:
>>>> ### i18n
>>>> ### integration of snipshot and picnik for basic image-editing
>>>> (already working on that one)
>>
>>>> where the community could help:
>>>> ### check the english phrases before i18n is done (since english is
>>>> not my first language, that´d be very helpful)
>>>> ### testing with different browsers (esp. the js-section with the
>>>> FileBrowseField and TinyMCE)
>>>> ### if someone is able to do a FileBrowseField that´d be great  
>>>> (so we
>>>> can get rid of the javascript-hooks) - unfortunately, I don´t have
>>>> the time and knowledge doing that
>>>> ### integrating patch for large streaming uploads resp. upload
>>>> progress bar
>>>> ### don´t know if it makes sens to use newforms for multiple file-
>>>> upload
>>
>>>> thanks,
>>>> patrick.
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FileBrowser v 2.0

2007-06-10 Thread patrick k .

image-editing with picnik is also possible now.
see the installation-guide for more details: http://trac.dedhost- 
sil-076.sil.at/trac/filebrowser/wiki

that´s it for this version of the filebrowser - there´ll probably be  
some minor changes due to user-feedback within the next couple of weeks.

patrick

Am 08.06.2007 um 08:38 schrieb patrick k.:

>
> integration of basic image-editing with SNIPSHOT is done.
> just set USE_SNIPSHOT to True in fb_settings and change the
> SNIPSHOT_CALLBACK_URL and you´re ready to go.
>
> NOTES:
> ### be aware that it´s not possible to edit pictures in the popup-
> window.
> ### security issue: because of snipshots callback_agent, it´s not
> possible to set staff_member_required.
> ### right now, it´s a very simple integration which will probably
> change in the future.
>
> patrick
>
> Am 07.06.2007 um 18:52 schrieb patrickk:
>
>>
>> I´ve just released a new version of the filebrowser:
>> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
>>
>> I´ve tested it and it works fine with my settings (OSX with firefox
>> 2, safari 2, opera 9) - however, additional testing is never
>> senseless.
>> so, if you find the time to do some testing, please give me some
>> feedback ...
>>
>> list of updates/improvements:
>> ### better coding (well, ...) and improved readability of the code
>> ### renaming files is now possible
>> ### thumbnails are clickable (also when using the FileBrowseField)
>> ### make thumbs for a whole directory
>> ### seperate settings-file (fb_settings.py) - maybe the settings will
>> be stored in the database with the next version
>> ### set thumbnail size
>> ### improved thumbnail quality
>> ### improved error handling with multiple file upload
>> ### and some other minor updates/improvements
>>
>> notes:
>> ### the filebrowser is prepared for i18n, although it´s not fully
>> integrated yet
>>
>> things to come:
>> ### i18n
>> ### integration of snipshot and picnik for basic image-editing
>> (already working on that one)
>>
>> where the community could help:
>> ### check the english phrases before i18n is done (since english is
>> not my first language, that´d be very helpful)
>> ### testing with different browsers (esp. the js-section with the
>> FileBrowseField and TinyMCE)
>> ### if someone is able to do a FileBrowseField that´d be great (so we
>> can get rid of the javascript-hooks) - unfortunately, I don´t have
>> the time and knowledge doing that
>> ### integrating patch for large streaming uploads resp. upload
>> progress bar
>> ### don´t know if it makes sens to use newforms for multiple file-
>> upload
>>
>> thanks,
>> patrick.
>>
>>>
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FileBrowser v 2.0

2007-06-08 Thread patrick k .

integration of basic image-editing with SNIPSHOT is done.
just set USE_SNIPSHOT to True in fb_settings and change the  
SNIPSHOT_CALLBACK_URL and you´re ready to go.

NOTES:
### be aware that it´s not possible to edit pictures in the popup- 
window.
### security issue: because of snipshots callback_agent, it´s not  
possible to set staff_member_required.
### right now, it´s a very simple integration which will probably  
change in the future.

patrick

Am 07.06.2007 um 18:52 schrieb patrickk:

>
> I´ve just released a new version of the filebrowser:
> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
>
> I´ve tested it and it works fine with my settings (OSX with firefox
> 2, safari 2, opera 9) - however, additional testing is never  
> senseless.
> so, if you find the time to do some testing, please give me some
> feedback ...
>
> list of updates/improvements:
> ### better coding (well, ...) and improved readability of the code
> ### renaming files is now possible
> ### thumbnails are clickable (also when using the FileBrowseField)
> ### make thumbs for a whole directory
> ### seperate settings-file (fb_settings.py) - maybe the settings will
> be stored in the database with the next version
> ### set thumbnail size
> ### improved thumbnail quality
> ### improved error handling with multiple file upload
> ### and some other minor updates/improvements
>
> notes:
> ### the filebrowser is prepared for i18n, although it´s not fully
> integrated yet
>
> things to come:
> ### i18n
> ### integration of snipshot and picnik for basic image-editing
> (already working on that one)
>
> where the community could help:
> ### check the english phrases before i18n is done (since english is
> not my first language, that´d be very helpful)
> ### testing with different browsers (esp. the js-section with the
> FileBrowseField and TinyMCE)
> ### if someone is able to do a FileBrowseField that´d be great (so we
> can get rid of the javascript-hooks) - unfortunately, I don´t have
> the time and knowledge doing that
> ### integrating patch for large streaming uploads resp. upload
> progress bar
> ### don´t know if it makes sens to use newforms for multiple file- 
> upload
>
> thanks,
> patrick.
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django-users] FileBrowser v 2.0

2007-06-07 Thread patrick k.


Am 07.06.2007 um 19:24 schrieb Simon Drabble:

> On Thu, 7 Jun 2007, patrickk wrote:
>
>>
>> I´ve just released a new version of the filebrowser:
>> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
>>
>> things to come:
>> ### i18n
>> ### integration of snipshot and picnik for basic image-editing
>> (already working on that one)
>>
>> thanks,
>> patrick.
>
>
> Patrick,
>
> Are you planning on/ do you have any support for tagging? I'm working
> on a (very alpha) personal file management app geared towards photos,
> audioclips, and movies, the prime motivator being to allow easy  
> tagging
> of large sets of files.
>
> No sense duplicating wheel-construction so if you have tagging support
> planned or available I may take a look at your app.

sounds interesting, but the FileBrowser is basically an extension to  
the admin-interface,
so I think it´s a bit "out of scope".

I won´t say that it´s never going to happen, but there´s more  
important stuff to fix before.

patrick.

>
> -Simon.
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: best practice for portal-like pages?

2007-06-07 Thread patrick k.

did you take a look at the scripts I provided? it seems that this  
might solve your problem.

another thing: my question was not about doing a CMS, it´s about  
combining and displaying different types of content on portal-like  
pages (which, of course, might be part of a CMS). and it´s also not  
about "small company websites", but about bigger sites with lots of  
different content-types and at least a couple of different editors.

when reading reviews about django - esp. when django is compared with  
rails - it seems that django should suit these type of sites very  
well. and, as I´ve mentioned before, there _are_ a couple of bigger  
newspaper-sites out there. on the other hand, I haven´t seen a nice  
solution for this so far. I´m just wondering how people actually do  
these overview-sites (sorry, but I don´t have a better word for it ...).

thanks,
patrick


Am 07.06.2007 um 15:16 schrieb omat:

>
> I am also in need of such a flexible yet easy to manage content
> system, mostly for small company websites.
>
> In my primitive prototype, I have pages that are built-up of sections.
> Each section has its own template and can hold text, images, etc.
> Also, I am planning to add the ability to display data dynamically
> form another application.
>
> I am not willing to write the content administration part, but this
> flexibility makes it very hard to manage content using the built-in
> admin application. For example, a 50 page website with 10 sections per
> page on average shows up as a list of 500 sections, which is not very
> practical to manage.
>
> That's why I am not very satisfied with my application and would like
> to hear from others about this.
>
>
> There is nothing fancy about my model but just for reference, here it
> is:
>
>
> class SectionType(models.Model):
> name = models.CharField(maxlength = 50)
>
> def __str__(self):
> return self.name
>
> class Admin:
> pass
>
>
> class Section(models.Model):
> type = models.ForeignKey(SectionType)
> title = models.CharField(maxlength = 150,
>  blank = True)
> body = models.TextField(blank = True,
> null = True)
>
> def __str__(self):
> return '%s (%s)' % (self.title,
> self.type)
>
> class Admin:
> pass
>
>
> class SectionImage(models.Model):
> section = models.ForeignKey(Section,
> edit_inline = models.STACKED,
> null = True)
> image = models.ImageField(upload_to = 'section/image/')
>
> class Admin:
> pass
>
>
> class Page(models.Model):
> title = models.CharField(
>  maxlength = 100,
>  core = True,
>  db_index = True)
> slug = models.SlugField(prepopulate_from = ('title',))
> body = models.TextField(blank = True,
> null = True)
> sections = models.ManyToManyField(Section,
>   blank = True,
>   null = True)
>
> parent = models.ForeignKey('self',
>blank = True,
>null = True)
>
> order = models.PositiveSmallIntegerField(blank = True,
>  null = True)
>
> related_pages = models.ManyToManyField('self',
>blank = True,
>null = True)
>
> def __str__(self):
> parents = ''
> parent = self.parent
> while parent:
> parents = '%s :: %s' % (parent.title,
> parents,)
> parent = parent.parent
> return '%s%s (%s)' % (parents,
>   self.title,
>   self.slug)
>
> def get_absolute_url(self):
> return '%s/' % (self.slug)
>
> class Admin:
> pass
>
>
>
>
> On 7 Haziran, 10:39, "patrick k." <[EMAIL PROTECTED]> wrote:
>> this is just another request for feedback. I know that there are some
>> newspaper-sites out there, made with django. so, I assume, they´ve
>> solved this issue. It´d be great to know how they make/construct the
>> overview- resp. front-pages (in a way to make changes easily for
>> editors).
>>
>> thanks,
>> patrick
>>
>> Am 03.06.2007 um 19:28 schrieb oggie rob:
>>
>>
>>
>>> Ahh, yeah, I suppose so! I didn't really think the render

Re: best practice for portal-like pages?

2007-06-07 Thread patrick k.

this is just another request for feedback. I know that there are some  
newspaper-sites out there, made with django. so, I assume, they´ve  
solved this issue. It´d be great to know how they make/construct the  
overview- resp. front-pages (in a way to make changes easily for  
editors).

thanks,
patrick

Am 03.06.2007 um 19:28 schrieb oggie rob:

>
> Ahh, yeah, I suppose so! I didn't really think the rendered text
> through, and you're right that it has the same flexibility.
>
>  -rob
>
> On Jun 3, 2:40 am, "patrick k." <[EMAIL PROTECTED]> wrote:
>> actually, I don´t have to change the view for whatever layout I want
>> to have with my approach ...
>>
>> patrick
>>
>> Am 03.06.2007 um 00:40 schrieb oggie rob:
>>
>>
>>
>>> The advantage is you get to organize your additions in the base
>>> template (which is where you should strive to manage layout & L as
>>> much as possible). Your solution works fine for a row-by-row  
>>> example,
>>> but is less flexible for a more complex layout. For example, if you
>>> want to have a two- or three-column view, it is easier to manage  
>>> this
>>> by changing it once in the base template than trying to tweak the  
>>> view
>>> function. What's more, portals are often associated with "skins"  
>>> - it
>>> would be much more flexible to have the choice of a few "base"
>>> templates (representing different skins) with completely different
>>> layouts for the "sub" templates. If you were looking for a generic
>>> solution, I think you should consider that.
>>
>>> Not sure about how the "specific template" would fit in there
>>> though... but I don't see major limitations with the approach I
>>> described vs. your original proposal. In a case where you can't
>>> generalize the view you probably want to save it as an html  
>>> snippet in
>>> the database, I suppose.
>>
>>>  -rob
>>
>>> On Jun 2, 11:16 am, "patrick k." <[EMAIL PROTECTED]> wrote:
>>>> what´s the advantage of including the sub-templates in the template
>>>> instead of rendering them in the view?
>>>> rendering the templates in the view seems to be a bit more flexible
>>>> when it comes to caching, I guess.
>>
>>>> besides, a custom entry could have its own specific template -  
>>>> so, I
>>>> ´m not sure how you´d deal with this.
>>
>>>> thanks,
>>>> patrick
>>
>>>> Am 02.06.2007 um 20:07 schrieb oggie rob:
>>
>>>>> Using the "include" tag, you can provide the template through a
>>>>> variable
>>>>> e.g. {% include template1 %} instead of {% include 'mysite/
>>>>> movies.html' %}
>>>>> so you can pass this stuff from the view.
>>>>> What's more, the include template uses the context from the  
>>>>> "parent"
>>>>> template. So you can also pass all this information from the view.
>>>>> For example, your view could work as follows (code is littered  
>>>>> with
>>>>> mistakes but you should get the idea):
>>>>> def my_portal(request, user_id):
>>>>> template_list = get_portal_template_list(user_id) # returns  
>>>>> list
>>>>> of strings, representing template names
>>>>> data = {'templates':template_list}
>>>>> for template in template_list:
>>>>> data.update(get_template_data(template, user_id))
>>>>> render_to_response(data, "base_template.html")
>>
>>>>> in base_template.html
>>>>> {% for item in template_list %}
>>>>> {% include item %}
>>>>> {% endfor %}
>>
>>>>> You may also organize & test a little more using the "with" tag  
>>>>> (it
>>>>> appears to works alongside "include"). e.g (with a modified view):
>>>>> {% for item in template_list %}
>>>>>{% with item.data as data %}
>>>>>  {% include item.template %}
>>>>>{% endwith %}
>>>>> {% endfor %}
>>
>>>>> then in the included template:
>>>>> {{ data.field1 }}
>>>>> {{ data.field2 }}
>>
>>>>> HTH,
>>>>>  -rob
>>
>>>>> On Jun 2, 4:51 am, patrickk <[EMAIL PROTECTED]

Re: best practice for portal-like pages?

2007-06-02 Thread patrick k.

what´s the advantage of including the sub-templates in the template  
instead of rendering them in the view?
rendering the templates in the view seems to be a bit more flexible  
when it comes to caching, I guess.

besides, a custom entry could have its own specific template - so, I 
´m not sure how you´d deal with this.

thanks,
patrick

Am 02.06.2007 um 20:07 schrieb oggie rob:

>
> Using the "include" tag, you can provide the template through a
> variable
> e.g. {% include template1 %} instead of {% include 'mysite/
> movies.html' %}
> so you can pass this stuff from the view.
> What's more, the include template uses the context from the "parent"
> template. So you can also pass all this information from the view.
> For example, your view could work as follows (code is littered with
> mistakes but you should get the idea):
> def my_portal(request, user_id):
> template_list = get_portal_template_list(user_id) # returns list
> of strings, representing template names
> data = {'templates':template_list}
> for template in template_list:
> data.update(get_template_data(template, user_id))
> render_to_response(data, "base_template.html")
>
> in base_template.html
> {% for item in template_list %}
> {% include item %}
> {% endfor %}
>
> You may also organize & test a little more using the "with" tag (it
> appears to works alongside "include"). e.g (with a modified view):
> {% for item in template_list %}
>{% with item.data as data %}
>  {% include item.template %}
>{% endwith %}
> {% endfor %}
>
> then in the included template:
> {{ data.field1 }}
> {{ data.field2 }}
>
> HTH,
>  -rob
>
> On Jun 2, 4:51 am, patrickk <[EMAIL PROTECTED]> wrote:
>> This is a problem we´re having with every webpage we did with django
>> so far.
>> Now, I´d like to make this more generic and write a tutorial for how
>> a portal-like page could be done using django.
>>
>> As an example, let´s say we have a database with movies, stars
>> (actors, writers, directors ...), cinemas/theatres, interviews,  
>> image-
>> galleries, trailers, filmfestivals, ...
>> Now, the editors should be able to "build" a page (e.g. the front-
>> page) with different blocks of content like:
>> 1. a single object (e.g. a movie, star, interview ...)
>> 2. combined objects: a combination of x objects (e.g. "godard-
>> special" with a relation to a star (godard), a cinema where the
>> special takes place and several movies)
>> 3. pre-defined blocks (like "recent comments", "recent interviews",
>> "most discussed movies" ...)
>> 4. custom entries
>>
>> ### 1 and 4 is easy: for 1, we can use a generic foreign key. for 4,
>> we´re using a second table ("custom entries") and also a generic
>> foreign key - so 1 and 4 is basically the same.
>> ### For 2, we could also use the table "custom entries", but with a
>> second table "custom entries item" for the (multiple) generic  
>> relations.
>> ### for 3, we could either use template-tags or custom methods.
>>
>> The models are here:http://dpaste.com/hold/11537/
>> And the view is here:http://dpaste.com/hold/11538/
>>
>> So, the question are:
>> 1) Could this be done easier or more generic?
>> 2) How and where to define the custom methods?
>>
>> With the given models, we could construct a page like this:
>> #1 Movie Nr. 1234
>> #2 custom method "Recent Comments"
>> #3 Interview Nr. 3456
>> #4 Custom Entry "Godard-Special" (a custom entry with relations to a
>> star, a cinema and several movies)
>> #5 custom method "Get Banner"
>> #6 Star Nr. 789
>>
>> Note: The templates could be saved to the database for making editing
>> easier (although I personally don´t like storing templates within a
>> database).
>>
>> It´d be nice to see this issue solved in a resusable manner. To me,
>> it seems a bit complicated the way we´re doing it right now.
>> Comments and Feedback is much appreciated ...
>>
>> Thanks,
>> Patrick
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: profiling django / import error: no module named profile

2007-05-24 Thread patrick k.

thanks david. it´s working now (although I´m having problems  
interpreting the stats, but that´s another question).

for everyone who´s reading this, here´s more about the python- 
profiler on debian:
http://mail.python.org/pipermail/tutor/2005-March/036677.html

thanks,
patrick


Am 24.05.2007 um 17:13 schrieb David Reynolds:

> Patrickk,
>
> On 24 May 2007, at 2:15 pm, patrickk wrote:
>
>>
>> I´m just trying to do some profiling based on
>> http://code.djangoproject.com/wiki/ProfilingDjango
>>
>> when trying to import hotshot.stats I´m getting this:
>> Traceback (most recent call last):
>>File "", line 1, in ?
>>File "/usr/lib/python2.4/hotshot/stats.py", line 3, in ?
>>  import profile
>> ImportError: No module named profile
>>
>> any ideas?
>>
>
> If you're on Debian or Ubuntu:
>
> # aptitude install python-profiler
>
> Thanks,
>
> David
>
> -- 
> David Reynolds
> [EMAIL PROTECTED]
>
>


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: offset without limit: slicing behaviour

2007-05-17 Thread patrick k.

answering myself:

it still works, but allow_empty has to be false when using generic  
views.

patrick.

Am 17.05.2007 um 21:16 schrieb patrickk:

>
> before doing a django-update today, this has been working:
>
> {% for object in object_list|slice:"0::3" %}
> ... left column
>
> {% for object in object_list|slice:"1::3" %}
> ... middle column
>
> {% for object in object_list|slice:"2::3" %}
> ... right column
>
> now, I´m getting:
> Assertion Error: 'offset' is not allowed without 'limit'
>
> any reason why this has been working and isn´t anymore?
>
> thanks,
> patrick
>
>
>
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Announcing django_xmlrpc

2007-05-14 Thread patrick k.

that´s it. sorry.

thanks for the help.
patrick

Am 14.05.2007 um 17:47 schrieb Graham Binns:

>
> There's a typo in that list, assuming it's a straight copy and paste:
>
>  'django.django_xmlrpc,'
>
> Should read:
>
>  'django.django_xmlrpc', # The comma was placed /before/ the
> closing quote instead of after it.
>
> If that doesn't fix it, let me know.
>
> Cheers,
>
> Graham
>
> On May 14, 4:39 pm, "patrick k." <[EMAIL PROTECTED]> wrote:
>> INSTALLED_APPS = (
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.sites',
>>  'django.contrib.admin',
>>  'django.django_xmlrpc,'
>>  'django.contrib.flatpages',
>>  'www.movies',
>>  'www.trailer',
>>  'www.stars',
>>  'www.cinemas',
>>  'www.announcers',
>>  'www.container',
>>  'www.games',
>>  'www.promos',
>>  'www.festivals',
>>  'www.user',
>>  'www.configuration',
>>  'www.custom_tags',
>> )
>>
>> thanks.
>> patrick
>>
>> Am 14.05.2007 um 17:33 schrieb Graham Binns:
>>
>>
>>
>>> That's... bizarre.
>>
>>> Could you post the INSTALLED_APPS section of your settings.py  
>>> here for
>>> me?
>>
>>> Cheers,
>>
>>> Graham
>>
>>> On May 14, 2:54 pm, "patrick k." <[EMAIL PROTECTED]> wrote:
>>>> 1. no error when importing from the shell, if  
>>>> django.django_xmlrpc is
>>>> NOT in the installed apps.
>>>> 2. not able to launch the shell when django.django_xmlrpc IS in the
>>>> installed apps.
>>
>>>> I´ve tried to put the package somewhere else but that doesn´t  
>>>> change
>>>> anything.
>>
>>>> thanks,
>>>> patrick
>>
>>>> Am 14.05.2007 um 15:36 schrieb CodeDragon:
>>
>>>>> Hi Patrick,
>>
>>>>> I can't seem to reproduce this error myself. Could you try  
>>>>> importing
>>>>> django.django_xmlrpc through the interactive shell and  
>>>>> reproduce the
>>>>> output for me?
>>
>>>>> Also, it might be worth trying to put the django_xmlrpc package
>>>>> somewhere else in your PYTHONPATH rather than under the Django
>>>>> directory.
>>
>>>>> Thanks in advance,
>>
>>>>> Graham
>>
>>>>> On May 14, 8:59 am, "patrick k." <[EMAIL PROTECTED]>  
>>>>> wrote:
>>>>>> thanks for the code, graham.
>>
>>>>>> I tried to install django_xmlrpc as described on the google-site.
>>>>>> I did the checkout to my django-directory and added
>>>>>> django.django_xmlrpc to the installed apps.
>>>>>> when I start the dev-server I get the following error-message:
>>>>>> AttributeError: 'module' object has no attribute 'django_xmlrpc,'
>>
>>>>>> what´s wrong?
>>
>>>>>> thanks,
>>>>>> patrick
>>
>>>>>> Am 13.05.2007 um 23:06 schrieb CodeDragon:
>>
>>>>>>> Hi all,
>>
>>>>>>> Here's a note to let you know that there is now an XML-RPC  
>>>>>>> server
>>>>>>> app
>>>>>>> for Django publicly available under an open-source license.
>>
>>>>>>> django_xmlrpc allows you to expose any function through XML-
>>>>>>> RPC. I'm
>>>>>>> currently working on adding introspection and useful things like
>>>>>>> system.multicall functionality to the code.
>>
>>>>>>> You can find django_xmlrpc, along with instructions at
>>>>>>> http://code.google.com/p/django-xmlrpc.
>>
>>>>>>> Cheers,
>>
>>>>>>> Graham
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Announcing django_xmlrpc

2007-05-14 Thread patrick k.

INSTALLED_APPS = (
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.django_xmlrpc,'
 'django.contrib.flatpages',
 'www.movies',
 'www.trailer',
 'www.stars',
 'www.cinemas',
 'www.announcers',
 'www.container',
 'www.games',
 'www.promos',
 'www.festivals',
 'www.user',
 'www.configuration',
 'www.custom_tags',
)

thanks.
patrick

Am 14.05.2007 um 17:33 schrieb Graham Binns:

>
> That's... bizarre.
>
> Could you post the INSTALLED_APPS section of your settings.py here for
> me?
>
> Cheers,
>
> Graham
>
> On May 14, 2:54 pm, "patrick k." <[EMAIL PROTECTED]> wrote:
>> 1. no error when importing from the shell, if django.django_xmlrpc is
>> NOT in the installed apps.
>> 2. not able to launch the shell when django.django_xmlrpc IS in the
>> installed apps.
>>
>> I´ve tried to put the package somewhere else but that doesn´t change
>> anything.
>>
>> thanks,
>> patrick
>>
>> Am 14.05.2007 um 15:36 schrieb CodeDragon:
>>
>>
>>
>>> Hi Patrick,
>>
>>> I can't seem to reproduce this error myself. Could you try importing
>>> django.django_xmlrpc through the interactive shell and reproduce the
>>> output for me?
>>
>>> Also, it might be worth trying to put the django_xmlrpc package
>>> somewhere else in your PYTHONPATH rather than under the Django
>>> directory.
>>
>>> Thanks in advance,
>>
>>> Graham
>>
>>> On May 14, 8:59 am, "patrick k." <[EMAIL PROTECTED]> wrote:
>>>> thanks for the code, graham.
>>
>>>> I tried to install django_xmlrpc as described on the google-site.
>>>> I did the checkout to my django-directory and added
>>>> django.django_xmlrpc to the installed apps.
>>>> when I start the dev-server I get the following error-message:
>>>> AttributeError: 'module' object has no attribute 'django_xmlrpc,'
>>
>>>> what´s wrong?
>>
>>>> thanks,
>>>> patrick
>>
>>>> Am 13.05.2007 um 23:06 schrieb CodeDragon:
>>
>>>>> Hi all,
>>
>>>>> Here's a note to let you know that there is now an XML-RPC server
>>>>> app
>>>>> for Django publicly available under an open-source license.
>>
>>>>> django_xmlrpc allows you to expose any function through XML- 
>>>>> RPC. I'm
>>>>> currently working on adding introspection and useful things like
>>>>> system.multicall functionality to the code.
>>
>>>>> You can find django_xmlrpc, along with instructions at
>>>>> http://code.google.com/p/django-xmlrpc.
>>
>>>>> Cheers,
>>
>>>>> Graham
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Announcing django_xmlrpc

2007-05-14 Thread patrick k.

1. no error when importing from the shell, if django.django_xmlrpc is  
NOT in the installed apps.
2. not able to launch the shell when django.django_xmlrpc IS in the  
installed apps.

I´ve tried to put the package somewhere else but that doesn´t change  
anything.

thanks,
patrick


Am 14.05.2007 um 15:36 schrieb CodeDragon:

>
> Hi Patrick,
>
> I can't seem to reproduce this error myself. Could you try importing
> django.django_xmlrpc through the interactive shell and reproduce the
> output for me?
>
> Also, it might be worth trying to put the django_xmlrpc package
> somewhere else in your PYTHONPATH rather than under the Django
> directory.
>
> Thanks in advance,
>
> Graham
>
> On May 14, 8:59 am, "patrick k." <[EMAIL PROTECTED]> wrote:
>> thanks for the code, graham.
>>
>> I tried to install django_xmlrpc as described on the google-site.
>> I did the checkout to my django-directory and added
>> django.django_xmlrpc to the installed apps.
>> when I start the dev-server I get the following error-message:
>> AttributeError: 'module' object has no attribute 'django_xmlrpc,'
>>
>> what´s wrong?
>>
>> thanks,
>> patrick
>>
>> Am 13.05.2007 um 23:06 schrieb CodeDragon:
>>
>>
>>
>>> Hi all,
>>
>>> Here's a note to let you know that there is now an XML-RPC server  
>>> app
>>> for Django publicly available under an open-source license.
>>
>>> django_xmlrpc allows you to expose any function through XML-RPC. I'm
>>> currently working on adding introspection and useful things like
>>> system.multicall functionality to the code.
>>
>>> You can find django_xmlrpc, along with instructions at
>>> http://code.google.com/p/django-xmlrpc.
>>
>>> Cheers,
>>
>>> Graham
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Announcing django_xmlrpc

2007-05-14 Thread patrick k.

thanks for the code, graham.

I tried to install django_xmlrpc as described on the google-site.
I did the checkout to my django-directory and added  
django.django_xmlrpc to the installed apps.
when I start the dev-server I get the following error-message:
AttributeError: 'module' object has no attribute 'django_xmlrpc,'

what´s wrong?

thanks,
patrick


Am 13.05.2007 um 23:06 schrieb CodeDragon:

>
> Hi all,
>
> Here's a note to let you know that there is now an XML-RPC server app
> for Django publicly available under an open-source license.
>
> django_xmlrpc allows you to expose any function through XML-RPC. I'm
> currently working on adding introspection and useful things like
> system.multicall functionality to the code.
>
> You can find django_xmlrpc, along with instructions at
> http://code.google.com/p/django-xmlrpc.
>
> Cheers,
>
> Graham
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: complex data retrieval?

2007-05-02 Thread patrick k.

Am 02.05.2007 um 18:43 schrieb [EMAIL PROTECTED]:

>
> You didn't post your full model code ... I didn't see anything about
> auditoriums in it :)  ... can you post the relevant part of your model
> for that?

sorry, I used the term "auditorium" for better understanding -  
nothing about that in the models.

> So you are basically trying to list movie times/cinema for each
> movie..right?

yes, a list of cinemas (order by cinema-names) with a sub-list of  
movie-times for each cinema,
where each screen has it´s own row (see screenshot form the previous  
posting).

> W/out knowing your exact model code...what you have in your py file
> should work based on what you had above.
>
> movie_list = CinemaProgramDate.objects.filter
> (cinemaprogram__cinema__place_state__slug=state,
> screening_date=date,
> cinemaprogram__movie=movie_id).select_related().order_by
> ('cinemas_cinema.name', 'add_screen')
>
> Then this in your template something like this: ( you had a for loop
> for your add_screen, but I don't see that it's a one to many
> relationship... so that didn't seem to be needed unless I missed
> something )

I´m not having a for-loop for the screens ...

>
> {% for movie in movie_list %}
>
>   {% if not forloop.first %}
>   
>   {% endif %}
>   
>
>   
>   {% for cinemaprogram in
> movie.cinemaprogram_set.all %}
>   
>   
>{{ movie.cinemaprogram.cinema }},
>{{ movie.cinemaprogram.cinema.place_state 
> }}
>class="right listall
>small">Andere Filme in diesem Kino
>   
>   {% endfor %}
>   
>
>
>   Saal
>   {% if movie.add_screen %}
>   {{ movie.add_screen }}
>   {% else %}
>   k.A.
>   {% endif %}
>   
>
>   {{ movie.screening_time|
> time:"H:i" }}
>   {% if forloop.last %}
>   {% ifequal forloop.counter 1 %}
>   {% endifequal %}
>   {% endif %}
>  {% endfor %}


if I follow your template-code I´m getting this output:
Screen1: 18:00
Screen1: 20:00
Screen1: 22:00
Screen2: 18:00

instead of:
Screen1: 18:00 20:00 22:00
Screen2: 18:00

thanks,
patrick


>
>
> On May 2, 12:15 pm, "va:patrick.kranzlmueller"
> <[EMAIL PROTECTED]> wrote:
>> here´s an example of how the page should look like:http:// 
>> www.skip.at/AT/kinoprogramm/abfrage/prog_film.php?
>> blnr=1=0=3_tag=02.+05.=9315=Das
>> +wilde+Leben
>>
>> (we´re just redesigning that page using django)
>>
>> patrick
>>
>> Am 02.05.2007 um 17:47 schrieb [EMAIL PROTECTED]:
>>
>>
>>
>>> Oops... that should have been
>>
>>>   {{ screens.screening_date }}
>>>   {{ screens.screening_time }}
>>
>>> Forgot the 's'.
>>
>>> If this isn't quite what you mean...let me know... I may have
>>> misunderstood what you were looking for.
>>
>>> On May 2, 11:44 am, "[EMAIL PROTECTED]"
>>> <[EMAIL PROTECTED]> wrote:
 You should be able to do something like this:
>>
 {% for cinema in cinema_list %}
   {{ cinema }}
   {% for screens in cinema.cinemaprogram_set.all %}
   {{ screen.screening_date }}
   {{ screen.screening_time }}
   {% endfor %}
  {% endfor %}
>>
 Go to this page:http://www.djangoproject.com/documentation/db-api/
 and check out the one-to-many relationships, backward section.
>>
 va:patrick.kranzlmueller wrote:
> I´m having 2 models:
>>
> class CinemaProgram(models.Model):
>  cinema = models.ForeignKey(Cinema)
>  movie = models.ForeignKey(Movie, raw_id_admin=True)
>  
>>
> class CinemaProgramDate(models.Model):
>  cinemaprogram = models.ForeignKey(CinemaProgram,
> edit_inline=models.TABULAR, num_in_admin=20, max_num_in_admin=200,
> num_extra_on_change=100)
>  screening_date = models.DateField('Screening Date',  
> core=True)
>  screening_time = models.TimeField('Screening Time',  
> core=True)
>  add_screen = models.CharField('Screen', maxlength=50,
> blank=True, null=True)
>  
>>
> for the template, I´d like to have something like this:
>>
> {% for cinema in cinema_list %}
>  {{ cinema }}
>  {% for screens in cinema %}
>  {{ screen }}
>  {% for screening_time in screens %}
>  {{ screening_time }}
>  {% endfor %}
>  {% endfor %}
> {% endfor %}
>>
> Now, my question is: how do I get/construct the dict for this

Re: Index in admin

2007-04-09 Thread patrick k.

this question has been raised previously. if you search the mailing- 
list you will find some "answers". look for "move up/move down" ...

if I remember this right, the answer was that this is "out of the  
scope" of django.
you´ll also find some code here:
models.py: http://dpaste.com/hold/4898/
views.py: http://dpaste.com/hold/4899/
change_list.html: http://dpaste.com/hold/4900/

so far, we used this for every project we did, although code-wise it 
´s a crappy solution.

patrick


Am 09.04.2007 um 12:57 schrieb Martin:

>
> order_with_respect_to might be the solution, but it does not seem to
> work.
>
> /Martin
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django FileBrowser

2007-03-13 Thread patrick k.

if you can´t see the mentioned screenshot, your urls are probably  
configured wrong.

be sure to follow the installation guide EXACTLY - I´ve done that  
with all of my projects and I don´t have any problems.
check the settings file (esp. MEDIA_ROOT and MEDIA_URL).

patrick.

Am 13.03.2007 um 19:01 schrieb Mary:

>
> No i can't see this pictures and directories
> but when i copy and past the url before the admin url [sorry i read
> this note in the steps and i think i missed it the first time]i was
> able to add directories
>
> But i still can't see the
> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/chrome/site/ 
> fb_2.jpg
>
> I wondering why?
>
>
> On Mar 13, 6:35 pm, "patrick k." <[EMAIL PROTECTED]> wrote:
>> before you click on "make directory", do you see the directory-
>> listing like this:http://trac.dedhost-sil-076.sil.at/trac/ 
>> filebrowser/chrome/site/fb_2.jpg
>>
>> did you follow step 6?
>> it seems that the urls aren´t configured.
>>
>> patrick
>>
>> Am 13.03.2007 um 17:14 schrieb Mary:
>>
>>
>>
>>> I would like to use Django file browser
>>> i did the steps 1-8 that is on the link
>>> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/
>>> wiki#DjangoFileBrowser
>>> and when i open my admin interface i found the filebrowse but when i
>>> click on
>>> Adddirectory it gave me an error
>>
>>>  App 'filebrowser', model 'mkdir', not found
>>
>>> Does anyone have an idea why is this happened to me ?
>>
>>> Thank you in advance ;
>>> Mary Adel
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django FileBrowser

2007-03-13 Thread patrick k.

before you click on "make directory", do you see the directory- 
listing like this:
http://trac.dedhost-sil-076.sil.at/trac/filebrowser/chrome/site/fb_2.jpg

did you follow step 6?
it seems that the urls aren´t configured.

patrick

Am 13.03.2007 um 17:14 schrieb Mary:

>
> I would like to use Django file browser
> i did the steps 1-8 that is on the link
> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/ 
> wiki#DjangoFileBrowser
> and when i open my admin interface i found the filebrowse but when i
> click on
> Adddirectory it gave me an error
>
>  App 'filebrowser', model 'mkdir', not found
>
> Does anyone have an idea why is this happened to me ?
>
> Thank you in advance ;
> Mary Adel
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Filebrowser and more than one TinyMCE instance

2007-03-02 Thread patrick k.

try playing around with:

 relative_urls : false,
 remove_script_host : true,

we´re using absolute_urls and we don´t remove the script_host.
if the URL is inserted into the tinymce_popup correctly, it doesn´t  
seem to be a problem with the filebrowser but a problem with  
tiny_mce. therefore, you may search the tinymce forum for more details.

Am 02.03.2007 um 23:16 schrieb Dirk Eschler:

> On Freitag, 2. März 2007, patrick k. wrote:
>> we´re also using more than one tinymce instance and we don´t have any
>> problems.
>> could you give more details about your specifications, e.g. how do
>> you init tinymce?
>>
>> patrick.
>
> Hello Patrick,
>
> thanks for your reply. In the model TinyMCE is loaded like:
>
> class Admin:
>   # ...
> js = (
> 'js/tiny_mce/tiny_mce.js',
> 'js/textareas.js',
> )
>
> For the filebrowser integration i followed:
> http://trac.dedhost-sil-076.sil.at/trac/filebrowser/
>
> I had some problems getting the Filebrowser popup to send the link  
> into the
> TinyMCE popup. Clicking the arrow simply did nothing. I ended up  
> with two
> different files:
> - js/tiny_mce/tiny_mce_popup.js
> - js/tiny_mce/tiny_mce_popup_fb.js

for the filebrowser, the installation guide says that you should use  
tiny_mce_popup_fb.js with line 80 commented out, because otherwise  
there´s a mix of styles and the filebrowser popup just looks awful.  
this has nothing to do with the functionality of the filebrowser.

please let me know if you solved the problem ...

patrick.

>
> Both have the same content. The first file is sent when the TinyMCE  
> popup is
> loaded, the second when the Filebrowser popup comes (i've traced  
> this with
> LiveHttpHeaders). It was the only way to get it working at all.
>
> In templates/filebrowser/index.html the second JavaScript file is  
> referenced
> this way:
>
> {% ifequal is_popup '2' %}
> [...]
> 
> [...]
> {% endifequal %}
>
> I have attached my textareas.js, which also contains the  
> Filebrowser callback
> i'm using. Please let me know if you need more information.
>
> Best Regards.
>
> -- 
> Dirk Eschler <mailto:[EMAIL PROTECTED]>
> http://www.krusader.org
>
> >
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Filebrowser and more than one TinyMCE instance

2007-03-02 Thread patrick k.

we´re also using more than one tinymce instance and we don´t have any  
problems.
could you give more details about your specifications, e.g. how do  
you init tinymce?

patrick.

Am 02.03.2007 um 16:48 schrieb Dirk Eschler:

>
> Hi,
>
> i'm using the Django filebrowser together with TinyMCE in one of my  
> projects.
> Inserting a adv_link from the file browser into the TinyMCE popup  
> only works
> in the first TinyMCE instance.
>
> In the second instance the link becomes #mce_temp_url#. Oddly  
> enough, the link
> is displayed correctly in the TinyMCE popup, but after hitting  
> update to
> apply the link and close the popup, it is rendered into  
> #mce_temp_url#.
>
> Is there any way around this problem?
>
> Best Regards.
>
> -- 
> Dirk Eschler 
> http://www.krusader.org
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: direct_to_template, extra_context

2007-02-28 Thread patrick k.

thanks a lot. that´s working.

patrick


Am 27.02.2007 um 18:24 schrieb Joseph Kocherhans:

>
> On 2/27/07, va:patrick.kranzlmueller <[EMAIL PROTECTED]>  
> wrote:
>>
>> from django.conf.urls.defaults import *
>>
>> urlpatterns = patterns('',
>>   (r'^stars/', 'django.views.generic.simple.direct_to_template',
>> {'template': 'site/stars/stars_overview.html'}, extra_context=
>> {'category': 'stars', 'subcategory': 'none'}),
>> )
>>
>> isn´t that supposed to work? did I miss something?
>
> Yeah. You're trying to treat extra_context like it's a keyword
> argument to a function call, but you're not calling a function. You
> probably mean something like this:
>
> urlpatterns = patterns('',
> (r'^stars/', 'django.views.generic.simple.direct_to_template', {
> 'template': 'site/stars/stars_overview.html',
> 'extra_context': {
> 'category': 'stars',
> 'subcategory': 'none'
> }
> })
> )
>
> If you want to delve deeper into "why", check this out. Especially  
> section 4.7.3
> http://docs.python.org/tut/node6.html#SECTION00670
>
> Joseph
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: podcast-feed

2007-02-21 Thread patrick k.

thanks. that´s exactly what I was looking for.

patrick.

Am 20.02.2007 um 21:06 schrieb [EMAIL PROTECTED]:

>
> I did it, but not using the syndication. I just use a generic list
> view and point to a template to build the xml. Not hard at all. Here's
> my template:
>
> 
> http://www.itunes.com/dtds/podcast-1.0.dtd;
> version="2.0">
> 
> Gretsch Pages Radio
> http://gretschpages.com/radio/
> Music from the Gretsch Pages Community description>
>2007 The Gretsch Pages copyright>
> en
>
> {% for i in object_list|dictsortreversed:"pub_date" %}
> 
> {{i.song_title|escape}} -
> {{i.artist.preferred_name}}
> http://gretschpages.com/media/
> {{i.song_file}}" type="audio/mpeg" />
> {{i.pub_date}}
> http://gretschpages.com/media/
> {{i.artist.avatar }}" />
> 
> {% endfor %}
> 
> 
>
>
> On Feb 20, 7:46 am, "va:patrick.kranzlmueller"
> <[EMAIL PROTECTED]> wrote:
>> has anyone done a podcast-feed (iTunes) using django syndication?
>>
>> I know that it´s possible by changing feedgenerator.py.
>> if somebody has already done it, it´d be great to share the code and/
>> or give some advice.
>>
>> thanks,
>> patrick
>
>
> >


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: order_with_respect_to Revisited!

2007-01-08 Thread patrick k.


I did something like that, but it´s not very generic:
see http://groups.google.com/group/django-developers/browse_frm/ 
thread/dc0e4a9d6ad02ea3/


patrick

Am 08.01.2007 um 10:34 schrieb [EMAIL PROTECTED]:



I see quite a few posts on the elusive "order_with_respect_to" meta
attribute. I implemented a drag-and-drop version of this for a PHP app
I was building, but I was wondering if anyone's made any effort to
create one for Django.  The behavior I'm looking for is something
similar to what I made here:

http://www.yesjapan.com/simp_related/Simp_Official_2.mp4

It's at about 0:20... the drag and drop ordering of children to a
particular parent.  Anyone know if this has been added to the Admin
sub-framework?


>



--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Ordering flatpages?

2006-12-22 Thread patrick k.


I´ve posted a proposal recently, see
http://groups.google.com/group/django-developers/browse_frm/thread/ 
dc0e4a9d6ad02ea3/


It´s currently not working "out-of-the-box", but we use it for  
different sites and implementation is easy.

All you need is an IntegerField called "position".

If you´re interested, I can send you the files ...
btw, jQuery is needed for this one since we use js a for (re)ordering.

patrick

Am 22.12.2006 um 01:46 schrieb Paul Smith:



So I'm working on this site in Django, and turns out there's quite a
bit of static flatpages-style content involved. I've extended  
flatpages

(well, started with flatpages and built my own), added rich text
editing and so on, and I'm building some navigation dynamically by
looking at the 'url' field. Now I need to figure out how to re-order
them so users can control where things show up in the
dynamically-created navigation.
I'm thinking about a couple of ways to skin this cat, but I thought
I'd put it out there. Does anyone have a nice approach for letting
users arbitrarily order things in Admin? Another thing on my mind is
what would happen if my flatpages start getting all hierarchical on
me... has anyone had to figure out how to let users manage objects  
with

something like a file/folder tree?

--P


>



--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: custom manipulator in admin

2006-12-20 Thread patrick k.


do it like in any other application:
custom view, custom template, change urls

in the custom view, you could use a changemanipulator for your data  
and a dict for your additional data.

for the template: just copy change_form.html and add your extra_data.

the view looks like this:

def custom_change(request, model_name, entry_id):
model = models.get_model('container', model_name)
opts = model._meta
app_label = opts.app_label
manipulator = model.ChangeManipulator(int(entry_id))
entry = manipulator.original_object
if request.POST:
new_data = request.POST.copy()
errors = manipulator.get_validation_errors(new_data)
if not errors:
manipulator.do_html2python(new_data)
new_object = manipulator.save(new_data)
msg = _('The %(name)s "%(obj)s" was changed  
successfully.') % {'name': opts.verbose_name, 'obj': new_object}

request.user.message_set.create(message=msg)
redirect_url = '/admin/container/' + model_name
return HttpResponseRedirect(redirect_url)
else:
errors = {}
new_data = entry.__dict__

   extra_data = ExtraData.objects.all()

form = forms.FormWrapper(manipulator, new_data, errors)
return render_to_response('admin/container/ 
change_form_change.html', {

'form': form,
'extra_data':extra_data,
}, context_instance=RequestContext(request) )


don´t know if that really helps.
if not, maybe you can be more specific.

patrick

Am 20.12.2006 um 01:06 schrieb Rob Slotboom:



For a model I want to add a custom manipulator which can be used in  
the

admin.
With this manipulator I want to be able to add an extra formfield for
displaying some additional data from a related object. There is no  
need

for database storage.

In this group I red that it isn't possible to extend manipulators in
admin so the first question is if it is possible to replace the
'default' manipulator by providing a custom one?

The next question is how to feed the form? From a custom template I
suppose.


Cheers,

Rob


>



--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to hack admin interface?...and should I?

2006-12-18 Thread patrick k.

hmm, I´ve never used a custom manager before.
most of the "hacking" stuff we do is about javascript and templates.

sorry, but I´m not able to help with this problem.

patrick

Am 18.12.2006 um 20:09 schrieb Picio:

>
> Patrick please, can you put an eye also here?
>
> http://paste.e-scribe.com/hold/2728/
>
> I'm trying to show only some rows in an admin results page.
>
> Can you help me find the reason whay I can't make It work?
> In particular no matter if I set a filter in the custom manager
> 'SoloCurrentUser'
> It still show me all the rows in the Admin !
> I've really tried everything and the python manage.py shell retrieve
> well the rows, with the query_set filtered.
>
> Is there any "fall back" manager that override my behaviour?
> How can I find a way to "destroy it"?
>
> Please note that all the relations from the model "operazione" are
> many-to-one, there are no Many to Many rel. in my model.
> I want to add that I've tried to override (like a blind in the  
> dark...):
> -get_result
> -get_ordering
> from the main View (ChangeList), nothing happen and of course the
> behaviour is the same.
>
> I know It's not a good thing to hack and customize the admin but  when
> you just have 1 or 2 things to change, It's not fair to rebuild
> (against the  DRY) another admin+1 little thing from scratch ! :)
>
>
> Thanks a lot for your patience.
> Please Help us.
> Picio
>
> 2006/12/18, Daniel Kvasnicka jr. <[EMAIL PROTECTED]>:
>>
>>> with the last couple of sites we did, we spent more time an  
>>> "hacking"
>>> the admin-interface than doing the actual site.
>>>
>>
>> Well, that's why I'll probably stick with TurboGears for that project
>> (I already have the admin interface almost implemented). I'll try
>> Django with another app. Thanks for replies.
>>
>> Dan
>>
>>
>>>
>>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to hack admin interface?...and should I?

2006-12-18 Thread patrick k.


Am 18.12.2006 um 11:30 schrieb Kenneth Gonsalves:

>
>
> On 18-Dec-06, at 3:42 PM, [EMAIL PROTECTED] wrote:
>
>> The admin interface is just that, an interface for administration. If
>> you need something beyond that you should keep it outside of it. I
>> would give it a thumbs down on trying to "hack" the interface, modify
>> the templates, include pages that look the same, etc.. it's just too
>> time consuming.
>
> this is the official django position also. Admin is for the core
> administrators of the site - not for the general users - in fact this
> should be in the FAQ.

because it´s for the core administrators doesn´t mean you shouldn´t  
add functionality or "hack" the interface (I actually never  
understood that argument).

I´d also give it a thumbs down, but only because the admin-interface  
is hard to hack.
but ... we still do that all the time. of course, when we add  
functionality for editors or administrators, it should look like the  
admin-interface.
with the last couple of sites we did, we spent more time an "hacking"  
the admin-interface than doing the actual site.

in my view, it all comes down on what you´re trying to achieve.

patrick


>
> -- 
>
> regards
> kg
> http://lawgon.livejournal.com
> http://nrcfosshelpline.in/web/
>
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: alternatives to edit_inline

2006-12-14 Thread patrick k.

I´m also interested in this extension.

does anyone has some information?

thanks,
patrick

Am 13.12.2006 um 23:35 schrieb Justin:

>
> It looks like this edit_external option may be what you're looking  
> for:
> http://code.djangoproject.com/ticket/1476
>
> Does anyone know if this enhancement is in the works? It would be
> really neat.
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin CSS files

2006-12-11 Thread patrick k.

sorry, that´s a misunderstanding.
the styles are not _part_ of the filebrowser ...

Am 11.12.2006 um 19:11 schrieb [EMAIL PROTECTED]:

>
> Thanks Patrick!
> I have used the filebrowser on a couple of projects, but I've never
> applied the styles to the rest of my applications.
>
> Still, It'd be great if anyone has created something completely
> different that they'd like to show off. :)
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Customising Admin

2006-12-11 Thread patrick k.


Am 11.12.2006 um 16:20 schrieb spako:

>
> i'm using django.contrib.admin for the cms of the site i am building.
>
> there are a bunch of things i want to do with the cms that i think
> might be possible, i've just not found much documentation for this
> addon, these things include:
>
> * replacing a field's output in edit view to what i want (i.e. embed a
> video player into the cms in place of a "video_code" field)
> * remove "add" functionality on objects in the cms

remove permissions for adding objects

> * only display certain fields (not allow them to be edited)

editable = false
http://www.djangoproject.com/documentation/model_api/#editable


patrick.

>
> any pointers to docs that explain how to do this would be  
> appreaciated.
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin CSS files

2006-12-11 Thread patrick k.

it´s not really a different style. it´s more a cleanup of smaller  
issues (like date/time-fields, edit_inline ...).
generally, a cleaner look (in my view) because stuff is in grid.

some screenshots are here:
http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki

patrick

Am 11.12.2006 um 13:57 schrieb [EMAIL PROTECTED]:

>
> Hi there!
>
> I was just wondering if anyone here has made any custom styles for the
> admin site.
> I'd love to see a different style on the admin, but I don't have the
> time nor the possibility to create something which looks good.
>
> So, does anyone feel like sharing a custom css, if it's been  
> created? :)
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: General File Upload Questions.

2006-11-30 Thread patrick k.


Am 30.11.2006 um 14:26 schrieb Paul Childs:

>
> I have been investigating file uploads in general and also with Django
> in mind. This thread gave me a place to start:
> http://tinyurl.com/ymzmds
>  7b8d81917f741eea/6025c02beec9ae29?rnum=1=maximum+upload 
> +size&_done=%2Fgroup%2Fdjango-users%2Fbrowse_frm%2Fthread% 
> 2F7b8d81917f741eea%3Ftvc%3D1%26q%3Dmaximum+upload+size% 
> 26#doc_6025c02beec9ae29>
>
> I have a few questions..
>
> 1. Is there an upper limit to the size of files that one can upload to
> Django? I am able to upload files of about 5 MB or less with no
> problems, but when I try to upload a file (to the Django dev server)
> which is larger I get an error message from Django. (Traceback is
> below)

since you´re uploading to your server (and not to django), you have  
to use the apache-config (if you´re using apache):
see http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody

>
> 2. Does anyone know of a *simple* client-side javascript that would
> enable client side checking of a file's size? I have seen quite a few
> progress bars which have way more features than I need. I would just
> like to put a cap on the size of an uploaded file and stop the upload
> *before* the whole file is sent to the web server and handed over to
> the view.

I don´t think that´s possible. you can get the filesize after  
uploading, but not before.

there have been other threads concerning this topic. doing a "search"  
on the django user-group might help.

patrick

>
> Thanks,
> /Paul
>
> Traceback (most recent call last):
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \servers\basehttp.py",
> line 272, in run
> self.result = application(self.environ, self.start_response)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \servers\basehttp.py",
> line 615, in __call__
> return self.application(environ, start_response)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \handlers\wsgi.py",
> line 148,
>  in __call__
> response = self.get_response(request.path, request)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \handlers\base.py",
> line 102,
>  in get_response
> return self.get_technical_error_response(request)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \handlers\base.py",
> line 134,
>  in get_technical_error_response
> return debug.technical_500_response(request, *sys.exc_info())
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\views 
> \debug.py",
> line 131, in tec
> hnical_500_response
> return HttpResponseServerError(t.render(c), mimetype='text/html')
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 155,
> in render
> return self.nodelist.render(context)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 688,
> in render
> bits.append(self.render_node(node, context))
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 716,
> in render_node
> raise wrapped
> TemplateSyntaxError: Caught an exception while rendering:
>
> Original Traceback (most recent call last):
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 706,
> in render_node
> result = node.render(context)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 752,
> in render
> output = self.filter_expression.resolve(context)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 548,
> in resolve
> obj = resolve_variable(self.var, context)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\template 
> \__init__.py",
> line 634,
> in resolve_variable
> current = current[bits[0]]
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\http 
> \__init__.py",
> line 31, in __
> getitem__
> for d in (self.POST, self.GET):
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \handlers\wsgi.py",
> line 99,
> in _get_post
> self._load_post_and_files()
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \handlers\wsgi.py",
> line 77,
> in _load_post_and_files
> self._post, self._files = http.parse_file_upload(header_dict,
> self.raw_post_data)
>   File
> "c:\python24\lib\site-packages\django-0.95-py2.4.egg\django\core 
> \handlers\wsgi.py",
> line 122,
>  in _get_raw_post_data
> self._raw_post_data =
> self.environ['wsgi.input'].read(int(self.environ["CONTENT_LENGTH"]))
>   File "C:\Python24\lib\socket.py", line 303, in read
> data = self._sock.recv(recv_size)
> MemoryError
>
> [30/Nov/2006 13:06:24] "POST /doc/update/49/ 

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread patrick k.

hmm, that doesn´t really change anything.

when I do "svn diff" the pyc-files are still listed.
guess I have to delete that files from the repository first. right?

thanks,
patrick

Am 29.11.2006 um 18:42 schrieb Rob Hudson:

>
> Or tell Subversion to ignore them.
>
> You should have a file: ~/.subversion/config (on Mac or Linux, not  
> sure
> where it is on Windows)
>
> In that file under the header "[miscellany]" there's a "global- 
> ignores"
> setting.  Just add *.pyc to that list.
>
> -Rob
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Retrieve Password

2006-11-29 Thread patrick k.

not possible, I think.

solutions:
1. send the password before you save the user
2. store the raw password somewhere (not so good)

patrick

Am 29.11.2006 um 19:50 schrieb Clint74:

>
> Hi,
>
> I need to send the password to the user(email), but how recover the  
> raw
> password once the database stores in this format:
>
> hashType$salt$hash
> sha1$6070e$d3a0c5d565deb4318ed607be9706a98535ec7968
>
> Tk´s
>
> André Duarte
>
>
> >


--~--~-~--~~~---~--~~
 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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: basic model with user foreign key.

2006-03-12 Thread patrick k

e.g.
from django.models import auth
owner = meta.ForeignKey(auth.User)

... that works for me.


> 
> from django.core import meta
> from django.models.auth import users ???
> 
> class Recette(meta.Model):
> slug = meta.SlugField("Slug", prepopulate_from=('nom',) ,unique=True,
> blank=True)
> nom = meta.CharField(maxlength=80,help_text=_('Nom de la recette'),
> unique=True)
> []
> owner = meta.ForeignKey(User)
> 
> class META:
> []
> )
> 
> User is not recognised, (meta.ForeignKey(User) ) what should i import.
> 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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: problem getting the admin to work (in tutorial)

2006-03-09 Thread patrick k

try to set the collations of your database manually (e.g. using cocoamysql
on osx), using "utf 8".

hope that helps,
patrick



> 
> i have been running through the tutorial and everything has been
> running fine.. (running macosx)..
> 
> i found my first problem that i have not been able to figure out..
> 
> i am trying to create a superuser, and i am getting the following error
> (any help on this is appreciated... thanks!):
> 
> Username (only letters, digits and underscores): sergio
> Traceback (most recent call last):
> File "manage.py", line 11, in ?
>   execute_manager(settings)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/management.py",
> line 1051, in execute_manager
>   execute_from_command_line(action_mapping)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/management.py",
> line 969, in execute_from_command_line
>   action_mapping[action]()
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/management.py",
> line 529, in createsuperuser
>   users.get_object(username__exact=username)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/utils/functional.py",
> line 3, in _curried
>   return args[0](*(args[1:]+moreargs), **dict(kwargs.items() +
> morekwargs.items()))
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/meta/__init__.py",
> line 1356, in function_get_object
>   obj_list = function_get_list(opts, klass, **kwargs)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/meta/__init__.py",
> line 1396, in function_get_list
>   return list(function_get_iterator(opts, klass, **kwargs))
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/meta/__init__.py",
> line 1379, in function_get_iterator
>   cursor.execute("SELECT " + (kwargs.get('distinct') and "DISTINCT "
> or "") + ",".join(select) + sql, params)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/db/base.py",
> line 10, in execute
>   result = self.cursor.execute(sql, params)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/db/backends/mysql.py",
> line 32, in execute
>   return self.cursor.execute(sql, params)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /MySQLdb/cursors.py",
> line 137, in execute
>   self.errorhandler(self, exc, value)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /MySQLdb/connections.py",
> line 33, in defaulterrorhandler
>   raise errorclass, errorvalue
> _mysql_exceptions.OperationalError: (1267, "Illegal mix of collations
> (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for
> operation '='")
> 
> 
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Dreamhost - agh!

2006-03-02 Thread patrick k

again, from one of my many discussions with dreamhost.

dreamhost says:

"Currently demand for django is not very high. If the demand picks up we
will likely add direct support for it. This is why we added Ruby on Rails
support."

"It (Django) is currently not installed by default, again, because we do not
have that high of a demand for it. You are of course free to install it in
your home directory."

my experience:
installing django according to the wiki works fine. i don´t have problems
with getting django-apps up and running. but then, i´m having server
timeouts for about 50% of the time (dreamhost gave me 2 months for free but
that doesn´t really solve the problem).

i´m giving razorlogix a try now and i´d suggest to withdraw dreamhost from
the list of "django friendly web hosts".

thanks,
patrick


> 
> On 3/2/06, Jeremy Jones <[EMAIL PROTECTED]> wrote:
>> I'm starting to think if you want to be one of the cool kids, you need
>> to find hosting elsewhere.  I've been moderately unhappy at times with
>> my Dreamhost account.  I'll have to do some soul-searching when my year
>> is up as to whether I want to renew with them.
> 
> I've never used Dreamhost, but I'll just toss in my two cents that
> having a dedicated server, with root access, is well worth it. I pay
> $69 a month for a server with 1and1 (1and1.com). The price has risen
> since then, but it's still kinda-sorta affordable in the grand scheme
> of things if you're serious about making Web apps.
> 
> Note that I'm not affiliated with 1and1 in any way, and I'm sure there
> are plenty of other (even cheaper) alternatives.
> 
> Adrian
> 
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com
> 
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: order_with_respect_to ???

2006-03-01 Thread patrick k

- doesn´t work with mysql < 4.1

> 
>> I must be a bit dumb, but I fail to understand the doc for the
>> "order_with_respect_to" META option... Could someone be kind enough to
>> have mercy and take time to explain slowly ?
> 
> I've been wondering about it too, and this is what I've found out:
> - used on the "many" side of relations
> - adds an _order integer field to the model
> - automatically numbers objects' _order
> - shows objects ordered by _order in admin
> - is supposed to use fancy javascript
> to enable re-arranging objects in admin
> 
> 
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: edit_inline & raw_id_admin

2006-02-25 Thread patrick k

the code i posted was fine.
i just had to restart the server.

patrick


> 
> On Fri, 2006-02-24 at 15:43 +0100, va:patrick.kranzlmueller wrote:
>> first think, then write -> problem solved!
> 
> Since you are unlikely to be the only person to ever come across this
> problem, how about posting your solution to the list so that it shows up
> in a search of the archives?
> 
> Thanks,
> Malcolm
> 
> 
> 
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: order_with_respect_to

2006-02-24 Thread patrick k

i´m trying to implement an up/down-list with dom-drag ... so, i think i´ll
ask my hosting company to upgrade mysql.

nesh & amit: thanks for your help.

patrick



> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> patrick k wrote:
>> i´m using 4.0.18 (well, my hosting company does).
>> 
>> besides that, i don´t really understand the query.
>> it is "SELECT COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = '778".
>> the film_id i have entered is "7786".
> 
> Probably last *6* and *'* are truncated in the message. You can try to use
> sqlite as database if you have sqlite and
> pysqlite installed or simply drop order_with_respect_to from your model.
> 
> Also you can use something like this as a workaround (untested):
> 
> class Filmstarts(meta.Model):
>   film = meta.ForeignKey(Film, raw_id_admin=True)
>   emulate_owrt = meta.IntegerField(editable=False, blank=True, null=True,
> db_index=True)
> 
>   def _pre_save(self):
> self.emulate_owrt = self.get_count(film_id__exact=self.film_id)
> 
>   class META:
> ordering = ('emulate_owrt',)
>   admin = meta.Admin(
>   list_display = ('film'),
>   )
> 
> Of course, you will have to write get_next/previous functions if you want to
> use that functionality.
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: order_with_respect_to

2006-02-24 Thread patrick k

i´m using 4.0.18 (well, my hosting company does).

besides that, i don´t really understand the query.
it is "SELECT COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = '778".
the film_id i have entered is "7786".

patrick


> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> patrick k wrote:
>> query is:
>> 
>> 'INSERT INTO `skip_filmstarts_a` (`film_id`,`_order`) VALUES (%s,(SELECT
>> COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = %s))'
> 
> No luck,
> 
> django.core.meta.__init_py:1020
> # TODO: This assumes the database supports subqueries.
> placeholders.append('(SELECT COUNT(*) FROM %s WHERE %s = %%s)' % \
>  (db.db.quote_name(opts.db_table),
> db.db.quote_name(opts.order_with_respect_to.column)))
> 
> MySQL doc says that all sub queries are supported after 4.1, which version you
> are using?
> 
> Tried with sqlite driver and works and I presume that postgresql will work
> too.
> 
> Worth a ticket :)
> 
> - --


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: order_with_respect_to

2006-02-24 Thread patrick k
Title: Re: order_with_respect_to



sorry for didn´t making myself clear. "exactly the same error message" - that´s what i wanted to say.

nevertheless, i tried to use TEMPLATE_DEBUG=False and got the following 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 'SELECT COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = '778")

query is:

'INSERT INTO `skip_filmstarts_a` (`film_id`,`_order`) VALUES (%s,(SELECT COUNT(*) FROM `skip_filmstarts_a` WHERE `film_id` = %s))'

i change my model a bit (so here´s the new one):

class Filmstarts(meta.Model):
film = meta.ForeignKey(Film, raw_id_admin=True)
class META:
order_with_respect_to = 'film'
admin = meta.Admin(
list_display = ('film'),
    )



On 2/24/06, patrick k <[EMAIL PROTECTED]> wrote:
did that. exactly the same error.


Enabling template debugging won't solve your problem, it will just help you pin point it. The errors should be the same, but the output should also include some template code, with a few line in red, post those lines, or attach your template. 




--~--~-~--~~~---~--~~
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 more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---






Re: order_with_respect_to

2006-02-24 Thread patrick k
Title: Re: order_with_respect_to



did that. exactly the same error.

On 2/24/06, patrick k <[EMAIL PROTECTED]> wrote:
here it is (i´m not sure if you need all of this ...):

TemplateSyntaxError: Caught an exception while rendering.

This is a template syntax error, you can  put a TEMPLATE_DEBUG=True in your settings file and restart server to help you find about template error. 



--~--~-~--~~~---~--~~
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 more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---






Re: mod_python & devserver & apache restart

2006-02-21 Thread patrick k

thanks - that worked.

patrick


> 
> On Tue, Feb 21, 2006 at 08:12:30PM +0100, patrick k wrote:
>> 1. is the django development-server only meant for local use? i?m asking
>> because i tried to use it with dreamhost and it doesn?t seem to work.
> 
> You need to specify the hostname and port with runserver.
> 
> i.e. python manage.py runserver hostname:port
> 
> It defaults to 127.0.0.1.
> 
> Nate
> 
> 


--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: more model basics - mny to many's

2006-02-14 Thread patrick k

what do you need the table songInstrument for?
i´d suggest using a many-to-many relationship ... see
http://www.djangoproject.com/documentation/model_api/#many-to-many-relations
hips

class song(meta.Model):
title = ...
duration = ...
instrument = meta.ManyToManyField(instrument)
musician = meta.ManyToManyField(musician)
def __repr__(self):
  return self.title()
class META:
  admin = meta.Admin()

patrick


> 
> Hiya.
> I am not a web developer, okay, just trying to do a band website (so
> take it easy on me, please ;)
> I am having trouble with my models.
> 
> I have the following:
> 
> class musician(meta.Model):
> ...
> class instrument(meta.Model):
> ...
> class song(meta.Model):
> ..
> class songInstrument(meta.Model):
> song = meta.ForeignKey(song, edit_inline=meta.TABULAR, core=True)
> instrument = meta.ForeignKey(instrument)
> musician = meta.ForeignKey(musician)
> def __repr__(self):
>   return "%s, %s, %s" % (self.get_song(), self.get_musician(),
> self.get_instrument())
> class META:
>   admin = meta.Admin()
> 
> So each song has many musicians playing many instruments (ie. Jerry
> might have played drums and bass and read Chaucer in a particular
> song). This is great, and when I add a song in the admin section, I can
> add all this detail, but when I look at songInstrument in admin, there
> are no entries??
> 
> Can anyone tell me:
> a) where have I gone wrong?
> b) is there an easier way to set up these (and similar) models?
> 
> thanks, 
> and keep up to good work, django ist fun
> 



Re: Dreamhost - problem with Django installation

2006-01-13 Thread patrick k

> Patrick, but if the error happens twice a day, as you say, that is
> very, very bad having hosting with Dreamhost.

right now, i don´t suggest hosting with dreamhost. maybe it´s only a
temporary problem, maybe it´s only "my" server (who knows). but not being
able to work at least twice a day is really (!) bad.
django-hosting is a strange issue anyway (no professional hosting-provider
in my country is able (or wants) to do that - talking about managed
ded-hosts right now).

> Or I am wrong?
> The wiky says:
> To view the admin site, go to
> http://django.mydomain.com/django.fcgi/admin/
> To view the normal site, go to http://django.mydomain.com/django.fcgi/

i never used that, but i guess that only works BEFORE mod_rewrite.
after that, just us http://django.mydomain.com/admin/

> Should that work before setting up mod_rewrite in .htaccess  or only
> after?

as mentioned before, i followed the steps in the wiki (exactly).
if you run into more problems, just ask.

patrick

> 
> regards,
> La.
> 



Re: Django DB Design Question (help please!)

2006-01-09 Thread patrick k

> Thanks Patrick,
> 
> So, you are voting for the second model. I think Django should have
> such relationship builtin where I can avoid defining user_id as a field
> in my news table.

actually, i don´t really see a difference between model 1 and 2.
you have a company which you assign users to. the news posting is done by a
user (which automatically relates it to a company).

maybe i don't fully understand what you´re looking for but since news are
posted by a user, you need a field "user_id" for the news.

 
> I maybe wrong but I don't think (news.get_user.username) works in
> templates. I have to double check.

it does (i´m using it).

patrick



Re: Django DB Design Question (help please!)

2006-01-09 Thread patrick k

within a view you could use
news_list = news.get_list(user__id__exact=request.user.id)
for the logged-in user

to get the user within the template use
news.get_user.username
...

http://www.djangoproject.com/documentation/db_api/#many-to-one-relations

hope that helps,
patrick

> 
> Hi,
> 
> I have a model with multiple companies (Basecamp Style), where each
> have multiple users and multiple company news. Which of the two way is
> more appropriate:
> 
> 1: Company -one-to-many> User one-to-many> NewsPosting
> 
> 2: Company -one-to-many> User
>  |one-to-many> NewsPosting
> 
> Where Company, User and NewsPosting are tables.
> 
> With approach 1, I have to add a function to Company called
> get_newsposting_list() that gets the list of postings for a company
> through SQL. (Is there any easier way to do this? Can't django automate
> this process?)

> With approach 2, somehow in my NewsPosting table I have to add a field
> called user_id, that lets me know which user was responsible for this
> posting, and add a function to NewsPosting: get_user() and another
> function to User: get_newsposting_list() which isn't as clean either.
> There must be an easier way to do this with Django, or if not I think
> it's a good feature to add!
> 
> I like approach #2 better.
> 
> Regards,
> Mike
> 



Re: Dynamic templates and delegation (portal-style app)

2006-01-06 Thread patrick k

oops. of course he is georg. sorry for that.

> 
> On Friday 06 Jan 2006 4:29 pm, patrick k wrote:
>> however, it might be interesting to take a look at simons cms
>> project:
>> https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/CmsPr
>> oject
> 
> i think he iis georg and not simon ;-)



deleting multiple objects

2006-01-06 Thread patrick k

i´m asking this question again, because i still haven´t found a solution.

i like the way, related objects are being displayed (and deleted) in
the admin-interface and i´d like to integrate that into my application.

1. is there a way to display (and delete) multiple related objects using
generic views? as far as i know, with delete_object you can only display and
delete ONE object and not the relations.

2. right now, i am importing some stuff from admin.main like
_get_deleted_objects, _get_mod_opts. moreover, i duplicated
delete_stage within my view to use another template than
"admin/delete_confirmation". this doesn´t seem very clean, for i have
delete_stage twice (in admin and in my own app).
if the template in delete_stage is a variable, it is possible to include
that into my view without duplicating. but then again, i don´t know if
that´s the django-way of doing it!?

hope someone can help.
patrick.



Re: How to simplify my views?

2006-01-02 Thread patrick k

first, we are working on a very similar application. it´s a tool for
project-management which one could use to extend the django admin-interface
(well, at least that´s what we do).

to help with your problem: we are using django-authentication to check user-
and group-information - which is in DjangoContext.

hope that helps.
patrick


> 
> Hi,
> 
> I am creating an application similar to basecamp. On every view I need
> to do lots of book keeping such as checking to see if company exists,
> user exists, user is logged in, etc. before I can do what the view is
> actually there to do. That is a lot of redundancy as apposed to having
> a controller that would take care of bookkeeping before my view is
> loaded. What's the remedy?
> 
> One idea I had was to create a class that would take 'request'
> object and takes care of redundant work and returns a dictionary
> containing all the data I need which I would forward to my template.
> 
> Ideas are appreciate here,
> 
> Regards,
> Mike
> 



unreserved praise for performance

2005-12-29 Thread patrick k

while working with django for a couple of weeks now, i´m very impressed by
the performance. the sites of my app are building up incredible fast (e.g.
compared with rails), although i´m on a shared 8$/month environment.

keep up the fine work.

patrick.



Re: MultiValueDict

2005-12-28 Thread patrick k

thanks a lot.

> 
> On 12/28/05, patrick k <[EMAIL PROTECTED]> wrote:
>> now i´m trying to get all "users" to send them an email.
>> but with something like post_data["user"] i only get "[EMAIL PROTECTED]".
>> 
>> so, how can i get all the values for "user" within my dict?
> 
> You might want to take a look at Simon's response to this ticket:
> http://code.djangoproject.com/ticket/1130
> 
> 
> --
> "May the forces of evil become confused on the way to your house."
> -- George Carlin



MultiValueDict

2005-12-28 Thread patrick k

i´m having some trouble with a MultiValueDict and hope that somebody can
help me.

my request.POST looks like this:

{'body': ['some body text'], 'project': ['1'], 'note': ['1'], 'user':
['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]'],
'byuser': ['1']}

now i´m trying to get all "users" to send them an email.
but with something like post_data["user"] i only get "[EMAIL PROTECTED]".

so, how can i get all the values for "user" within my dict?

patrick



Re: admin-interface: some questions

2005-12-27 Thread patrick k

just being curious: what´s the argument against defining the rows in the
model?

using id´s works fine with a few tables, but with hundreds of tables it´s
getting complicated: because "body" in "films" may be a large textarea
whereas "body" in "comments" may be a smaller one. ok, one could use
"film_body" for "films" and "comments_body" for "comments". then again, one
has to update the css-file when changing the model (which is not a good
thing to do in my opinion).

patrick

> 
> You can use ID's: "id_summary", "id_body", and so on.
> 
> #id_summary {
>   width: 100%;
>   height: 5em;
> }
> 
> #id_body {
>   width: 100%;
>   height: 10em;
> }
> 
> Thanks,
> 
> Eugene
> 
> 
> "patrick k" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
> as far as i know, textares have classes like "vLargeTextField". so, i dont
> know how one can change that.
> 
> by the way, with doing what you suggested you have to update the .css-file
> everytime you add (or change) a model.
> 
> patrick
> 
>> 
>> On 12/27/05 18:28, patrick k wrote:
>>>> On 12/27/05, patrick k <[EMAIL PROTECTED]> wrote:
>>>>> - how do i change the numrows for a textarea-field?
>>>> 
>>>> You can do this with CSS; create custom admin templates that include
>>>> some custom CSS code.
>>> 
>>> what i meant was changing the numrows for each textarea-field seperately.
>>> e.g., a body-field needs more space than a summary (at least in my app).
>>> why not thinking about extending the textfield-model with something like
>>> "numrows=xxx"?
>>> 
>> 
>> Maybe add css classes to textareas (or generally inputs) based on model
>> and fieldname?
>> 
>> e.g.:
>> class Article(meta.Model)
>>  summary = meta.TextField()
>>  body = meta.TextField()
>> 
>> becomes:
>> 
>> 
>> 
>> .article-summary {
>>  width: 100%;
>>  height: 5em;
>>  }
>> .article-body {
>>  width: 100%;
>>  height: 10em;
>>  }
>> 
>> 
>> That's how some other tools I've used do it.
>> 
>> I'ld prefer such a solution to values hardcoded in the model.
>> 
>> cheers
>> Steven
> 
> 
> 
> 



Re: admin-interface: some questions

2005-12-27 Thread patrick k

> On 12/27/05, patrick k <[EMAIL PROTECTED]> wrote:
>> - how do i change the numrows for a textarea-field?
> 
> You can do this with CSS; create custom admin templates that include
> some custom CSS code.

what i meant was changing the numrows for each textarea-field seperately.
e.g., a body-field needs more space than a summary (at least in my app).
why not thinking about extending the textfield-model with something like
"numrows=xxx"?
 
>> - why is it always the first column of the list which is linked to the
>> detail-page? when listing the ID, i´d like the ID to be the first field in
>> the list. nevertheless, i´d like the title to be linked. is that possible?
> 
> We've never had a need to link any other column to the detail page. We
> use the first column for consistency. It's currently not possible to
> choose which column gets linked. (Of course, it *is* possible to
> designate the order of the fields on the change list, so, if you want
> the title linked, you can just make sure the title is first in the
> "list_display" setting.)

well, i´d like to have the ID first and the title (=linked) second.
however, i can live with that (although it´s not very pretty IMHO).
 
>> - 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 interesting when using manipulators,
>> because with "request.user" you won´t have the ID of the user (if i´m right
>> here?).
> 
> This currently isn't possible. Implementation suggestions are welcome!

i´m not much of a python-programmer (coming from PHP, still trying to figure
out the whole thing). maybe someone else needs that feature!!??

right now, i´m passing the userid via

return render_to_response('manage/milestones_form', {
   'form': form,
   'user': user_list,
   'group': group_list,
   'project': project,
   'userid': userid,
}, context_instance=Context(request))

where userid is request.user.id

in the template i´m using a hidden input-field.
of course, that only works with custom admin-pages.

>> - the many-to-many javascript filter interface does work in the
>> admin-interface, but it does not work with my own page based on
>> AddManipulator.
> 
> You might need to include some JavaScript in your custom HTML page for
> that. See django/contrib/admin/media/js/SelectFilter.js.

already included 
core.js
RelatedObjectLookups.js
calendar.js
DateTimeShortcuts.js
CollapsedFieldsets.js
SelectBox.js
SelectFilter2.js (resp. SelectFilter.js)

still, doesn´t work.

patrick






admin-interface: some questions

2005-12-27 Thread patrick k

i´ve been playing around with the admin-interface and have some questions:

- how do i change the numrows for a textarea-field?

- why is it always the first column of the list which is linked to the
detail-page? when listing the ID, i´d like the ID to be the first field in
the list. nevertheless, i´d like the title to be linked. is that possible?

- 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 interesting when using manipulators,
because with "request.user" you won´t have the ID of the user (if i´m right
here?).

- the many-to-many javascript filter interface does work in the
admin-interface, but it does not work with my own page based on
AddManipulator. 

view:
manipulator = projects.AddManipulator()
...
form = formfields.FormWrapper(manipulator, new_data, errors)
return render_to_response('manage/projects_form', {'form': form})

template:
Assign Users:{{ form.user }}

patrick



list for list object

2005-12-25 Thread patrick k

i have a list of projects with related milestones.
now i want to output the projects, and for every project the milestones
according to that project. so, basically, i need a list of milestones for a
list of projects.

extract from my milestone-model:

class Milestone(meta.Model):
   project = meta.ForeignKey(Project)

my view now looks like:

def index(request):
   project_list = projects.get_list(
  user__id__exact=request.user.id,
  order_by=['title'],
   )
   return render_to_response('manage/index', {
  'project_list': project_list,
   }, context_instance=Context(request))

question is: how do i get a milestone_list for every project and what is the
best way to do this?

/

second question. this is probably very simple. however, i just couldn´t come
up with a proper solution.

i just want to output the title of the project for every milestone.

something like
{{ milestone.get_project(fields=['title']) }}

patrick



additional data for generic views

2005-12-21 Thread patrick k

while trying to implement a system for project-management into our
django-based admin-interface, i´m having a small problem here.

right now, i´m using generic views for the "notes".
when a user wants to create a note, he/she has to select a user or a
user-group which relates to that note. for the user(groups), i´m using
djangos auth tables.

question is: how do i get the user and user-groups within my template (which
is notes_form.html)?
more general: is there a way to add additional data (from different modules)
to info_dict?

patrick 



Re: filters in admin-interface

2005-12-17 Thread patrick k

problem solved.


> 
> i am trying to display a filter for a many-to-one relation.
> problem is: the filter doesn´t show up.
> 
> fragment of the model looks like this:
> 
> class Project(meta.Model):
>  id = meta.AutoField('ID', primary_key=True)
>  title = meta.CharField("Title", maxlength=100)
>  user = meta.ForeignKey(auth.User)
>  createdate = meta.DateField('Date (Create)', auto_now=True)
>  updatedate = meta.DateField('Date (Update)', auto_now_add=True)
>  class META:
> db_table = "manage_projects"
> ordering = ['-id']
> admin = meta.Admin(
>list_display = ('title', 'id', 'user'),
> )
>  def __repr__(self):
>  return self.title
> 
> class NoteCategory(meta.Model):
>  id = meta.AutoField('ID', primary_key=True)
>  category = meta.CharField("Category", maxlength=50)
>  project = meta.ForeignKey(Project)
>  user = meta.ForeignKey(auth.User)
>  createdate = meta.DateField('Date (Create)', auto_now=True)
>  updatedate = meta.DateField('Date (Update)', auto_now_add=True)
>  class META:
> verbose_name = "Note Category"
> verbose_name_plural = "Note Categories"
> db_table = "manage_notecategories"
> ordering = ['-id']
> admin = meta.Admin(
>list_filter = ['createdate','updatedate','project'],
>list_display = ('category', 'id', 'project'),
> )
>  def __repr__(self):
>  return self.category
> 
> 
> any ideas?
> 
> patrick
> 
> 
> 



filters in admin-interface

2005-12-17 Thread patrick k

i am trying to display a filter for a many-to-one relation.
problem is: the filter doesn´t show up.

fragment of the model looks like this:

class Project(meta.Model):
   id = meta.AutoField('ID', primary_key=True)
   title = meta.CharField("Title", maxlength=100)
   user = meta.ForeignKey(auth.User)
   createdate = meta.DateField('Date (Create)', auto_now=True)
   updatedate = meta.DateField('Date (Update)', auto_now_add=True)
   class META:
  db_table = "manage_projects"
  ordering = ['-id']
  admin = meta.Admin(
 list_display = ('title', 'id', 'user'),
  )
   def __repr__(self):
   return self.title

class NoteCategory(meta.Model):
   id = meta.AutoField('ID', primary_key=True)
   category = meta.CharField("Category", maxlength=50)
   project = meta.ForeignKey(Project)
   user = meta.ForeignKey(auth.User)
   createdate = meta.DateField('Date (Create)', auto_now=True)
   updatedate = meta.DateField('Date (Update)', auto_now_add=True)
   class META:
  verbose_name = "Note Category"
  verbose_name_plural = "Note Categories"
  db_table = "manage_notecategories"
  ordering = ['-id']
  admin = meta.Admin(
 list_filter = ['createdate','updatedate','project'],
 list_display = ('category', 'id', 'project'),
  )
   def __repr__(self):
   return self.category


any ideas?

patrick





label for foreignkey-relations

2005-12-08 Thread patrick k

is it possible to have different label-names for columns relating to the
same foreign table?


fragment of my film model:

country_1 = meta.ForeignKey(Country)
country_2 = meta.ForeignKey(Country)
country_3 = meta.ForeignKey(Country)

in the admin-interface, i´d like to have different labels for country_1 to
_3 when editing/updating a film. could look like:

Country
Country Co-Production (optional)
Country Co-Production (optional)

which would result in something like (code is not correct, of course):

country_1 = meta.ForeignKey(Country, labelName="Country")
country_2 = meta.ForeignKey(Country, labelName="Country Co-Production
(optional)")
country_3 = meta.ForeignKey(Country, labelName="Country Co-Production
(optional)")

patrick



Re: preexisting database

2005-12-08 Thread patrick k

thanks. didn´t know the word "legacy", so searching was not succesful.


> http://www.djangoproject.com/documentation/legacy_databases/
> 
> patrick k wrote:
>> is there any documentation on how to work with a pre-existing database?
>> 
>> patrick
>> 
>>   
> 



preexisting database

2005-12-08 Thread patrick k

is there any documentation on how to work with a pre-existing database?

patrick



Re: install admin won´t work

2005-12-08 Thread patrick k

i´ve double checked everything.

however, i just tried "django-admin.py install admin
--settings=cms.settings" and that worked.
somehow strange.

 
> What is the value of your DJANGO_SETTING_MODULE environment variable?
> Is that the same as the project you're working on?
> 
> Have you checked and double checked the DATABASE_ENGINE and
> DATABASE_NAME in "YourProject"/settings.py?  Do they match the DB
> you're looking at when you say _log doesn't exist?
> 
> Sorry if these are obvious, just wanted to make sure.
> 



Re: 2nd database for a specific app

2005-11-22 Thread patrick k

please help:
i´m trying to have just ONE table for my app on a different host. all the
other tables should be on dreamhost (auth, packages ...). so, when trying to
install my newapp, i get an error like "table .packages not found". i
basically need 2 setting files for one project (if that works).

is it really possible to have different setting-files for different APPS
(not projects)?


> 
> sorry for being stupid here, but do you mean something like this:
> django-admin.py startapp mynewapp --settings=myproject.newappsetings
> 
> can i set the 2nd settings-file with DJANGO_SETTINGS_MODULE?
> 
>> 
>> On 11/21/05, patrick k <[EMAIL PROTECTED]> wrote:
>>> i have django installed on dreamhost. now i´d like to build an app with
>>> tables from a given database on another host, still using my
>>> dreamhost-installation.
>>> since the database-settings seem to be global (settings.py) for all apps,
>>> i´m not quite sure how to do this.
>> 
>> Hey Patrick,
>> 
>> Feel free to create a separate settings file for separate
>> installations. Just point to the appropriate settings file in your
>> server arrangement.
>> 
>> Adrian
>> 
>> --
>> Adrian Holovaty
>> holovaty.com | djangoproject.com | chicagocrime.org
> 



Re: 2nd database for a specific app

2005-11-21 Thread patrick k

sorry for being stupid here, but do you mean something like this:
django-admin.py startapp mynewapp --settings=myproject.newappsetings

can i set the 2nd settings-file with DJANGO_SETTINGS_MODULE?

> 
> On 11/21/05, patrick k <[EMAIL PROTECTED]> wrote:
>> i have django installed on dreamhost. now i´d like to build an app with
>> tables from a given database on another host, still using my
>> dreamhost-installation.
>> since the database-settings seem to be global (settings.py) for all apps,
>> i´m not quite sure how to do this.
> 
> Hey Patrick,
> 
> Feel free to create a separate settings file for separate
> installations. Just point to the appropriate settings file in your
> server arrangement.
> 
> Adrian
> 
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com | chicagocrime.org



Re: Unknown column 'auth_users.password' in 'field list'

2005-11-21 Thread patrick k

solved. thanks.

> 
> On 11/21/05, patrick k <[EMAIL PROTECTED]> wrote:
>> when trying to login to the admin-interface i get the following error:
>> "Unknown column 'auth_users.password' in 'field list'"
> 
> Hey Patrick,
> 
> Check this out:
> http://www.djangoproject.com/weblog/2005/nov/20/passwordchange/
> 
> Adrian
> 
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com | chicagocrime.org



Unknown column 'auth_users.password' in 'field list'

2005-11-21 Thread patrick k

when trying to login to the admin-interface i get the following error:
"Unknown column 'auth_users.password' in 'field list'"

patrick



2nd database for a specific app

2005-11-21 Thread patrick k

i have django installed on dreamhost. now i´d like to build an app with
tables from a given database on another host, still using my
dreamhost-installation.
since the database-settings seem to be global (settings.py) for all apps,
i´m not quite sure how to do this.

patrick



Re: templates & content-elements

2005-11-17 Thread patrick k

eugene: thanks for the links.

it´s really hard for me to explain what i want - i tried it yesterday with a
code-example, but didn´t get an answer (so i thought i try a different
approach and relate to templavoila, although that might give the wrong
impression).

basic idea:
building a site with one (or more) main-template(s), content-boxes (=
sub-templates with placeholders for content-elements) and content-elements
(= outputting data from a database). you should be able to move and delete
content-boxes (with or without the content-elements) and content-elements,
and - of course - add them.
a content-element could be a film-description with an image on the left side
on one page or just a featured film-title on another page (in both cases, i
just want the site-editor to change the film-ID for changing the element).

i´m dealing with this problem for quite a while now, but - surprisingly
enough - there doesn´t seem to be a nice solution. hopefully, somebody here
knows better than me.

some related comments from the rubyonrails-wiki:
1. Allowing content items to be units smaller than a page and referenced as
a graph would allow the most flexibility, but it also appears very
complicated.
2. Also essential is that the same ContentObject can be rendered differently
in different places. Referenced as a graph would be the best way to do this.
TemplaVoila of Typo3 is a good start, but suffers from lack of a global
render context, and is (almost) strictly a tree.

patrick


> 
> http://typo3.org/doc.0.html?_extrepmgm_pi1[extUid]=1332=d739966bdd
> 
> http://www.mcuniverse.com/TemplaVoila_-_Cheat_Sheet.1221.0.html
> http://www.mcuniverse.com/TemplaVoila_-_Public_Demo.1708.0.html
> 
> 
> "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
> On Nov 17, 2005, at 10:21 AM, patrick kranzlmller wrote:
>> id like to do something similar to TemplaVoila (used within  Typo3). i
>> dont like Typo3 at all, but their concept of "Futuristic  Template
>> Building" is really good, i think. if anyone has an idea  of how to
>> implement this functionality with django, please let me  know.
> 
> URL?
> 
> Jacob 
> 
> 
> 



templates & content-elements

2005-11-16 Thread patrick k

first of all, let me introduce myself:
i´m working as a programmer/designer with vonautomatisch in vienna/austria.
i´m writing my PhD on "cooperative structures". right now, we are writing an
article called "RTFM and teach yourself" for a book about "micro-learning"
which is going to be published early 2006. for the last 6 months, i compared
different application frameworks and CMS according to their information- and
documentation-design. only 3 out of 40 frameworks meet our needs -
therefore, we are working with django, RoR and helma (www.helma.org) to find
out which one is best (for us).
we are looking for a framework for a big austrian publisher to do several
website and some intranet-stuff.


and now, my question:
i have a site with several content-items smaller than a page.

the main-template might look like this:
- header
- content-area
- sidebar

then i´d like to have some abstract, pre-defined, "child templates" (using
django-terms):
- film: assigning a film-ID, this child template should output some
information about a specific film within the content-area.
- star: assigning a star-ID, this child template should output some
information about a specific person within the content-area.
- interview: assigning a interview-ID, this child template should output
some information about a specific interview within the content-area.
... and so on (for every area of the site)

what i want to do:
the content-ares should consist of small blocks (film, star, interview ...).
the site-editor should be able to MOVE these blocks around (change the
position of the block), EDIT the block (e.g. assigning a different film-ID)
and DELETING the block. this should be done within the ADMIN-INTERFACE (not
touching any code).

i´ve been playing around with child-templates a little bit, but i have no
idea on how to accomplish that.

any help is much appreciated.

patrick

mag. phil. patrick kranzlmüller
vonautomatisch werkstaetten

kettenbrueckengasse 13/10. 1050 wien
mobil: +43 (0) 699 196 787 28
email: [EMAIL PROTECTED]
www: www.vonautomatisch.at



Re: django & dreamhost

2005-11-14 Thread patrick k

wiki-page has obviously changed.
my app also seems to work.

thanks for the advice.

patrick


> 
> I couldn't find this text in DreamHost Wiki page. Are you sure you don't
> have some caching system playing tricks on you? AFAIK, this page was updated
> long time ago to reflect the Admin change. I found exactly one
> django-admin.fcgi reference ("chmod 755 django.fcgi djang-admin.fcgi") and
> corrected it.
> 
> Thanks,
> 
> Eugene
> 
> 
> "patrickk" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> 
>> i just tried to install django on dreamhost using the tutorial on
>> http://wiki.dreamhost.com/index.php/Django.
>> 
>> some questions:
>> it says "Create django-admin.fcgi in the same directory, with the same
>> contents, but change myproject.settings.main to
>> myproject.settings.admin" ... BUT, there is no myproject.settings.main
>> in django.fcgi - so i just used myproject.settings for both django.fcgi
>> and django-admin.fcgi (right?).
>> 
>> 404:
>> when trying to go to
>> http://mydreamhostserver.com/django-admin.fcgi/admin/ or
>> http://mydreamhostserver.com/django.fcgi i get ERROR 404.
>> 
>> patrick
>> 
>> 
> 
> 
>