Database image from models

2012-02-14 Thread galgal
Is there any free app to generate database image schema from all models from all apps? I need image with tables and relations shown. Thanks for help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit htt

Admin - how to get all registeres models in templatetag?

2012-03-22 Thread galgal
I'm writing a custom admin stuff and need to get all registered models in Admin. Is this possible? I need it to make some custom views on admin index page. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

admin - how to change choices in inlines?

2012-04-17 Thread galgal
How can I change choices of a field in Inlines class? I can't use formfield_for_choice_field in Inlines, so what to use? I must generate it in admin, because I need request to be passed. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view t

Forum app for Django?

2012-06-17 Thread galgal
What forum app dou you reccomend. I need a standard functionality like moderators, nested categories, registration etc. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/dj

Re: Migrating to Django 1.4

2012-06-19 Thread galgal
Have changed your old manage.py to new one? Django 1.4 generates new manage.py. Maybe that's the problem? On Tuesday, June 19, 2012 9:15:01 AM UTC+2, Vignesh wrote: > > Hi, > > I started migrating our django 1.2.3 project to django 1.4, > > Now the manage.py is not showing any management commands

How to make a query?

2012-06-27 Thread galgal
I have a model Article. It has a datetime field, title and description. How can I get last 5 months from now, where there is at least 1 article added? Other words - how to get last 5 months which are not empty? -- You received this message because you are subscribed to the Google Groups "Django

Re: How to make a query?

2012-06-27 Thread galgal
(year), int(month) + 1, > 1))[:5] On Wednesday, June 27, 2012 9:28:27 PM UTC+2, galgal wrote: > > I have a model Article. It has a datetime field, title and description. > How can I get last 5 months from now, where there is at least 1 article > added? Other words - how to get las

Internationalized URL different per language

2012-07-13 Thread galgal
I need to make an urlpattern different for each language, but following to the same view. for example: url(r'^category/(?P[\w-]+)/, 'news.views.category', name='category'), in english url(r'^kategoria/(?P[\w-]+)/, 'news.views.category', name='category'), in polish if you have EN set, "kategori

sorl-thumbnail or easy-thumbnail

2012-09-15 Thread galgal
What image engine to choose sorl-thumbnail or easy-thumbnail? I saw on github, that easy-thumbanil is still updates, and sorl last update is about 5 months ago. I use sorl for a while but want to try something else. Does easy-thumbnail work in admin when image are displayed? sorl has a special a

Redirects middelware not working as it should

2012-09-21 Thread galgal
I set my redirect, for example from: /testpage/mysite.php to /my-new-django-site/ It won't work if i enter a page mydomain://testpage/mysite.php but works on: mydomain://testpage/mysite.php/ "/" trailing slash. How to make it work? -- You received this message because you are subscribed to th

how to invalidate per-view cache?

2011-08-19 Thread galgal
I want to use per-view cache. I know how it's working, but where's the problem? How can I invalidate that cache? I must do it each time database records are changed. There is no info about how to do that:/ -- You received

JavaScript translation problem

2011-09-04 Thread galgal
Hi I have a problem with JS translation in Django. I did everything like is said in documentation, so: I made .po then .mo files (django.mo, djangojs.mo). Translated files are in path: *myapp/locale/pl/LC_MESSAGES/* and *myapp/locale/en/LC_MESSAGES/* *Translations in .html and .py files work

Re: Accessing tuple element in templatetag, / Generating multi-level lists.

2011-09-10 Thread galgal
maybe try: {%for c in category.elements %} -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/oL6OVzsq2AEJ. To post to this group, send email to django-users@

Re: Accessing tuple element in templatetag, / Generating multi-level lists.

2011-09-10 Thread galgal
Also look here: https://docs.djangoproject.com/en/1.3/ref/models/instances/#django.db.models.Model.get_FOO_display -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-

Re: When is it useful to run multiple admin sites?

2011-09-11 Thread galgal
Where can I find any info about hot to run it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/s5twxCSBgDMJ. To post to this group, send email to django-use

Admin - delete with removing FK objects

2011-09-13 Thread galgal
I have 2 models class Article(models.Model): active = models.BooleanField(default=False, db_index=True) title = models.CharField(max_length=150) class ArticleGallery(models.Model): article = models.ForeignKey(Article) image = models.ImageField(upload_to=settings.ARTICLE_GALLE

Re: Admin - delete with removing FK objects

2011-09-14 Thread galgal
I made what I wanted using signals:) All works now. I use post delete to be sure that object is deleted, than I remove images. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d

Admin - formset validation with counting checked elements

2011-09-22 Thread galgal
I make a mini poll system. To each question choices are related via FK. In admin I use Inline choices. Each choice has "correct" field (Boolean). When saving a poll I need to check if there is minimum 1 choice with "correct" selected. Which function in admin I must use, to do that validation? -

Re: Admin - formset validation with counting checked elements

2011-09-22 Thread galgal
But I need to do checks in Admin, not my view. I can't find a method to validate in Admin. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/rRHhnv1GGfEJ. To

Re: Admin - formset validation with counting checked elements

2011-09-22 Thread galgal
I have my model done, the only thing is - how to validate if 1 or more checkboxes are checked. It should be done in admin - choices are displayed via Inline. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web vi

CSRF with AJAX problem

2011-09-29 Thread galgal
I have a problem/bug found? in AJAX with CSRF. I don't use {% csrf_token %} at all. I use only AJAX forms so - there is no cookie set for csrf. In taht case - https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#ajax is useless :( I can use get_token to generate it, but I have to put it in al

Re: CSRF with AJAX problem

2011-09-29 Thread galgal
Yes, but that JavaScript code is useless until {% csrf_token %} or get_token is used. I don't use POST forms - only AJAX forms so I don't have that cookie made after page load. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discu

Re: CSRF with AJAX problem

2011-09-29 Thread galgal
Yes I have. It returns null if no cookie. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Y4TMZ5p-XYgJ. To post to this group, send email to django-users@go

How to place a form in all subsites and process i on 1 url?

2011-10-13 Thread galgal
I need to place a form in all my subsites and home page. It's placed on right column. It's action is "/". If there are some errors I must display them. I made Form class etc. I display it via {{ form.as_p }} and designed all. The problem is - how to put it on all sites? I don't want to make form

cache problem but query is OK

2011-12-05 Thread galgal
I try to make a very simple cache usage: myquery = UserProfile.objects.select_related('user').filter(status__exact=1).values_list('user__username', 'q_points').order_by('-q_points')[:50] cache.set('test_cache', myquery, 3600) print cache.get('test_cache') I get an error: UserProfile has no field

change min_length in form __init__?

2012-01-11 Thread galgal
Is there any way, to change the field's *min_length* argument inside form constructor? That doesn't work: def __init__(self, *args, **kwargs): > super(CreateTeamForm, self).__init__(*args, **kwargs) > self.fields['primary_color'].min_length = 4 -- You received this message because you a

admin - user related modules in admin

2012-01-16 Thread galgal
I use extended user profile (class name: UserProfile). I made an app for this, named account. In settings I have set:AUTH_PROFILE_MODULE = 'account.UserProfile' But I made another model in that app named RestrictedUsername. I want to put there usernames, that will be reserved and not available

Re: Customize "This field is required" message.

2012-01-16 Thread galgal
You can specify error message using that: https://docs.djangoproject.com/en/1.3/ref/forms/fields/#error-messages -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-us

Re: Django community, is it active?

2012-12-19 Thread galgal
You should also look here: https://plus.google.com/communities/108940692418100611427 -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/XhlsXnUgj_QJ. To post

Can't sync DB

2013-01-07 Thread galgal
I try to use new User model. I made my custom model, attached it by: AUTH_USER_MODEL = 'account.Account' Model: class Account(AbstractBaseUser, PermissionsMixin): email = models.EmailField( verbose_name=_('email address'), max_length=255, unique=True, db_index=

Re: Syncdb error with new 1.5rc1

2013-01-08 Thread galgal
I also get strange error: https://groups.google.com/forum/#!topic/django-users/lVUZ3hClyUg On Monday, January 7, 2013 10:46:18 PM UTC+1, Thiago wrote: > > I used auth mixin before in my app, then made the changes to make it work > on the official Django with new custom user. > > The problem is t

Re: Syncdb error with new 1.5rc1

2013-01-08 Thread galgal
As for my problem, I solved it by making manage.py migrate --fake But I don't know that is the best and good solution. So far it works somehow :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://

Relations to unknown models?

2013-01-23 Thread galgal
Hi. I'm looking for a solution to make site-wide comments that can be connected with different models via FK. I want to make 1 global model Comments. I want to make a relation to Articles, Relations and Solutions models. I the future I plan to add additional models. Now, Comments model should al

dynamic form fields in admin?

2013-03-06 Thread galgal
I want to make some advanced customization of admin form. While editing an object, I want to show, dynamically, different fields depending of 1 obj field (they are not visible while adding the obj.). There can be a situation, to validate that extra fields. For example, when object has a 'temp

Re: dynamic form fields in admin?

2013-03-06 Thread galgal
; > > > In the save method of MyModelAdmin you can do your logic that you have > mentioned. > > Hope that helps > > > http://bulkan-evcimen.com > > > On Thu, Mar 7, 2013 at 3:43 AM, galgal > > wrote: > >> I want to make some advanced customizati

TestCase - send POST with m2m data?

2013-03-08 Thread galgal
As in the topic - how can I prepare POST data dictionary in TestCase to send it via POST? I can see how it works in real admin POST in Chrome: --WebKitFormBoundaryEXChB8PRJPhaP3OQ Content-Disposition: form-data; name="visibly_usergroup" 1 --WebKitFormBoundaryEXChB8PRJPhaP3OQ Content-Dispo

Get all objects that don't belong to M2M

2013-03-08 Thread galgal
I have a model with field: class Product(models.Model): subproducts = models.ManyToManyField("self", blank=True) I need to overwrite admin's field queryset, to display only that objects that don't belong to any m2m relation. I have no idea how to get them. So if I have: product1, product2

Re: Get all objects that don't belong to M2M

2013-03-08 Thread galgal
I think that did the trick: *Product.objects.filter(subproducts__isnull=True)* On Friday, March 8, 2013 1:50:47 PM UTC+1, Martin J. Laubach wrote: > > Something like this (totally untested though) > > Product.objects.exclude(pk__in=Product.subproducts.through.values_list( > 'product_id', flat=Tru

Re: TestCase - send POST with m2m data?

2013-03-09 Thread galgal
the field named choices: > {'choices': ('a', 'b', 'd')} On Saturday, March 9, 2013 3:34:19 AM UTC+1, Russell Keith-Magee wrote: > > > > On Fri, Mar 8, 2013 at 7:52 PM, galgal > > wrote: > >> As in the topic - how can I prepare POST

Testing multilingual site

2013-03-11 Thread galgal
I'm making a test for a model which has a field with language. How can I switch, using Client(), languages to test actions on various languages? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Test limit_choices_to

2013-05-28 Thread galgal
Is there any way to test if my *limit_choices_to* argument is working as I expect? How can I test that in unit test? -- 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

.annotate() in limit_choices_to?

2013-05-28 Thread galgal
Is it possible to put, somehow, *.annotate()* method into M2M * limit_choices_to*? I need to limit my choices to that query: * cls.objects.annotate(subproducts_num=models.Count('subproducts')).filter(subproducts_num__gt=0) * Any ideas? -- You received this message because you are subscribed to

Re: .annotate() in limit_choices_to?

2013-05-28 Thread galgal
age()[:2]) & Q( translation__product__subproducts__isnull=False)) On Tuesday, May 28, 2013 5:44:57 PM UTC+2, galgal wrote: > > Is it possible to put, somehow, *.annotate()* method into M2M * > limit_choices_to*? > I need to limit my choices to that query: > > * > cls.objects.annotate(s

How to divide my apps? Good practices?

2013-06-20 Thread galgal
Hi, I'm starting my new project. It's sport-connected. The main part of my app will be league, matches, teams and players. There will be many relations. So, how to make apps and models. I plan to make models: - Season - League (FK to Season) - Team - Match (FK to League and 2FK to Te

Re: How to divide my apps? Good practices?

2013-06-21 Thread galgal
ome generic advice -- keep each app focused on one individual > task,as a rule of thumb you'd want maybe 5 +/- 2 models per app. Better to > have multiple apps that each do one thing well than one large app that does > everything. > > > Best > > > > On Thu

Re: How to divide my apps? Good practices?

2013-06-21 Thread galgal
But I can see now that there will be a massive amount of models. Each player should have his own statistics for each games, there will also be a part for referees. Referee work will be rated by users so - many models is planned. If I put it in one app, I will have at least 15 models in it and I

Re: How to divide my apps? Good practices?

2013-06-22 Thread galgal
ounds of regular matches etc... That will be a special, separated class for that, in the same app as rest I think. What do you think? <https://lh5.googleusercontent.com/-qOLlE17nHSg/UcY7Lmq4r5I/PQY/Xmb7QGhEqBA/s1600/test.png> On Thursday, June 20, 2013 11:01:30 PM UTC+2, g

Re: How to divide my apps? Good practices?

2013-06-23 Thread galgal
I've made a quick schema of couple of main tables. As you can see, there are many relations, so I think putting it all in one app. There will be a couple of additional models. There will be 1 m

How to use 2 different cache backends

2011-05-10 Thread galgal
I need to use memcached and file based cache. I setup my cache in settings: CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': 'c:/foo/bar', }, 'inmem': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache'

Get user/admin ID in admin form

2011-05-23 Thread galgal
Is there any possibility to get admin/user ID in my admin form? I need it to change queryset which displays some data. I use custom form by form = CityNewsAdminForm in admin class but have no idea how to get admin ID inside it:/ -- You received this message because you are subscribed to the Go

admin list_filter only for superuser?

2011-05-26 Thread galgal
Is it possible to show list_filter only for superuser? I want to show filter only for users that are superusers or have some permissions. -- 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@googlegr

set language from user lang in DB?

2011-06-21 Thread galgal
What is the best way to set language that is in DB in UserProfile? I have option to select language for users and after selecting it, I update UserProfile table to set the language. While logging in, i need to get user language from his profile and set it. User changes are made by selecting o

Odp: Re: Change language on login

2011-06-21 Thread galgal
Which solution did You use? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/cTfGWDuX48UJ. To post to this group, send email to django-users@googlegroups.com

Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
How can I hide fields in admin User edit? Mainly I want to hide permissions and groups selecting in some exceptions, but exclude variable doesn't work :/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Django admin - hide remove link

2011-07-04 Thread galgal
How can I hide remove link in Django admin? I need to hide it in my code, not in permissions (only user with id=1 can see it no matter if any users are superusers) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the

Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
I'm rather searchung the way to do that in my admin.py file not in core files. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sZ83LDHBIC8J. To post to thi

Odp: Re: Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
That's my code now - how to hide groups for example? admin.site.unregister(User) class UserProfileInline(admin.StackedInline): model = UserProfile filter_horizontal = ('cities',) extra = 1 max_num = 1 filter_horizontal = ('cities',) class UserProfileAdmin(UserAdmin): inlin

Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
Yes I read it. exclude = ('groups',) throws: Caught KeyError while rendering: "Key 'groups' not found in Form" -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-use

Odp: Re: Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-05 Thread galgal
I made it in that way, and it works: def get_fieldsets(self, request, obj=None): if obj: if request.user.id == 1: return self.declared_fieldsets else: if obj.get_profile().type==1: return ( (

Django admin - change permissions list

2011-07-05 Thread galgal
Is there any possibility to change permissions list in user edit page? I don't wan't to show all of permissions for example admin log entry or auth group etc. How can I modify a main queryset to exclude some of it? -- You received this message because you are subscribed to the Google Groups "D

Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-06 Thread galgal
Ok but like I said in previous post, exclude = ('groups',) etc doesn't work :/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/-exygvWEN9UJ. To post to thi

Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-06 Thread galgal
Any idea how to overwrite it dynamically? def get_form(self, request, obj=None, **kwargs): self.exclude = ('user_permissions',) return super(UserProfileAdmin, self).get_form(request, obj=None, **kwargs) Throws: TemplateSyntaxError at /admin/auth/user/2/ Caught KeyError while rende

Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-06 Thread galgal
Environment: Request Method: GET Request URL: http://localhost:8000/admin/auth/user/2/ Django Version: 1.3 Python Version: 2.7.1 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'djan

Django Cache - how to clear per-site cache?

2011-07-13 Thread galgal
I use per-site cache. In my admin actions I want to add some commnad to clear cache every time content is changed. How can I clear per-site cache from admin? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web vis

Django - can't open image in model save()

2011-07-17 Thread galgal
def upload_path_handler(instance, filename): return filename class SpectacleGallery(models.Model): image = models.ImageField(upload_to=upload_path_handler) def save(self, *args, **kwargs): Image.open(self.image) super(SpectacleGallery, self).save(*args, **kwargs) When I try to open it I ge

Django admin - utf8 filename

2011-07-19 Thread galgal
How can I get rid of error when uploading files with utf8 name? I can't find any solution:/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/MbHzssKnwOgJ. To

Odp: Re: Django admin - utf8 filename

2011-07-19 Thread galgal
I use shared server so I think I have no access to apache settings. My language is set to 'pl' right now. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/V

Odp: Re: Django admin - utf8 filename

2011-07-19 Thread galgal
OK I managed to do that - I can upload utf8 files now. But after uploading it i can't see file form field to change file:/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/

Django - change select items display

2011-07-19 Thread galgal
I use ModelForm. One of fields is: repertoire = models.ForeignKey(Repertoire) I need to change it's display type. Instead of using *unicode* in display I want to show name and date of repertoire. How in ModelForm I can do that? -- You received this message because you are subscribed to the G

How to disable specific field validaton in form?

2011-07-20 Thread galgal
I need to disable field validation in ModelForm. I want this validation not to validate some field. I have some situations (AJAX rendering form) when I want to return more complex form with additional fields. I pass POST to the form and render new one with post fields saved. Some new fields are

Method call when deleting FK in admin

2011-07-22 Thread galgal
My models:class Spectacle(models.Model): title = models.CharField(max_length=100) slug = models.SlugField(max_length=100 unique=False) description = models.TextField() class SpectacleGallery(models.Model): spectacle = models.ForeignKey(Spectacle) image = models.ImageField(upload_to=upload_path_h

Admin - change ForeignKey display text

2011-07-27 Thread galgal
How can I change the display text in select while selecting a field which is as ForeignKey? I need to display not only the name of FK, but also name of it's parent. Anybody can give a clue? -- You received this message because you are subscribed to the Google Groups "Django users" group. To

admin - delete_selected problem

2011-08-02 Thread galgal
In admin.py file i paste:admin.site.disable_action('delete_selected') And get an error: KeyError at / 'delete_selected' Django Version: 1.3 Exception Type: KeyError Exception Value: 'delete_selected' Exception Location: c:\Python27\lib\site-packages\django-1.3-py2.7.egg\django\contrib\a

how to save inlines?

2011-08-08 Thread galgal
I need to override save method of inlines in admin. While saving photos, I need to add user id to DB column. I cant make it in model because there is no request data there. How can I do it in admin, to somehow get nad set user id? -- You received this message because you are subscribed to the

How to delete ONLY m2m relation?

2011-03-09 Thread galgal
model: class Province(models.Model): user = models.ManyToManyField(User, blank=True) name = models.CharField(max_length=30, unique=True) How can I delete relation when I know user_id and province_id? If i user delete() method it also removes province and I want to avoid it. -- You recei

Re: How to delete ONLY m2m relation?

2011-03-09 Thread galgal
Thanks, but I don't want to delete any "main" objects. I want to delete ONLY 1 specific relation - I know user and province, and want to unlink the user from province. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Order of WHERE statements in filter

2011-03-11 Thread galgal
I want to make a specific odrer of WHERE statements in my query to use multicolumn index in database. But oder in code is not the same as result query: code: filter(user=self.user, province=self.province, city=self.city) Mysql result: WHERE (`accounts_usercity`.`province_id` = 6 AND `accounts_us

All views require login?

2011-03-17 Thread galgal
I need to make an application in which all views require login. Is there any good way to do that and not to use @login_required() decorator with all methods? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Very large files upload

2011-03-25 Thread galgal
I need to make system that allows to upload files that can be sized about 500MB. I want to use pluplod that sends chunks, then I want to merge it into 1 file on my server. Is i a good idea? Or to make reciving 1 big file via post. -- You received this message because you are subscribed to the G

Detect if file is being changed

2011-03-25 Thread galgal
I make some file operations in admin. I use ImageField for it. In model's save method I need to detect if new image is sent via form, or form file field is empty. How can I detect it in my model's save method? -- You received this message because you are subscribed to the Google Groups "Django

Re: Detect if file is being changed

2011-03-25 Thread galgal
But I don't use any forms. I have simple model with image and date. I use it only in my 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, s

ImageField and quality after save

2011-03-25 Thread galgal
How can I set the image quality to 100? The default value in PIL i 75 and Django saves an image with that value. Where can I change 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@googlegrou

Admin widget, pass additional variable?

2011-03-26 Thread galgal
I user that method to show image im my ImageField edition: http://www.psychicorigami.com/2009/06/20/django-simple-admin-imagefield-thumbnail/ I need to pass to my widget 1 additional variable - thumbnail address. How can I pass that variable to widget? -- You received this message because you

url - hot to set properly?

2011-03-27 Thread galgal
I need to make some settings in urls. I want admin site enabled and 1 view method to catch rest of the request parts. So if someone's url is :/admin - ADMIN panel is show, also if someone pass: /admin/ (/ <- is important) If someone pass: /, /contact, gallery,. my custom method is activated.

Re: url - hot to set properly?

2011-03-27 Thread galgal
I have APPEND_SLASH True but / is not added :) -- 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...@googlegrou

MEDIA_URL not treated like static

2011-03-28 Thread galgal
I have that dirs structure: site_media/ | ---> static/ | ---> uploads/ static dir is set as STATIC_URL = '/site_media/static/' uploads dir is set as MEDIA_URL = '/site_media/uploads/' In that case on dev server (localhost:8000) media_url is not accessible via browser as static fi

Re: AW: MEDIA_URL not treated like static

2011-03-28 Thread galgal
I forgot to tell I'm using Django 1.3. In that case - how to make it work with separate dirs? Or it can't be done on dev server? -- 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.

Re: AW: MEDIA_URL not treated like static

2011-03-28 Thread galgal
Thanks, I didn't know that. All works fine now. -- 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...@googlegro

django and sphinx - lib needed

2011-03-29 Thread galgal
What library can I use with Django to use Sphinx? I found https://github.com/dcramer/django-sphinx but it's not supported 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.

how to change form field in admin?

2011-04-05 Thread galgal
Is there any way to change type of 1 specific field? I want to change 1 field from CharField to TextField. I know I can make a modelform and pass it to admin class, but is there any other way? For example - can I somehow use formfield_for_dbfield? -- You received this message because you are su

Admin custom button in edit

2011-04-06 Thread galgal
Hi, what is the best way to add custom button to save/save and edit buttons list? I need to add it only in edit mode and only in one model. Thanks for help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Djando admin - custom error when deleting

2011-04-06 Thread galgal
I would like to use validating fields connections, but ONLY when delete action is performed. What should I do to validate that fields given in form via admin, chech them and if something is wrong - display errors in admin. I use custom ModelForm as admin form, but have no idea how to check in it

Models inside tests - Django 1.7 problem

2014-09-04 Thread galgal
Hi, I'm trying to port my project to use Django 1.7. Everything is fine except 1 thing. Models inside tests folders. Django 1.7 new migrations run *migrate* command internally. Before *syncdb *was ran. That means if a model is not included in migrations - it won't be populated to DB (and also t

Mock Django FileSystemStorage location?

2014-04-08 Thread galgal
I try to mock FileUpload in django view (admin view). My model looks like that: class BaseImage(models.Model): # create path for uploaded images _storage_path = os.path.abspath(os.path.join( os.path.dirname(__file__), 'secure_media')) _image_storage = FileSystemStora