Re: TabularInline

2023-07-30 Thread Parthian
If I understand you wish to have a readonly table view which switches 
inline to a 'normal' edit view. 
I wonder if you could set - has_change_permission back to True in some way?
Could be handy. If you figure it out post here.

On Sunday, 30 July 2023 at 17:33:55 UTC+1 Tolga ÇAĞLAYAN wrote:

> Yes, it looks like this table. But how do I make an insertion, deletion, 
> edit here in the normal way. When I press the Add button, I want the page 
> to open to add data here. Thanks for your answer
>
>
> 30 Temmuz 2023 Pazar tarihinde saat 18:15:17 UTC+2 itibarıyla Parthian 
> şunları yazdı:
>
>> Try this
>> class YourModelInline(admin.TabularInline):
>> model = YourModel
>> fields = ('fields', )
>> extra = 0 # looks neater without extras.
>> show_change_link = True # puts an icon on the left of each row to 
>> edit the row.
>>
>> def has_change_permission(self, request, obj=None):
>> return False # MAKES EVERYTHING READONLY. AWESOME.
>> def has_delete_permission(self, request, obj=None):
>> return False # option
>> def has_add_permission(self, request, obj=None):
>> return False # option
>> On Sunday, 30 July 2023 at 02:32:51 UTC+1 Tolga ÇAĞLAYAN wrote:
>>
>>> This is what tabularinline looks like. I want a table here instead. I 
>>> want it to work like normal CRUD. Anyone have an idea about this? 
>>>
>>> I don't want that
>>> [image: Ekran görüntüsü 2023-07-29 214456.png]
>>> I  want like this
>>> [image: Ekran görüntüsü 2023-07-29 214733.png]
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dd1f2f4e-39fb-4252-82fe-ae69ecd530e3n%40googlegroups.com.


Re: TabularInline

2023-07-30 Thread Parthian
Try this
class YourModelInline(admin.TabularInline):
model = YourModel
fields = ('fields', )
extra = 0 # looks neater without extras.
show_change_link = True # puts an icon on the left of each row to edit 
the row.

def has_change_permission(self, request, obj=None):
return False # MAKES EVERYTHING READONLY. AWESOME.
def has_delete_permission(self, request, obj=None):
return False # option
def has_add_permission(self, request, obj=None):
return False # option
On Sunday, 30 July 2023 at 02:32:51 UTC+1 Tolga ÇAĞLAYAN wrote:

> This is what tabularinline looks like. I want a table here instead. I want 
> it to work like normal CRUD. Anyone have an idea about this? 
>
> I don't want that
> [image: Ekran görüntüsü 2023-07-29 214456.png]
> I  want like this
> [image: Ekran görüntüsü 2023-07-29 214733.png]
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aafddef3-d10d-46be-9128-00601c21e4dfn%40googlegroups.com.


Django, Redirects and htaccess via Static App

2010-08-17 Thread Parthian
A Django Theoritical discussion point. Re-post from Webfaction forum -
more a django question than webfaction specific).

Over the weekend I had a huge number of pages/hits from one IP address
(logged via awstats). Assuming some kind of funny business I decided
to block that IP address. Two approaches:-

Redirect App as per this - http://forum.webfaction.com/viewtopic.php?id=1516
or this snippet here - http://djangosnippets.org/snippets/744/

The Redirect Static App which does nothing except provide access to
the Django site via a route which allows htaccess is a popular
solution mainly for !www to www solutions, and in my case to make
available 'deny 123.123.123.123'.

Given that !www to www or vice versa is commonly required and other
capabilities of htaccess may be useful (e.g. deny) is there a case for
arguing that all Django Apps should be accessed via a Static App? Only
downside being that another operation is required which will take up
some time and resources (potentially negligible).

But one feature I like about Django is that I don't have to deal with
the dreaded complexity of htaccess for tasks like redirects such as -
urlpatterns += patterns('django.views.generic.simple', ('^index.php/
$', 'redirect_to', {'url': '/'}),
(I've got loads of these for the site in question due to a
migration).

So maybe Django should be handling !www to www and deny etc (hence
snippet 744 may be useful)? Thus dropping completely the need for the
Static/htaccess approach.

Summary - either use Static/htaccess with every Django site or find a
way to do all/most htaccess stuff in Django. Any views.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django-tinymce and filebrowser, error.

2009-08-17 Thread Parthian

Trevor,

I've had problems with the same combination of tools. For me Popup
windows are completely blank. But after adding document.domain as
below I could get the popups to work but only in Firefox and Safari (I
think).

Updated yourApp/yourMediaFiles/js/tinymce/tiny_mce_popup.js for
document.domain = 'yourdomain.com' to help with blank popup. Also same
in Templates/admin/base.html.  There is a post somewhere on the web
that explains the exact details which I cannot find. A search should
find it.

This may be irrelevant but worth a try and in any case try different
browsers to see if you get on better.

Stuart





On Aug 17, 6:23 am, tdelam  wrote:
> Hey,
>
> I built a web site locally, I am using django-tinyce and the django-
> filebrowser, it works no problem on my local machine. As soon as I
> deploy it to the server I have a problem. The TinyMCE is showing up
> and working fine but when I click inside the image popup window to add
> an image, I get an error:
>
> f is undefined
> [Break on this error] return f.apply(s || t, Array.prototype.slice.call
> (arguments, 1));\r\n  - tiny_mce_src.js (line 9360)
>
> This line of code looks like this:
>
> return f.apply(s || t, Array.prototype.slice.call(arguments, 1));
>
> i am not really sure why and how to even debug this. I am a stumped
> because it works locally so I can't really tell where to go from here.
> Any suggestions?
>
> Trevor

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