Re: data model question

2022-08-17 Thread Ryan Nowakowski
How much data are you expecting from each data source? The volume of data will partially determine your solution. On August 17, 2022 7:13:14 AM CDT, yaron amir wrote: >we are developing a control system that looks at data from multiple sources. >some of the data is extracted from AWS, some from

data model question

2022-08-17 Thread yaron amir
we are developing a control system that looks at data from multiple sources. some of the data is extracted from AWS, some from postgres databases, some from hibob (human management reources) the question is this, here are my 1. do I use a disconnected external ETL process or use django for everyt

Re: ManyToMany Model Question, Please

2015-04-06 Thread Flavia Missi
On Mon, Apr 6, 2015 at 5:32 PM Tiglath Suriol wrote: > > On Monday, April 6, 2015 at 3:02:30 PM UTC-4, Flavia Missi wrote: >> >> Hello Tiglath, >> >> On Monday, April 6, 2015 at 1:06:43 PM UTC-3, Tiglath Suriol wrote: >>> >>> >>> Environments have servers; servers have applications; applications

Re: ManyToMany Model Question, Please

2015-04-06 Thread Tiglath Suriol
On Monday, April 6, 2015 at 3:02:30 PM UTC-4, Flavia Missi wrote: > > Hello Tiglath, > > On Monday, April 6, 2015 at 1:06:43 PM UTC-3, Tiglath Suriol wrote: >> >> >> Environments have servers; servers have applications; applications can be >> on various servers, and applications have files. >>

Re: ManyToMany Model Question, Please

2015-04-06 Thread Flavia Missi
Hello Tiglath, On Monday, April 6, 2015 at 1:06:43 PM UTC-3, Tiglath Suriol wrote: > > > Environments have servers; servers have applications; applications can be > on various servers, and applications have files. > >- servers must be unique within environments, >- applications must

ManyToMany Model Question, Please

2015-04-06 Thread Tiglath Suriol
Environments have servers; servers have applications; applications can be on various servers, and applications have files. - servers must be unique within environments, - applications must be unique on each server. - files must be unique within an applications. Will this accompl

Re: Weird Model question django

2011-08-23 Thread robin nanola
what is the use of the article foreignkey in the UserProfile model? On Tue, Aug 23, 2011 at 2:34 PM, raj wrote: > nvm, I think i'm starting to figure it out. Need to read up on many-to- > many fields. > > On Aug 23, 2:21 am, raj wrote: > > This may be difficult to explain. I'm a little new to d

Re: Weird Model question django

2011-08-22 Thread raj
nvm, I think i'm starting to figure it out. Need to read up on many-to- many fields. On Aug 23, 2:21 am, raj wrote: > This may be difficult to explain. I'm a little new to django and the > whole idea of models. > > Let's say I'm making an article app, where each article has a creator, > but other

Weird Model question django

2011-08-22 Thread raj
This may be difficult to explain. I'm a little new to django and the whole idea of models. Let's say I'm making an article app, where each article has a creator, but other users can edit the article at will. I'm having a little difficult on how to create the models for this. Firstly, I extend the

Re: FileField model question

2011-06-23 Thread raj
I actually did google a lot, it's just that every link I got seemed to show a different way of doing this. I'm going to try that django snippet way and see where I get. Then I have to figure out how to put the files up for download after they have been uploaded. Thank you. On Jun 23, 1:06 pm, Herm

Re: FileField model question

2011-06-23 Thread Herman Schistad
On Thu, Jun 23, 2011 at 18:51, raj wrote: > I was reading https://docs.djangoproject.com/en/1.3/topics/http/file-uploads/, > and I got a little confused when looking at the handle_uploaded_file > function. You should read: https://docs.djangoproject.com/en/dev/ref/models/fields/#filefield And a

FileField model question

2011-06-23 Thread raj
I was reading https://docs.djangoproject.com/en/1.3/topics/http/file-uploads/, and I got a little confused when looking at the handle_uploaded_file function. def handle_uploaded_file(f): destination = open('some/file/name.txt', 'wb+') for chunk in f.chunks(): destination.write(chun

Re: Model Question

2011-02-28 Thread Nolan Brubaker
I'm not sure about your first question; I've never tried overriding a field in a subclass. For your second question are you trying to check on the whole query set, or an individual model instance? If you're checking on an individual model instance, you can use hasattr() like: if hasattr(instan

Model Question

2011-02-25 Thread Noah Nordrum
I'm trying to cram the ORM into an existing schema and have an issue I can't seem to get around. I have a number of tables with a timestamp column, but the column name is inconsistent. I would like to put the timestamp field in an abstract superclass, but I can't seem to figure out how to override

Re: Django model question from a newbee

2010-12-16 Thread Reino
Thanks Tom, I was confusing an instance of a ModelForm with an instance of the Model it represents. You suggestion about the mod_time is good idea. However, I still can't get the password stored as an md5 hash. Matteius, it is not an option to use Djangos User object, and user database. Matteius

Re: Django model question from a newbee

2010-12-16 Thread Matteius
Ok I did not mean to send that last post, it was an accident. 1.) Add exclude tuple here: class CasUserForm(ModelForm): class Meta: exclude = ('field1', 'field2') Now go ahead with part 2) 2.) Hide passwords in the form either by manually calling the fields and specifying a

Re: Django model question from a newbee

2010-12-16 Thread Matteius
OK So these are UI issues and how you are saving Users to the database. The database field itself is a CharField. 1.) To hide form elements add a tupple inside the FormField under class meta like so: class CasUserForm(ModelForm): exclude = [field1, field2] 2.) On Dec 16, 6:39 am, Reino wrote:

Re: Django model question from a newbee

2010-12-16 Thread Tom Evans
On Thu, Dec 16, 2010 at 12:39 PM, Reino wrote: > I am new to Django, and I am building a simple application where I am > going to manage a legacy user database from Djangos admin interface. > Below is how my model looks like. > > My goal is to hide some of the fields in the form where I edit/add >

Django model question from a newbee

2010-12-16 Thread Reino
I am new to Django, and I am building a simple application where I am going to manage a legacy user database from Djangos admin interface. Below is how my model looks like. My goal is to hide some of the fields in the form where I edit/add users. However, currently I can see all the fields except

Model question on subclass and parent class.

2010-06-05 Thread Ivan
I have a question on django model. I want to create a magazine model that allow admin to add gadget, sport articles. And there are classes for gadget, sport and food for adding only that specific article. How to model this? I read through one to one field and many to many field. I just could not ge

Re: Simple Form and Model question

2009-10-10 Thread LuisC
Ja!! That is it... Changed the view function name and it works... Very nice... thank you to everybody. Regards On Oct 10, 2:27 am, Karen Tracey wrote: > On Sat, Oct 10, 2009 at 2:04 AM, LuisC wrote: > > > Hi!!! > > I am having troubles saving my first model using a form: > > > My Model: > > C

Re: Simple Form and Model question

2009-10-09 Thread LuisC
Sorry about my ignorance but how would I give keyword arguments in the view? I just tried: BDbuff = Clientes(123,ClienteCodigo=form.cleaned_data ['ClienteCodigo'], ClienteNombre=form.cleaned_data ['ClienteNombre'], Cliente

Re: Simple Form and Model question

2009-10-09 Thread Karen Tracey
On Sat, Oct 10, 2009 at 2:04 AM, LuisC wrote: > > Hi!!! > I am having troubles saving my first model using a form: > > My Model: > Class Clientes(models.Model): >'Clase para Clientes' >ClienteCodigo = models.IntegerField('Codigo Cliente') >ClienteNombre = models.CharField('Nombre Clie

Re: Simple Form and Model question

2009-10-09 Thread Kenneth Gonsalves
On Saturday 10 Oct 2009 11:34:11 am LuisC wrote: > So, what is the argument Clientes() is specting??? Why in shell the > field list with values are the correct arguments?? you are using keyword arguments in the shell and positional arguments in the view - maybe that is the problem? -- regards

Simple Form and Model question

2009-10-09 Thread LuisC
Hi!!! I am having troubles saving my first model using a form: My Model: Class Clientes(models.Model): 'Clase para Clientes' ClienteCodigo = models.IntegerField('Codigo Cliente') ClienteNombre = models.CharField('Nombre Cliente',max_length=40) ClienteFechaCreacion = models.DateFie

Re: beginner model question - two tables without foreign keys (myslq - myisam)

2009-03-17 Thread Alex Robbins
The docs talk about models here: http://docs.djangoproject.com/en/dev/topics/db/models/ foreign keys here: http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey and queries here: http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-objects This advice isn't tested, so i

beginner model question - two tables without foreign keys (myslq - myisam)

2009-03-16 Thread Norman
How to perform such simple query: select p.text, b.title from books b, phrase p where p.book_id = b.id on tables books{ id : int, title: varchar } phrase{ id : int, book_id : int, text: varchar } but using django models? --~--~-~--~~~---~--~~ You received thi

Re: Simple ManyToManyField/Model question

2008-12-25 Thread Chris Czub
Perfect, the "extra fields" and an intermediary relationship model were exactly what I needed. Thanks. On Thu, Dec 25, 2008 at 3:14 PM, Ramiro Morales wrote: > > On Thu, Dec 25, 2008 at 5:13 PM, Chris Czub wrote: >> >> >> I think I need to use a ManyToManyField for this but I'm having >> troubl

Re: Simple ManyToManyField/Model question

2008-12-25 Thread Ramiro Morales
On Thu, Dec 25, 2008 at 5:13 PM, Chris Czub wrote: > > > I think I need to use a ManyToManyField for this but I'm having > trouble finagling it to be the way I want. Here's what I have right > now but I can't figure out where to put the amount and unit for the > ingredients: > > class Ingredient(

Simple ManyToManyField/Model question

2008-12-25 Thread Chris Czub
I am trying to make an application for recipes using Django. I am starting simple and going from the tutorial but not getting the results I want. In a less strict framework I'd be able to represent what I want to easily but I'm having trouble figuring out how to do it the Django way while keeping

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Thanks for the info and pointers Karen, I really appreciate it. I got the feeling this might be a semi-scary way when searching the web for meta and python this afternoon, and didn't really find a lot. I did up screen prototypes for this app, and then designed a db model to accommodate it, and now

Re: Newbie Data Model Question

2008-05-06 Thread Karen Tracey
On Tue, May 6, 2008 at 3:01 PM, Peter Bailey <[EMAIL PROTECTED]> wrote: > > Hey Karen. I used manage.py validate. My model validated before I > added the abstract class and changed the class signatures. But I > probably did something silly. Here is a chunk of the code: > > # will use this for subc

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Hey Karen. I used manage.py validate. My model validated before I added the abstract class and changed the class signatures. But I probably did something silly. Here is a chunk of the code: # will use this for subclassing into our item subtypes class AbstractType(models.Model): name = models.

Re: Newbie Data Model Question

2008-05-06 Thread Karen Tracey
On Tue, May 6, 2008 at 2:25 PM, Peter Bailey <[EMAIL PROTECTED]> wrote: > > Hey alen. I have tried implementing this and it makes good sense as > far as I can see, but when I validate the model I always get an > AttributeError: 'NoneType' object has no attribute 'name'. > How are you validating t

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Hey alen. I have tried implementing this and it makes good sense as far as I can see, but when I validate the model I always get an AttributeError: 'NoneType' object has no attribute 'name'. I have tried removing name from the definition of the class - same message (not sure where it is getting '

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Thanks very much for your solution and reply alen. I'm learning the ins and outs of python and django at the same time - fun adventure - so far python is blowing me away - I love it. Better than anything I have used before - 3 assemblers,c, c++ java, vb, ruby, php, asp, etc (guess I am dating myse

Re: Newbie Data Model Question

2008-05-06 Thread [EMAIL PROTECTED]
Define a 'abstract' attribute of Meta inner class and set it to true like so: class AbstractType(models.Model): name = models.CharField(max_length=100) class Meta: abstract = True class RadioBoxTypes(AbstractType): radio_lable = models.CharField(max_length=20) Regards, -Al

Newbie Data Model Question

2008-05-06 Thread Peter Bailey
I have designed a small db model (on paper) and want to implement it in my models.py file. So far, this has been pretty straight forward, but I have a generic superclass and several subclasses, and I am unsure how to implement this. My DB has page objects (webpages) with a few common attributes,

RE: Django newcomer - model question

2007-05-19 Thread Franco Gasperino
That solves it. Thanks! - Franco -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Malcolm Tredinnick Sent: Saturday, May 19, 2007 12:17 PM To: django-users@googlegroups.com Subject: Re: Django newcomer - model question On Sat, 2007-05-19

Re: Django newcomer - model question

2007-05-19 Thread Malcolm Tredinnick
On Sat, 2007-05-19 at 12:02 -0700, [EMAIL PROTECTED] wrote: > > Greetings. I'm trying to get my head wrapped around django, and the > ORM model. So far, I've been pleased with what I've experienced. > However, I'm having some trouble nailing down a couple relations. > > A container can hold (r

Django newcomer - model question

2007-05-19 Thread franco . gasperino
Greetings. I'm trying to get my head wrapped around django, and the ORM model. So far, I've been pleased with what I've experienced. However, I'm having some trouble nailing down a couple relations. A container can hold (reference) multiple items of the same primary key. I need a method of st

Re: Model question

2007-03-14 Thread Gustav
Thanks guys, I guess I'm in the right path then! Duncan, it's a good idea but I'm not sure I want to mess with parsing logs in my main app; I'd prefer to centralize everything on the db. Thus, I'd rather go the route suggested by Rubic and Carole. I'll try to implemente it with a "date_now" field

Re: Model question

2007-03-13 Thread [EMAIL PROTECTED]
I would create an employee_history table Then have an employee_id, date_change, old_dept, new_dept. Or if you wanted to track multiple types of changes...just have employee_id, date_change, change description, something like that. On Mar 13, 7:07 pm, "DuncanM" <[EMAIL PROTECTED]> wrote: > I'm n

Re: Model question

2007-03-13 Thread Rubic
Gustav, you're probably going to want a third table: EmployeeDeptHistory = id employee_id department_id transfer_date Add a field attribute in the employee table that references this history. -- Jeff Bauer Rubicon, Inc. --~--~-~--~~~---~--~~ You

Re: Model question

2007-03-13 Thread DuncanM
I'm not sure exactly how you could do this, but for an employee to change department, you will edit it. This edit is saved in django's admin log (or whatever its called) so maybe you look at something similar to that where it only saves the changes for an employee where the department id has chan

Model question

2007-03-13 Thread Gustav
Hi guys! Sorry for the newbie question here, but I've looked around and couldn't find the answer... So, here's the problem: say I've got two models and a database that look like this: EMPLOYEE DEPARTMENT == employee_id

Re: Simple Model Question

2007-01-22 Thread Joseph Heck
Your example is sparse to the point of being a tad obtuse, but I think I get what you're asking. Unless you reference modelTemp directly from inside exe1, you don't need to import it. If exe1 had a foreignKey to modelTemp, you'd need to import modelTemp. Otherwise, you don't. -joe On 1/22/07, as

Re: Simple Model Question

2007-01-22 Thread ashwoods
sorry, i have no idea what you are trying to do. is that python? plz explain. On Jan 22, 5:08 pm, "johnny" <[EMAIL PROTECTED]> wrote: > If I have the following: > > model1 > import modelTemp > class exe > (class exe uses a foreignKey from modelTemp) > > model2 > import model1.exe > class exe1 >

Simple Model Question

2007-01-22 Thread johnny
If I have the following: model1 import modelTemp class exe (class exe uses a foreignKey from modelTemp) model2 import model1.exe class exe1 (class exe1 uses a foreignKey from exe) Question I have is, do I have to import modelTemp for model2 also? --~--~-~--~~~---~-

django model question about FileField

2006-11-29 Thread gregor
Hi all I ve got situation like this, I 'm writing a photograph's gallery where photo should be stored on disk in folders like this \\\ At the moment of creation Photo object I know album that foto belongs to and I know the photographer but I can't to implement path to upload_to option. How to do t

django model question for small library

2006-11-29 Thread Grigory Fateyev
Hello! I am writing small app for online library with full text seach. I have all books (less than 25) in html files for every chapter with only and tags, filenames look like book1-4.html and so on. Can somebody suggeest how models.py should looks? Should I insert chapters to database or keep i

Re: model question

2006-11-10 Thread Rob Slotboom
Thank you guys. Without a poll_id in vote it isn't possible to check integrity in the database so I keep it :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

Re: model question

2006-11-09 Thread yun
In the view you would need to check if the voter has already voted in the poll. If the query is empty, then you can allow the person to vote, if the query contains a record for a particular poll and a particular voter, then you need to redirect them to an "You've already voted on this poll" page.

Re: model question

2006-11-09 Thread Rob Slotboom
Rob Hudson schreef: > I'd kind of think that in Vote you don't need the poll FK, just the > choice since the choice then maps to a particular poll. But how do I prevent a voter to vote more than once on a poll? --~--~-~--~~~---~--~~ You received this message be

Re: model question

2006-11-09 Thread Rob Hudson
I'd kind of think that in Vote you don't need the poll FK, just the choice since the choice then maps to a particular poll. Though the Django admin won't do inline editing of FK relationships more than 2 deep. Otherwise I think the effect your seeing makes sense. There is nothing in these model

model question

2006-11-09 Thread Rob Slotboom
I'm trying to get a very simple relationship to work but I can't figure ou how to do this in Django. This is what I want. Poll ---<< question Poll ---<< vote A user can vote a poll just once. I check this using a function which gets the remote ip. This is the models.py snippet class Poll(mode

application specific model question

2006-10-19 Thread [EMAIL PROTECTED]
Hi, I'm developing an application that will house various statistics for country by country comparisons. Whats the best way to represent this data using django's models? For example, each country is likely to have the same variables, eg pop, avg age, birth rate, etc. but these variables might ch

Re: Recurring data model question

2006-09-27 Thread Devraj Mukherjee
Thanks James. On 9/27/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 9/27/06, Devraj Mukherjee <[EMAIL PROTECTED]> wrote: > > Well for the first category it doesn't. Has anyone come across this > > before? If so how did you solve it? Thanks for your time. > > http://www.djangoproject.com/doc

Re: Recurring data model question

2006-09-27 Thread James Bennett
On 9/27/06, Devraj Mukherjee <[EMAIL PROTECTED]> wrote: > Well for the first category it doesn't. Has anyone come across this > before? If so how did you solve it? Thanks for your time. http://www.djangoproject.com/documentation/models/m2o_recursive/ -- "May the forces of evil become confused o

Recurring data model question

2006-09-27 Thread Devraj Mukherjee
I am trying to create a class I call "Category" that will contain Items, these Categories can be nested within each other (much like eBay or Amazon). I tried to use the following menthod to do that but the administration interface wont let me create entries because the ForeignKey must have a value

Re: Raw SQL to Django API Question and a ManyToMany Model Question

2006-02-15 Thread Russell Keith-Magee
On 2/16/06, Brett Hoerner <[EMAIL PROTECTED]> wrote: ---class Tag(meta.Model):  person = meta.ManyToManyField(Person, blank=True, null=True)This is what I meant about the bidirectional query problem - in 0.91/trunk ManyToMany fields can only be traversed in the direction they are defined - in this

Re: Raw SQL to Django API Question and a ManyToMany Model Question

2006-02-15 Thread Brett Hoerner
I've tried: people.get_list(lat__gte=minlat, lon__gte=minlon, lat__lte=maxlat, lon__lte=maxlon, tags__value__exact='django') TypeError: got unexpected keyword argument 'tags__value__exact' And: people.get_list(lat__gte=minlat, lon__gte=minlon, lat__lte=maxlat, lon__lte=maxlon, tag__value__exac

Re: Raw SQL to Django API Question and a ManyToMany Model Question

2006-02-15 Thread Russell Keith-Magee
On 2/16/06, Brett Hoerner <[EMAIL PROTECTED]> wrote: Not sure if anyone will see this now that it's off the front page, butheres what I've gathered so far:Sorry - I meant to answer this one yesterday, but I got distracted. I don't think the Django DB API can handle many2many stuff (at leastright no

Re: Raw SQL to Django API Question and a ManyToMany Model Question

2006-02-15 Thread Brett Hoerner
Not sure if anyone will see this now that it's off the front page, but heres what I've gathered so far: I don't think the Django DB API can handle many2many stuff (at least right now) As for question 2, apparently you _can_ import a model in itself, so problem solved. Thanks to bitprophet on IRC

Raw SQL to Django API Question and a ManyToMany Model Question

2006-02-14 Thread Brett Hoerner
Working on a last-minute mapping app for PyCon here, I'm currently using a raw SQL query to SELECT information from People (Model) who all share the same Tag (Model in a ManyToMany with People). I'm feeding the query a range of lat/lon and the tag I want, c = db.cursor() c.execute("""sel