One question I'd ask would be why you wouldn't just save the files either
on disk or even in the database (using the BLOB datatype) if it absolutely
had to be in the database... then if you needed to manipulate/display/read
them at a later date you would just load the files in question.
If
it means that I can't do it on MySQL database! should I change the DB type
and if so which one should I prefer!
Postgres or NoSQL?
On Tuesday, July 3, 2018 at 3:20:40 AM UTC+5:30, Melvyn Sopacua wrote:
>
> On maandag 2 juli 2018 21:33:35 CEST hardik dadhich wrote:
>
>
>
> > Can anyone tell me
or you can move to postgres and take advantage of the jsonfield integration
with django.
On Monday, July 2, 2018 at 3:48:46 PM UTC-4, hardik dadhich wrote:
>
> Hello,
> Can anyone tell me how can I make dynamic Django model fields? I mean to
> say that I want to save excel file data in Django
On maandag 2 juli 2018 21:33:35 CEST hardik dadhich wrote:
> Can anyone tell me how can I make dynamic Django model fields? I mean to
> say that I want to save excel file data in Django model using MySQL. and
> excel column can vary. The user can upload 100 column table or he can be
> upload 1000
Hello,
Can anyone tell me how can I make dynamic Django model fields? I mean to
say that I want to save excel file data in Django model using MySQL. and
excel column can vary. The user can upload 100 column table or he can be
upload 1000 column table in the database. so it is possible to add
I have investigated a bit more and looks lite it is Options._relation_tree
property, it's value is calculated by _populate_directed_relation_graph
only once and it is @cached_property, so I see no valid way to reset value
On Tuesday, September 5, 2017 at 4:40:02 PM UTC+4, Michal Petrucha wrote:
._meta._expire_cache()"
> > call almost everywhere, before generating dynamic model, after, between
> > steps, it did not help a bit, error is exactly the same.
> > Also, I have additionally tested my application against django 1.10 and
> > django 1.9 and got exactly the same re
On Tue, Sep 05, 2017 at 04:56:10AM -0700, Roman Akopov wrote:
> Unfortulately, it did not help. I have added "model._meta._expire_cache()"
> call almost everywhere, before generating dynamic model, after, between
> steps, it did not help a bit, error is exactly the s
Unfortulately, it did not help. I have added "model._meta._expire_cache()"
call almost everywhere, before generating dynamic model, after, between
steps, it did not help a bit, error is exactly the same.
Also, I have additionally tested my application against django 1.10 and
django 1.9 and
On Tue, Sep 05, 2017 at 03:47:37AM -0700, Roman Akopov wrote:
> Hello,
>
> My problem is very rare so I'll try ad add as much useful detail as
> possible.
>
> I am using python 3.5 and 3.6, Django 1.11.4
>
> I am creating complex security related application and need to generate
> additional
Hello,
My problem is very rare so I'll try ad add as much useful detail as
possible.
I am using python 3.5 and 3.6, Django 1.11.4
I am creating complex security related application and need to generate
additional models based on other applications' models. In general,
everything works fine,
Thank you it worked.
Much appreciated.
Regards,
Shazia
On Wed, Jul 26, 2017 at 5:47 AM, M Hashmi wrote:
> Nothing wrong with your function based view. Just try to fill data in DB
> field. It will work. Because you don't have any record in DB. Try to use
>
Nothing wrong with your function based view. Just try to fill data in DB
field. It will work. Because you don't have any record in DB. Try to use
'get_or_create' function.
M
On Wed, Jul 26, 2017 at 4:50 AM, Shazia Nusrat
wrote:
> Hi,
>
> I have a simple model like
Hi,
I have a simple model like below:
class Artists(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
def __unicode__(self):
return self.name
I am trying to call it in my view like below:
def artistdetail(request, id):
On Wednesday, 13 June 2012 21:46:27 UTC+1, Karandeep Nagra wrote:
>
> So I've set up my Django site to create a dynamic model for every Server
> that is created. So at the creation of server Bender, the model
> Bender_request is created. But whenever I restart the bui
greetings. I am using the admin interface to show data retrieved by a
collector process and put in a different table for each source; each
source is identified by "cliente", "num1" and "num2". At run time
django scans the db for tables with proper names and builds classes
modeled from an abstract
hello, may be this will be useful:
http://code.djangoproject.com/wiki/DynamicModels
On Apr 22, 5:53 am, Massimiliano della Rovere
wrote:
> An external process creates tables whose names follow the pattern
> "collector_XYZ"; all the tables will have the very
An external process creates tables whose names follow the pattern
"collector_XYZ"; all the tables will have the very same structure.
For each table I need to create a matching django.db.models.Model and
django.admin.models.ModelAdmin, dynamically, because over time new
tables will be created and
Hi Sameer,
> is it possible to build a dynamic model in run-time in version 1.1 ?
What do you mean by "dynamic"? If you need to define arbitrary
attributes in runtime *and* be able to save them correctly in a RDBMS
*and* be able to restore the object from the DB *and* be able to
On do, 2010-02-11 at 15:51 +0330, Sameer Rahmani wrote:
> is it possible to build a dynamic model in run-time in version 1.1 ?
Not sure if it's possible, but you can try messing around with __new__
from django.db import models.base import ModelBase, Model
YourModel = ModelBase.__new__(ModelB
is it possible to build a dynamic model in run-time in version 1.1 ?
--
lxsameer
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group,
On Thu, Dec 24, 2009 at 5:24 PM, hotani wrote:
> I have close to 600 users split by 20 or so offices. We have a
> helpdesk form (using ModelForm) which displays an initial user list
> based on the office, or no users if an office is not selected.
>
> An AJAX function on the
On Dec 24, 4:24 pm, hotani wrote:
> I have close to 600 users split by 20 or so offices. We have a
> helpdesk form (using ModelForm) which displays an initial user list
> based on the office, or no users if an office is not selected.
>
> An AJAX function on the front end
I have close to 600 users split by 20 or so offices. We have a
helpdesk form (using ModelForm) which displays an initial user list
based on the office, or no users if an office is not selected.
An AJAX function on the front end dynamically changes users in the
drop-down based on the office
Thanks Man!!
On Jul 18, 5:24 am, Eugene Mirotin wrote:
> So, the value is a string, but the widget you want to display to the
> user should be changed according to the key value?
> Probably you have to create your custom tag (e.g. render_value_widget)
> and then use
So, the value is a string, but the widget you want to display to the
user should be changed according to the key value?
Probably you have to create your custom tag (e.g. render_value_widget)
and then use something like {% render_value_widget key value %} in
your view.
If you provide the same name
I've a generic model to save the user preference with a key and value
However the view would change depending upon the key.
Example,
key : newsletter
view : radio button, yes and no
key : template type
value: drop down box [blue, white, brown]
Is anything like this possible in Django, I am
thanks, that was just what I was looking for :-)
never used this**thing before
On 29 Apr., 14:02, Daniel Roseman
wrote:
> On Apr 29, 12:09 pm, Dennis Schmidt
> wrote:
>
>
>
>
>
> > Hi Mike,
>
> > thanks a lot but that was
On Wed, Apr 29, 2009 at 7:09 AM, Dennis Schmidt
wrote:
>
> Hi Mike,
>
> thanks a lot but that was unfortunately not what I ment. Your
> assignmements are static in
>
> In [2]: n = TestFun(name="mike", description="Testing is always
> fun.")
>
> but I need them to be
On Apr 29, 12:09 pm, Dennis Schmidt
wrote:
> Hi Mike,
>
> thanks a lot but that was unfortunately not what I ment. Your
> assignmements are static in
>
> In [2]: n = TestFun(name="mike", description="Testing is always
> fun.")
>
> but I need them to be dynamic. So in
Hi Mike,
thanks a lot but that was unfortunately not what I ment. Your
assignmements are static in
In [2]: n = TestFun(name="mike", description="Testing is always
fun.")
but I need them to be dynamic. So in the above case NAME wouldn't be
hardcoded but come from a dictionary. {'name': 'mike'}
On Wednesday 29 April 2009 03:24:48 am Dennis Schmidt wrote:
> Hi there,
>
> this might be a trivial question but my search within the django
> documentation and google didn't give me any helpful results.
> In Ruby on Rails you can simply do this
>
> x = Model.new({:param_x => 'x', :param_y =>
Hi there,
this might be a trivial question but my search within the django
documentation and google didn't give me any helpful results.
In Ruby on Rails you can simply do this
x = Model.new({:param_x => 'x', :param_y => 'y'})
where the params are some model fields. The hash you can provide
Ah, after playing with the code some more I resolved my own problem.
Instead of relying on the 'is_active' dynamic model attribute for use
with limit_choices_to, I was able to get the following to accomplish
the same task:
limit_choices_to={ 'end_date__gte': datetime.date.today,
'start_date__lte
Is it possible to use limit_choices_to with a dynamic model attribute?
Some background: I am using a StaffMember model for content creators
who do not have user accounts. Each staff member has a start and end
date and the model has a dynamic attribute called 'is_active' that
compares the start
Maybe a better approach for this, can be override the save method for
your model and also exclude that field on your forms.
Actually there is a post from James Bennett at:
http://www.b-list.org/weblog/2008/dec/24/admin/
hope it helps,
regards,
Sergio Hinojosa
On Dec 26, 6:32 pm, eldonp2
I'm writing a library app - would like to find out if it is possible
to have a dynamically updating (returndate) field in a model?
class Loan...
...
borrowdate = models.DateTimeField(auto_now_add = True)
returndate = models.DateTimeField(timediff(borrowdate+ timedelta
(days=2))
...
I need to pass a model to Form class as an attribute, I want to write
a generic view. How to do it?
class Frm(forms.ModelForm):
def __init__(self,model,instance):
self.model = model
forms.ModelForm.__init__(self,instance=instance)
class Meta:
model = model # <-
On Jan 26, 2008 8:11 AM, Chris <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am seeking to do something like this:
>
> def dynamic_model_call(model_name):
> test = model_name.objects.all()
> return test
>
This will work fine as long as you pass an actual model into the method:
>>>
Hello,
I am seeking to do something like this:
def dynamic_model_call(model_name):
test = model_name.objects.all()
return test
I saw where I could do something like this:
def dynamic_model_call(model_name):
exec("test = %s.objects.all()" % model_name)
return test
But this
On Thu, 2007-07-12 at 19:55 +, kevinski wrote:
> Here is my situation:
>
> I have a model attribute which needs CHOICES to come from another
> model. The caveat is, I need to add an addition choice so I cannot set
> it as a foreign key.
What do you mean here? I don't understand what an
Here is my situation:
I have a model attribute which needs CHOICES to come from another
model. The caveat is, I need to add an addition choice so I cannot set
it as a foreign key. How do I set the CHOICES to populate dynamically
and add the additional choice.
Here is the abbreviated context of
Olivier Guilyardi wrote:
> I'm still a python newbie, but it seems to me that there could be a way to
> modify the model definition before Django knows about it:
Okay, I found the Field.contribute_to_class() method which seems to work just
fine. I'm calling it right after my model class
Tim Chase wrote:
>> Actually the labs where just an example: one laboratory will
>> have one installation of the application, and the dynamic
>> fields will only apply within the scope of this installation.
>> There's no such thing as consistency accross labs.
>
> It still sounds like the above
Tim Chase wrote:
>> I'm in the process of turning telemeta [1] into a django
>> application, and need dynamic model fields: we want to allow
>> site administrators to easily add/remove "fields" to our main
>> data structure, the MediaItem, which represents an
> I'm in the process of turning telemeta [1] into a django
> application, and need dynamic model fields: we want to allow
> site administrators to easily add/remove "fields" to our main
> data structure, the MediaItem, which represents an audio/video
> resource.
>
>
Hi,
I'm in the process of turning telemeta [1] into a django application, and need
dynamic model fields: we want to allow site administrators to easily add/remove
"fields" to our main data structure, the MediaItem, which represents an
audio/video resource.
Example: for a give
Hi,
Though there is a section in the FAQ converning diangos MVC philosphy
im still confused.
My model is manipulated while my application runs.
So how do i manipulate the model from external? Ive written a stop/
wait protocol in python which communicates with the microcontroller
that
48 matches
Mail list logo