How to override Model.__init__ without breaking `using(db)`?

2022-10-29 Thread Robert Leach
the default database... BUT I realized yesterday that it breaks operations on our validation database. I describe it in some detail on this stack post <https://stackoverflow.com/questions/74241257/how-to-override-model-init-and-respect-usingdb-in-django/74241582#74241582>, but to summar

Re: User model override and authentication

2022-10-24 Thread Abhishek Kumar
gt; https://youtu.be/GdfLXHhNABE > > On Mon, 24 Oct 2022 at 23:14, Rafael Noronha > wrote: > >> Hello guys, >> I'm not advanced in Django and would like to know how and if it's >> possible to do it. >> >> I need to override Django's user

Re: User model override and authentication

2022-10-24 Thread Muhammad Juwaini Abdul Rahman
ike to know how and if it's possible > to do it. > > I need to override Django's user model, and change the fields "username" > to "sr_usuario" and "password" to "sr_password", but I would like to > continue using all Django'

Re: User model override and authentication

2022-10-24 Thread Ayser shuhaib
Oi Rafael I’m sure this tutorial will help you: https://youtu.be/GdfLXHhNABE On Mon, 24 Oct 2022 at 23:14, Rafael Noronha wrote: > Hello guys, > I'm not advanced in Django and would like to know how and if it's possible > to do it. > > I need to override Django

User model override and authentication

2022-10-24 Thread Rafael Noronha
Hello guys, I'm not advanced in Django and would like to know how and if it's possible to do it. I need to override Django's user model, and change the fields "username" to "sr_usuario" and "password" to "sr_password", but I would like

Re: ModelMultipleChoiceField - override validation

2021-11-22 Thread Earl Lapus
om another field. That part already works. But, I > am running into an error during submit - validation error. An example error > I get is: *"Select a valid choice. 4 is not one of the available > choices." *This is expected since I've set the queryset to be empty, so > v

ModelMultipleChoiceField - override validation

2021-11-19 Thread Earl Lapus
g into an error during submit - validation error. An example error I get is: *"Select a valid choice. 4 is not one of the available choices." *This is expected since I've set the queryset to be empty, so values will match during validation. Where should I override the

Re: override save() twice in django model!

2021-05-01 Thread RITIK SONI
yea! ig you are right! we cant override it twice. On Sat, May 1, 2021 at 7:25 PM Kunal Solanke wrote: > I don't think so, why not do in one function or you can use pre save and > pist save signals > > On Sat, May 1, 2021, 19:11 RITIK SONI wrote: > >> am i able to o

Re: override save() twice in django model!

2021-05-01 Thread Kunal Solanke
I don't think so, why not do in one function or you can use pre save and pist save signals On Sat, May 1, 2021, 19:11 RITIK SONI wrote: > am i able to override save() method of a django model twice? > > -- > You received this message because you are subscribed to the Google

override save() twice in django model!

2021-05-01 Thread RITIK SONI
am i able to override save() method of a django model twice? -- 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.co

Form will not submit after __init__ override

2020-09-09 Thread Kuyateh Yankz
I got a user-based dropdown working but now the form does not submit. here are my files MODEL.PY name= models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) FORMS.PY class MyForm(forms.ModelForm): class Meta: model = MyModel fields = ('name', ) def __init__(self, user, *arg

how to override options of choices in django model form

2020-07-28 Thread Sujata Aghor
Hello All, How can I override options of choices in django model form from the model field ? Below is my code - *models.py:* class XXX(models.Model): StatusType = models.TextChoices('StatusType', const.status_values) status = models.CharField(max_length=100, default=

How to do an override of fields based on it's value in an aggregation query (join on multiple columns)

2020-02-03 Thread Vladimir K.
Hi My case is fully depicted here: https://stackoverflow.com/questions/59991771/django-how-to-do-an-override-of-fields-based-on-its-value-in-an-aggregation-qu Any ideas? The next step would be to do a RawSQL but I think that it should be possible with the ORM. Best regards and thanks in

Re: Override value of a TextField class method.

2020-01-07 Thread Fabio da Silva Pedro
hing wrong yet. >> >> Would you have any examples for me? >> >> I can easily do this with jQuery, but I want to learn how to do this >> using just Django and for that I still have little experience in method >> override. >> >> best regards! >> &g

Re: Override value of a TextField class method.

2020-01-06 Thread Mohamed A
do this using > just Django and for that I still have little experience in method override. > > best regards! > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receivin

Re: Override value of a TextField class method.

2020-01-06 Thread Fabio da Silva Pedro
ng yet. Would you have any examples for me? I can easily do this with jQuery, but I want to learn how to do this using just Django and for that I still have little experience in method override. best regards! -- You received this message because you are subscribed to the Google Groups "Dja

Re: Override value of a TextField class method.

2020-01-06 Thread Mohamed A
erbose_name='Informações complementares') > > > How i do override a field type *TextField* and change your internal *class > value Textarea*, this is a widget from TextField Class and override this > method below: > > def __init__(self, attrs=None): > # Use slightl

Override value of a TextField class method.

2020-01-06 Thread Fabio da Silva Pedro
Hi everyone! this is an excerpt line from my model observacoes = models.TextField(null=True, blank=True, verbose_name='Informações complementares') How i do override a field type *TextField* and change your internal *class value Textarea*, this is a widget from TextField Class an

Django does not Override Settings in Template Tag Testing

2019-12-11 Thread Eray Erdin
I have actually provided quite much verbose information in Stackoverflow <https://stackoverflow.com/questions/59251954/django-does-not-override-settings-in-template-tag-testing>. I have a problem overriding settings as testing template tags. I leave this here in case you are inte

Re: Why and when I should override the default AdminSite

2019-10-12 Thread Derek
've started to read Django documentation and particularly the admin > related documentation > > I would like to understand when an why it should be pertinent to override > the default AdminSite > > regards > -- You received this message because you are subscribed t

Re: Why and when I should override the default AdminSite

2019-10-12 Thread Derek
9. lokak. 2019 klo 11.12 Jérôme Le Carrou > kirjoitti: > >> I am newbie in DJango >> I've started to read Django documentation and particularly the admin >> related documentation >> >> I would like to understand when an why it should be pertinent to over

Re: Why and when I should override the default AdminSite

2019-10-09 Thread Jani Tiainen
lated documentation > > I would like to understand when an why it should be pertinent to override > the default AdminSite > > regards > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe fro

Re: Why and when I should override the default AdminSite

2019-10-09 Thread Mike Dewhirst
> >I've started to read Django documentation and particularly the admin related >documentation > > >I would like to understand when an why it should be pertinent to override the >default AdminSite > > >regards > >-- >You received this message because

Why and when I should override the default AdminSite

2019-10-09 Thread Jérôme Le Carrou
I am newbie in DJango I've started to read Django documentation and particularly the admin related documentation I would like to understand when an why it should be pertinent to override the default AdminSite regards -- You received this message because you are subscribed to the G

Re: How do I override default date formats per locale in Django?

2019-07-25 Thread אורי
*Update:* I found out that it's possible to override formats per locale in this link <https://docs.djangoproject.com/en/1.11/topics/i18n/formatting/>, and added formats for en and he locales, but they don't work. I added a debugging code which you can see here <https://github.co

How do I override default date formats per locale in Django?

2019-07-24 Thread אורי
Hi, We are using Django 1.11 for Speedy Net. I want to override the default values of DATE_FORMAT and MONTH_DAY_FORMAT in English, but keep the default values (or define them again) in Hebrew. So they will not be the same and will not be identical to Django's default values. In English we

Re: Can I override __new__ in Django ModelForm?

2019-07-10 Thread Jani Tiainen
to create all the fields dynamically with a for loop over the languages we > use in the project. Can I override (and is it a good programming method) > the __new__ method or is there another way? I prefer not to hard-code the > specific field names (city_en and city_he) because they may chang

Can I override __new__ in Django ModelForm?

2019-07-10 Thread אורי
quot;he") - but I want to create all the fields dynamically with a for loop over the languages we use in the project. Can I override (and is it a good programming method) the __new__ method or is there another way? I prefer not to hard-code the specific field names (city_en and city_he) becaus

Re: How to override default Django Admin Panel Model display to Customization

2019-04-16 Thread Derek
Proxy models, with an associated Manager, are one way to achieve this - assuming your criteria are fixed. On Monday, 15 April 2019 15:25:49 UTC+2, Balaji Shetty wrote: > > Hi > > When i do login using Django Admin Panel , i can easily perform CRUD > operation on Models. > > can i customize the

How to override default Django Admin Panel Model display to Customization

2019-04-15 Thread Balaji Shetty
Hi When i do login using Django Admin Panel , i can easily perform CRUD operation on Models. can i customize the display of Models Records in django Admin Panel Itself, when I select the model, I get all the records, But i want to filter the records based on some Criteria. Here is my model . Cod

Re: How to override the ModelAdmin "change" form ?

2019-03-01 Thread Mike Dewhirst
Hi, I'm currently struggling with a custom ModelAdmin. Karim I haven't tried to fully understand your use case. However, this is what I think your process could be if you do not wish to ajax it ... 1. Override the model save() method to call a model meth

Re: How to override the ModelAdmin "change" form ?

2019-03-01 Thread karim . atiki
2019 9:46 pm, karim...@gmail.com wrote: > > Hi, > > I'm currently struggling with a custom ModelAdmin. > > > Karim > > I haven't tried to fully understand your use case. However, this is what I > think your process could be if you do not wish to ajax it

Re: How to override the ModelAdmin "change" form ?

2019-03-01 Thread karim . atiki
Hi Mike, Thanks a lot for your feedback. Your situation is quiet different from mine, BUT the way you override change_view and the related template will certainly help me to achieve what I need. ...and getting rid of dirty and unnecessary ajax calls. I keep you posted. Thx. Karim Le

Re: How to override the ModelAdmin "change" form ?

2019-02-28 Thread Mike Dewhirst
think your process could be if you do not wish to ajax it ... 1. Override the model save() method to call a model method which detects your trigger scenario and calls the code you wish to execute to collect all the data you wish to display. This might be in the parent model

Re: How to override the ModelAdmin "change" form ?

2019-02-28 Thread Nelson Varela
You maybe want a model admin view where you can send the user to and collect the data you want to comare and show warnings -- 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

How to override the ModelAdmin "change" form ?

2019-02-28 Thread karim . atiki
Hi, I'm currently struggling with a custom ModelAdmin. Considering the following model: # Bloc fonctionnel class Assembly(Item): product = models.ForeignKey(to='ProductFamily', on_delete=models.CASCADE , null=True, verbose_name=_('Famille Produit')) functions = models.ManyToManyField(F

Re: Can I define classes in Django settings, and how can I override such settings in tests?

2018-12-27 Thread Derek
nt which is not > a class). > > This is the first problem. In the meantime, I defined instead: > > from speedy.net.settings import global_settings as > speedy_net_global_settings > > class User(ValidateUserPasswordMixin, PermissionsMixin, Entity, > AbstractBaseUser): > settings = speedy_ne

Re: Can I define classes in Django settings, and how can I override such settings in tests?

2018-12-27 Thread Ira Abbott
exception if I use there a constant which is not a > class). > > This is the first problem. In the meantime, I defined instead: > > from speedy.net.settings import global_settings as > speedy_net_global_settings > > class User(ValidateUserPasswordMixin, PermissionsM

Can I define classes in Django settings, and how can I override such settings in tests?

2018-12-27 Thread אורי
(ValidateUserPasswordMixin, PermissionsMixin, Entity, AbstractBaseUser): settings = speedy_net_global_settings.UserSettings The second problem, is how do I override such settings in tests? For example, I use the following code: from speedy.core.settings import tests as tests_settings @override_settings(MAX_NUMBER_OF

Problem when override admin template whit project name have both capital and small letters

2018-12-26 Thread EaiLFly Bai
I just found a behavior not expected, but I'm not sure it by design or a bug. Let's say we have a Django project named iNOC and a model NewIncident, I need to override some template such as change_form.html /change_list.html and submit_line.html, if I put this three file in

Re: How to override the javascript default editable bootstap values in Django

2018-09-17 Thread Srinivas Gadi
Can someone please help me with this? On Sun, Sep 16, 2018 at 4:07 PM Srinivas Gadi wrote: > am stuck at overriding the default editable bootstrap values in Django > framework javascript HTML page > > In my webpage, it coded as below > > > $.fn.editable.defaults.url = "{% url 'page1' model.PATH

How to override the java script default editable bootstrap values in Django

2018-09-16 Thread Srinivas Gadi
I am stuck at overriding the default editable bootstrap values in Django framework javascript html page In my webpage, it coded as below $.fn.editable.defaults.url = "{% url 'page1' model.PATH %}"; Now my requirement is, When I click on a button, it check the views.py(page1, which is default

How to override the javascript default editable bootstap values in Django

2018-09-16 Thread Srinivas Gadi
am stuck at overriding the default editable bootstrap values in Django framework javascript HTML page In my webpage, it coded as below $.fn.editable.defaults.url = "{% url 'page1' model.PATH %}"; Now my requirement is, When I click on a button, it check the views.py(page1, which is defaul

Re: SwaggerUI template override

2018-08-21 Thread Christian
I got it , it works as it is described, my fault. Am Sonntag, 19. August 2018 17:57:15 UTC+2 schrieb Christian: > > Hi, > > I'm trying to use a customized version of index as describe here- > > https://django-rest-swagger.readthedocs.io/en/latest/customization/#customization > > I tried different

SwaggerUI template override

2018-08-19 Thread Christian
Hi, I'm trying to use a customized version of index as describe here- https://django-rest-swagger.readthedocs.io/en/latest/customization/#customization I tried different places and settings in the TEMPLATE settings.py, but It won't work. Thanks in advance Christian -- You received this mess

Re: Trouble raising forms.ValidationError in save() override in admin.py

2018-05-03 Thread Gonzalo Amadio
This is very old, but in the case someone red this. If you do it on the save method of the admin, you MUST save the model. So you should override admin's form. Check it here how to do it : http://itegram.com/2018/05/03/ add-extra-control-to-admin-save-method/ <http://itegram.com/

Re: Django Admin Form clean method override only working for one exception

2018-01-04 Thread dean raemaekers
project.com/en/2.0/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other > ). > > On Thu, Jan 4, 2018 at 7:06 AM, dean raemaekers > wrote: > >> Hello, >> >> I am trying to override the Forms in the Django Admin interface to have >>

Re: Django Admin Form clean method override only working for one exception

2018-01-04 Thread Julio Biason
AM, dean raemaekers wrote: > Hello, > > I am trying to override the Forms in the Django Admin interface to have > custom exceptions in the clean() method. > > This works for my first validation, but it doesn't work for a second one > in the same form, or on another form a

Django Admin Form clean method override only working for one exception

2018-01-04 Thread dean raemaekers
Hello, I am trying to override the Forms in the Django Admin interface to have custom exceptions in the clean() method. This works for my first validation, but it doesn't work for a second one in the same form, or on another form at all. I am wondering if I have the syntax wrong for mul

override default "go back" action on a web page to go back to main menu

2017-09-27 Thread fábio andrews rocha marques
registered new user) and stays on the same page. But when he goes back a page, instead of going back to the page before the cadastro.html, he goes back to the same page cadastro.html but displaying the error message for the "you forgot to mention your username". I don't want him

Re: forms.Form.to_div ? and how override forms.Boundfield.label_tag?

2017-07-27 Thread Dan Tagg
(imo) if you can use a *to_div* method om the > form. > > Another thing I ran into is the usage of the form label. Unlike the input > fields that you can easily override via the widget html templates, the > label you can not. This is implemented in the *Boundfield* *label_tag* >

forms.Form.to_div ? and how override forms.Boundfield.label_tag?

2017-07-26 Thread threesixright
rm. Another thing I ran into is the usage of the form label. Unlike the input fields that you can easily override via the widget html templates, the label you can not. This is implemented in the *Boundfield* *label_tag* method. What would be the best way to change its default behaviour? Thanks!

Unable to override map_template in OSMGeoAdmin in django 1.11.3

2017-07-14 Thread Chew Kok Hoor (gMail)
Hi, I tried overriding the map template using bold line below: class LocationAdmin(geo_admin.OSMGeoAdmin): form = LocationForm map_template = 'gis/admin/google.html In my settings.py I have added my folder: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.Djang

Re: How to override the functionality of values()

2017-06-08 Thread Mallik Sai
> from json field in using values(). > assume my JOSN Field data is like >{'key1':value1,'key2':value2,'key3':value3} > > eg: MyModel.objects.values( "field1", "field2", "key1(which is present in > json field)" ) &g

How to override the functionality of values()

2017-06-08 Thread Mallik Sai
1(which is present in json field)" ) Is there any way to get json field key value directly or how can I override the functionality of values() method. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

Is it possible to cleanly override another app's URL namespace in Django 1.11?

2017-05-17 Thread Robert Rollins
I have a project where I want to override a subset of the URLs provided by one of the third-party apps I have installed. I did so months ago, and it works just fine. However, once I upgraded to Django 1.11, I started seeing this warning appear every time I do anything with manage.py

Re: Override base filter for model's queryset (Django 1.6)?

2017-01-15 Thread Melvyn Sopacua
Hi Derek, On Sunday 15 January 2017 06:53:10 Derek wrote: > You don't appear to have understood my question; and I did not see > this particular use case covered in the docs (which is why I asked > it). You also pointed me to the wrong version; in particular > "QuerySet.as_manager()" is not metho

Re: Override base filter for model's queryset (Django 1.6)?

2017-01-15 Thread Derek
17 21:58:15 UTC+2, Melvyn Sopacua wrote: > > On Saturday 14 January 2017 21:20:32 Derek wrote: > > > and I also want to override the base filter for > > > the model's > > > queryset to limit what is displayed. > > > > This is covered in the Manage

Re: Override base filter for model's queryset (Django 1.6)?

2017-01-14 Thread Melvyn Sopacua
On Saturday 14 January 2017 21:20:32 Derek wrote: > and I also want to override the base filter for > the model's > queryset to limit what is displayed. This is covered in the Manager documentation[1] in detail. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/

Override base filter for model's queryset (Django 1.6)?

2017-01-14 Thread Derek
I am looking for help with a Django 1.6 application. The use case is not too complicated; I need to override the delete method for the queryset to prevent some records being removed by the bulk delete (run via the admin interface); and I also want to override the base filter for the model&#

Override save method to add list in the many to many field

2017-01-04 Thread Robin Lery
I have this model to save post from the users: class Tag(models.Model): name = models.CharField(max_length=255, unique=True) def add_tags(obj_id, body): object = Post.objects.get(id=obj_id) tag_list = [Tag.objects.create(name=word) for word in body.split()] for tag in tag_list:

Override default fields in ModelForm

2016-03-21 Thread Ham Kibz
Here is the link to the question http://stackoverflow.com/questions/36124194/how-do-i-override-a-modelform-fields-attribute?noredirect=1#comment59888797_36124194 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

How do I override the default admin page permissions?

2016-01-22 Thread Jonty Needham
Currently I want to allow certain users access to a certain administrator page to allow or deny access for other users for a part of the tool. I have overridden has_permission to grant access, however it says that "You don't have permission to edit anything". I've since tried overriding has_add/

override django object action change_form.html

2016-01-19 Thread 张超
I want to override the change_from.html included in the directory django_object_actions/templates/django_object_actions/ ...I copy the change_from.html and put it in my app directory- myapp/templates/admin/django_object_actions/ ,but it can't work! -- You received this message becaus

Django model proxy override save

2015-11-18 Thread drifter
I want to override the save for a model when saved from the proxy I've tried commenting out as much as I can but it's still using the model save. Here's my code. class MovieProxy(Movie): class Meta: verbose_name = 'movie show' proxy=True def s

Re: How to override satchmo/apps/satchmo_store/contact/forms.py

2015-01-11 Thread RLF_UNIQUE
Whoops that didn't work └── store ├── __pycache__ ├── localsite ├── static │ ├── admin │ ├── cache │ ├── css │ ├── fonts │ ├── images │ └── js └── templates ├── contact ├── product └── shop -- You received this message b

Re: How to override satchmo/apps/satchmo_store/contact/forms.py

2015-01-11 Thread RLF_UNIQUE
└── store ├── __pycache__ ├── contact ├── localsite │ └── contact ├── static │ ├── admin │ ├── cache │ ├── css │ ├── fonts │ ├── images │ └── js └── templates ├── contact ├── product └── shop -- You received thi

How to override satchmo/apps/satchmo_store/contact/forms.py

2015-01-11 Thread RLF_UNIQUE
Can't figure out how to override this file, here is my directory structure └── store ├── __pycache__ ├── localsite │ └── contact ├── static │ ├── admin │ │ ├── css │ │ ├── img │ │ │ └── gis │ │ └── js │ │ └── admin │ ├── cache │ ├── css │ ├── fonts │ ├── i

Override Django Mptt Admin Queryset

2014-11-18 Thread Neeraj Sharma
Hi, I want to override django mptt admin queryset, i want to filter the the queryset. I also tried the following method in admin.py but its not working. def queryset(self, request): qs = super(DataField_NEWAdmin, self).queryset(request) return qs.filter(game_event__id=10

override django mptt admin querset

2014-11-18 Thread Neeraj Sharma
Hi, I want to override django mptt admin queryset, i want to filter the the queryset. I also tried the following method in admin.py but its not working. def queryset(self, request): qs = super(DataField_NEWAdmin, self).queryset(request) qs.filter(game_event__id

Re: Override

2014-11-02 Thread Collin Anderson
Hi Julien, It also might be possible to "monkeypatch" the function. It's generally not recommended, but it might be worth it in your case. Collin -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivin

Re: Override

2014-10-30 Thread Avraham Serour
d to change some behavior of this project for personal use. > > but the problem is if i change some part of code of the project after it > will be complicate to apply the next update with git > > that why i'm trying to find a way for override some function, but without > cha

Override

2014-10-30 Thread Julien Romagnoli
find a way for override some function, but without change the original code Best Regards -- 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 d

Re: Override runserver django 1.7

2014-10-06 Thread Collin Anderson
It's because the staticfiles app is already overriding the built in runserver command, and it's competing with your app. I think it's the only case of a contrib app overriding a built-in command. The migrate command is built-in to django and there are no contrib apps that overri

Re: Override runserver django 1.7

2014-10-06 Thread Carlos Perche
great, now it is working. but i have still a question, why the position in the installed_apps does not affect the migrate command and affect the runserver command ? thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from th

Re: Override runserver django 1.7

2014-10-06 Thread Collin Anderson
try putting the staticfiles app below saas in your INSTALLED_APPS -- 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 p

Override runserver django 1.7

2014-10-06 Thread Carlos Perche
Hello, why not is possible override the command runserver.py in my custom app in Django 1.7, like this # encoding: utf-8 from django.conf import settings from django.core.management.base import CommandError, BaseCommand # from django.contrib.staticfiles.management.commands.runserver import

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
%s/%s" $(widget_a, widget_b, widget_c) > > I hope that solution above be that you want, but if you want customizing > html/css/javascript of TextInput widget, you must override render() method > of forms.TextInput widget. > > Cheers. > > > On Fri, Apr 11, 2014 at

Re: How to override admin field widget?

2014-04-11 Thread Lucas Klassmann
n above be that you want, but if you want customizing html/css/javascript of TextInput widget, you must override render() method of forms.TextInput widget. Cheers. On Fri, Apr 11, 2014 at 12:33 PM, Mark Phillips wrote: > Man, are you good;) > > It now works as expected! > > One

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
t;> category = models.ForeignKey(Category) >>>> length = models.DecimalField(max_digits=5, decimal_places=3, >>>> default=0) >>>> width = models.DecimalField(max_digits=5, decimal_places=3, >>>> default=0) >>>> height = models.Deci

Re: How to override admin field widget?

2014-04-11 Thread Lucas Klassmann
;> and other fields. >>> >>> admin.py >>> class MeasurementForm(forms.ModelForm): >>> def __init__(self, *args, **kwargs): >>> super(MeasurementForm, self).__init__(*args, **kwargs) >>> self.fields['width'].widg

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
Widget >> self.fields['length'].widget = MeasurementWidget >> >> class Meta: >> model = Inventory >> >> class InventoryAdmin(admin.ModelAdmin): >> list_display = ('id','location', 'room'

Re: How to override admin field widget?

2014-04-11 Thread Lucas Klassmann
min): > list_display = ('id','location', 'room', 'category', 'description', > 'condition', 'length', 'width', 'height', 'status', 'sale_price', > 'selling_costs', 'debt

Re: How to override admin field widget?

2014-04-11 Thread Mark Phillips
#x27;, 'length', 'width', 'height', 'status', 'sale_price', 'selling_costs', 'debt') list_filter = ['category'] search_fields = ['description'] form = MeasurementForm inlines = [NoteInline, ImageInli

Re: How to override admin field widget?

2014-04-10 Thread Lucas Klassmann
Hi! I never used this, but i found here and can be useful: https://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.MultiWidget Cheers. On Thu, Apr 10, 2014 at 10:56 PM, Mark Phillips wrote: > I hope I am using the right terminology > > I have a Decimal field in a model calle

How to override admin field widget?

2014-04-10 Thread Mark Phillips
I hope I am using the right terminology I have a Decimal field in a model called 'width'. In the admin screen, I would like to display this field as three text boxes like this: width: [] []/[] so I can enter 2 1/8 for the width, and then have the code convert that to 2.125 as a Decimal fiel

Re: Override grappelli js files

2014-02-25 Thread rush
to add several strings in this files into existing functions, so I can't handle it within a new js files and include into Media class ( from my point of view ).Is there any way to override grappelli files? When collecting static files, if there are multiple files with the same name Django will

Re: Override grappelli js files

2014-02-25 Thread Felipe Bessa Coelho
ons, > so I can't handle it within a new js files and include into Media class ( > from my point of view ). > > Is there any way to override grappelli files? > When collecting static files, if there are multiple files with the same name Django will pick the first one it finds.

Override grappelli js files

2014-02-25 Thread rush
any way to override grappelli files? wbr,rush. -- 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 post to this

Re: proper way to override text plugin widget

2013-10-07 Thread Roberto López López
wrong list, sorry :-( On 10/07/2013 11:23 AM, Roberto López López wrote: > Hi, > > The users of my project prefer ckeditor, so I am wondering how to use it > for cms.plugins.text . I am already making use of django-ckeditor in > other parts of the application. Can anyone enlighten me please? > >

proper way to override text plugin widget

2013-10-07 Thread Roberto López López
Hi, The users of my project prefer ckeditor, so I am wondering how to use it for cms.plugins.text . I am already making use of django-ckeditor in other parts of the application. Can anyone enlighten me please? Thanks, Roberto -- You received this message because you are subscribed to the Goo

Override model field attributes from a ModelForm?

2013-10-03 Thread Storn White
Hi, My custom user model requires unique email addresses, which are the users' identifiers. My user registration modelform works great. If a user tries to register with an email that is already in the system, the form fails to validate and the 'unique' invalid message is displayed back to the

Re: xadmin override base_site.html

2013-09-30 Thread Christian Schulz
Ahh got it , different versions in my installation. Christian Am Montag, 30. September 2013 16:54:43 UTC+2 schrieb Christian Schulz: > > Hi, > > has someboday a clue why I get this error. > Without the modifications xadmin works fine, but if I copy for > modifications in my ../templates/xadmi

xadmin override base_site.html

2013-09-30 Thread Christian Schulz
Hi, has someboday a clue why I get this error. Without the modifications xadmin works fine, but if I copy for modifications in my ../templates/xadmin/base_site.html I got the error below. If I cut this *if step* the template is loaded but without surprise in fragile form. Has anybody an idea

Ordering the forms within a formset? (How to override __iter__())

2012-09-24 Thread Houmie
method. Formsets can also be indexed into, which returns the corresponding form. If you override __iter__, you will need to also override __getitem__ to have matching behavior. As I am still a bit new to python/django, I don't know where to begin. Is there any short example how __i

Re: Override save or other options?

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Curious, we had to do a similar thing for billing periods on our VoIP system a while back. We ended up using dateutil, here's a bit of a code dump. This was all triggered from populate_billing_periods() which was called at the point of processing billing info (which happens every 24 hours) Would

Re: Override save or other options?

2012-09-11 Thread Lachlan Musicman
On Wed, Sep 12, 2012 at 11:46 AM, Mario Gudelj wrote: > I had to do the same thing recently. I had to grab the frequency, interval > etc. (used rrule for that) and then had to look at the first event instance > and create multiple instances from that event inside the view. If you create > a series

Re: Override save or other options?

2012-09-11 Thread Mario Gudelj
I had to do the same thing recently. I had to grab the frequency, interval etc. (used rrule for that) and then had to look at the first event instance and create multiple instances from that event inside the view. If you create a series model and use it as a foreign key in your event to keep on top

Re: Override save or other options?

2012-09-11 Thread Lachlan Musicman
On Tue, Sep 11, 2012 at 5:15 PM, Jani Tiainen wrote: > > Rather than creating individual series of events from recurring I would do a > concept called "recurring event". So it would be just a single event that is > projected to spesific days as necessary. It requires a slightly more work > but it'

Re: Override save or other options?

2012-09-10 Thread Jani Tiainen
11.9.2012 7:23, Lachlan Musicman kirjoitti: Hi All, Simplistically, I have an event type model (for a "school class") with a date field. On saving of the first event, I want to add recurring objects. Specifics for this project are "up to a latest date" (ie, end of term) and "recur weekly only"

  1   2   3   4   >