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
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
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'
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
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
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
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
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
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
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
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
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=
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
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
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
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
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
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
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
'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
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
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
>
>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
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
*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
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
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
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
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
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
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
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
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
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
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
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
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
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
(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
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
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
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
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
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
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
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/
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
>>
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
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
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
(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*
>
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!
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
> 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
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
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
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
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
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/
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
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:
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
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/
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
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
Whoops that didn't work
└── store
├── __pycache__
├── localsite
├── static
│ ├── admin
│ ├── cache
│ ├── css
│ ├── fonts
│ ├── images
│ └── js
└── templates
├── contact
├── product
└── shop
--
You received this message b
└── store
├── __pycache__
├── contact
├── localsite
│ └── contact
├── static
│ ├── admin
│ ├── cache
│ ├── css
│ ├── fonts
│ ├── images
│ └── js
└── templates
├── contact
├── product
└── shop
--
You received thi
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
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
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
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
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
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
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
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
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
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
%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
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
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
;> and other fields.
>>>
>>> admin.py
>>> class MeasurementForm(forms.ModelForm):
>>> def __init__(self, *args, **kwargs):
>>> super(MeasurementForm, self).__init__(*args, **kwargs)
>>> self.fields['width'].widg
Widget
>> self.fields['length'].widget = MeasurementWidget
>>
>> class Meta:
>> model = Inventory
>>
>> class InventoryAdmin(admin.ModelAdmin):
>> list_display = ('id','location', 'room'
min):
> list_display = ('id','location', 'room', 'category', 'description',
> 'condition', 'length', 'width', 'height', 'status', 'sale_price',
> 'selling_costs', 'debt
#x27;, 'length', 'width', 'height', 'status', 'sale_price',
'selling_costs', 'debt')
list_filter = ['category']
search_fields = ['description']
form = MeasurementForm
inlines = [NoteInline, ImageInli
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
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
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
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.
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
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?
>
>
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
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
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
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
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
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
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
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
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'
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 - 100 of 350 matches
Mail list logo