Search Results

Search found 98 results on 4 pages for 'manytomany'.

Page 1/4 | 1 2 3 4  | Next Page >

  • JPA @ManyToMany on only one side?

    - by Ethan Leroy
    I am trying to refresh the @ManyToMany relation but it gets cleared instead... My Project class looks like this: @Entity public class Project { ... @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinTable(name = "PROJECT_USER", joinColumns = @JoinColumn(name = "PROJECT_ID", referencedColumnName = "ID"), inverseJoinColumns = @JoinColumn(name = "USER_ID", referencedColumnName = "ID")) private Collection<User> users; ... } But I don't have - and I don't want - the collection of Projects in the User entity. When I look at the generated database tables, they look good. They contain all columns and constraints (primary/foreign keys). But when I persist a Project that has a list of Users (and the users are still in the database), the mapping table doesn't get updated gets updated but when I refresh the project afterwards, the list of Users is cleared. For better understanding: Project project = ...; // new project with users that are available in the db System.out.println(project getUsers().size()); // prints 5 em.persist(project); System.out.println(project getUsers().size()); // prints 5 em.refresh(project); System.out.println(project getUsers().size()); // prints 0 So, how can I refresh the relation between User and Project?

    Read the article

  • Self referencing symmetrical Hibernate Map Table using @ManyToMany

    - by sammichy
    I have the following class public class ElementBean { private String link; private Set<ElementBean> connections; } I need to create a map table where elements are mapped to each other in a many-to-many symmetrical relationship. @ManyToMany(targetEntity=ElementBean.class) @JoinTable( name="element_elements", joinColumns=@JoinColumn(name="FROM_ELEMENT_ID", nullable=false), inverseJoinColumns=@JoinColumn(name="TO_ELEMENT_ID", nullable=false) ) public Set<ElementBean> getConnections() { return connections; } I have the following requirements When element A is added as a connection to Element B, then element B should become a connection of Element A. So A.getConnections() should return B and B.getConnections() should return A. I do not want to explicitly create 2 records one for mapping A to B and another for B to A. Is this possible?

    Read the article

  • NHibernate ManyToMany Relationship Cascading AllDeleteOrphan StackOverflowException

    - by Chris
    I have two objects that have a ManyToMany relationship with one another through a mapping table. Though, when I try to save it, I get a stack overflow exception. The following is the code for the mappings: //EventMapping.cs HasManyToMany(x => x.Performers).Table("EventPerformer").Inverse().Cascade.AllDeleteOrphan().LazyLoad().ParentKeyColumn("EventId").ChildKeyColumn("PerformerId"); //PerformerMapping.cs HasManyToMany<Event>(x => x.Events).Table("EventPerformer").Inverse().Cascade.AllDeleteOrphan().LazyLoad().ParentKeyColumn("PerformerId").ChildKeyColumn("EventId"); When I change the performermapping.cs to Cascade.None() I get rid of the exception but then my Event Object doesn't have the performer I associate with it. //In a unit test, paraphrased event.Performers.Add(performer); //Event eventRepository.Save<Event>(event); eventResult = eventRepository.GetById<Event>(event.id); //Event eventResult.Performers[0]; //is null, should have performer in it How should I be writing this properly? Thanks

    Read the article

  • fluentnhibernate ManyToMany does not add records to the junction table

    - by Bertvan
    When saving my many-to-many related entities, the entities are saved ok. However the junction table stays empty: Mapping on Product side (ProductMap.cs) HasManyToMany(x = x.Pictures) .Table("Product_Picture") .ParentKeyColumn("Product") .ChildKeyColumn("Picture") .Cascade.All() .Inverse() Mapping on Picture side (PictureMap.cs) HasManyToMany(x = x.Products) .Table("Product_Picture") .ParentKeyColumn("Picture") .ChildKeyColumn("Product") .Cascade.All(); Any ideas? (btw i can't seem to get the code formatting to work, my 4 spaces are there !)

    Read the article

  • How do you set the initial value for a ManyToMany field in django?

    - by mlissner
    I am using a ModelForm to create a form, and I have gotten the initial values set for every field in the form except for the one that is a ManyToMany field. I understand that I need to give it a list, but I can't get it to work. My code right now is roughly: contacts = userProfile.contact.all() initial = {'contacts': contacts} But that doesn't work. Am I missing something here?

    Read the article

  • JPA ManyToMany problem...

    - by Parhs
    Hello i have an Entity Exam @Id @GeneratedValue(strategy=GenerationType.TABLE) private Long id; ..... ...... @ManyToMany private List<Exam> exams; @ManyToMany(mappedBy="id") private List<Exam> parentExams; The problem is that @ManyToMany private List<Exam> exams; is ok works great... but this doesnt validate?! @ManyToMany(mappedBy="id") private List<Exam> parentExams; Any idea what to do ? I just want to get the exams that are parents of the current exam. ??e???? ??µ?sµat??? ?aµe??

    Read the article

  • derby + hibernate ConstraintViolationException using manytomany relationships

    - by user364470
    Hi, I'm new to Hibernate+Derby... I've seen this issue mentioned throughout the google, but have not seen a proper resolution. This following code works fine with mysql, but when I try this on derby i get exceptions: ( each Tag has two sets of files and vise-versa - manytomany) Tags.java @Entity @Table(name="TAGS") public class Tags implements Serializable { @Id @GeneratedValue(strategy=GenerationType.AUTO) public long getId() { return id; } @ManyToMany(targetEntity=Files.class ) @ForeignKey(name="USER_TAGS_FILES",inverseName="USER_FILES_TAGS") @JoinTable(name="USERTAGS_FILES", joinColumns=@JoinColumn(name="TAGS_ID"), inverseJoinColumns=@JoinColumn(name="FILES_ID")) public Set<data.Files> getUserFiles() { return userFiles; } @ManyToMany(mappedBy="autoTags", targetEntity=data.Files.class) public Set<data.Files> getAutoFiles() { return autoFiles; } Files.java @Entity @Table(name="FILES") public class Files implements Serializable { @Id @GeneratedValue(strategy=GenerationType.AUTO) public long getId() { return id; } @ManyToMany(mappedBy="userFiles", targetEntity=data.Tags.class) public Set getUserTags() { return userTags; } @ManyToMany(targetEntity=Tags.class ) @ForeignKey(name="AUTO_FILES_TAGS",inverseName="AUTO_TAGS_FILES") @JoinTable(name="AUTOTAGS_FILES", joinColumns=@JoinColumn(name="FILES_ID"), inverseJoinColumns=@JoinColumn(name="TAGS_ID")) public Set getAutoTags() { return autoTags; } I add some data to the DB, but when running over Derby these exception turn up (the don't using mysql) Exceptions SEVERE: DELETE on table 'FILES' caused a violation of foreign key constraint 'USER_FILES_TAGS' for key (3). The statement has been rolled back. Jun 10, 2010 9:49:52 AM org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete: [data.Files#3] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2712) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2895) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:260) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:613) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344) at $Proxy13.flush(Unknown Source) at data.HibernateORM.removeFile(HibernateORM.java:285) at data.DataImp.removeFile(DataImp.java:195) at booting.DemoBootForTestUntilTestClassesExist.main(DemoBootForTestUntilTestClassesExist.java:62) I have never used derby before so maybe there is something crutal that i'm missing 1) what am I doing wrong? 2) is there any way of cascading properly when I have 2 many-to-many relationships between two classes? Thanks!

    Read the article

  • ManyToMany Relation does not create the primary key

    - by Javi
    Hello, I have a ManyToMany relationship between two classes: ClassA and ClassB, but when the table for this relationship (table called objectA_objectB) there is no primary key on it. In my ClassA I have the following: @ManyToMany(fetch=FetchType.LAZY) @OrderBy(value="name") @JoinTable(name="objectA_objectB", joinColumns= @JoinColumn(name="idObjectA", referencedColumnName="id"), inverseJoinColumns= @JoinColumn(name="idObjectB", referencedColumnName="id") ) private List<ClassB> objectsB; and in my ClassB I have the reversed relation @ManyToMany List<ClassA> objectsA; I just want to make a primary key of both id's but I need to change the name of the columns as I do. Why is the PK missing? How can I define it? I use JPA 2.0 Hibernate implementation, if this helps. Thanks.

    Read the article

  • Sqlalchemy+elixir: How query with a ManyToMany relationship?

    - by Hugo
    Hi, I'm using sqlalchemy with Elixir and have some troubles trying to make a query.. I have 2 entities, Customer and CustomerList, with a many to many relationship. customer_lists_customers_table = Table('customer_lists_customers', metadata, Column('id', Integer, primary_key=True), Column('customer_list_id', Integer, ForeignKey("customer_lists.id")), Column('customer_id', Integer, ForeignKey("customers.id"))) class Customer(Entity): [...] customer_lists = ManyToMany('CustomerList', table=customer_lists_customers_table) class CustomerList(Entity): [...] customers = ManyToMany('Customer', table=customer_lists_customers_table) I'm tryng to find CustomerList with some customer: customer = [...] CustomerList.query.filter_by(customers.contains(customer)).all() But I get the error: NameError: global name 'customers' is not defined customers seems to be unrelated to the entity fields, there's an special query form to work with relationships (or ManyToMany relationships)? Thanks

    Read the article

  • Django display manytomany field in form when definition is on other model

    - by John
    Hi I have the definition for my manytomany relationship on one model but want to display the field on the form of my other model. How do I do this? for example: # classes class modelA(models.Model): name = models.CharField(max_length=300) manytomany = models.ManyToManyField(modelA) class modelB(models.Model): name = models.CharField(max_length=300) # forms class modelBForm(forms.ModelForm): class Meta: model = modelB If I then used modelBForm it would show a select box with the models from modelA rather than just name. Thanks

    Read the article

  • JPA ManyToMany referencing issue

    - by dharga
    I have three tables. AvailableOptions and PlanTypeRef with a ManyToMany association table called AvailOptionPlanTypeAssoc. The trimmed down schemas look like this CREATE TABLE [dbo].[AvailableOptions]( [SourceApplication] [char](8) NOT NULL, [OptionId] [int] IDENTITY(1,1) NOT NULL, ... ) CREATE TABLE [dbo].[AvailOptionPlanTypeAssoc]( [SourceApplication] [char](8) NOT NULL, [OptionId] [int] NOT NULL, [PlanTypeCd] [char](2) NOT NULL, ) CREATE TABLE [dbo].[PlanTypeRef]( [PlanTypeCd] [char](2) NOT NULL, [PlanTypeDesc] [varchar](32) NOT NULL, ) And the Java code looks like this. //AvailableOption.java @ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER) @JoinTable( name = "AvailOptionPlanTypeAssoc", joinColumns = { @JoinColumn(name = "OptionId"), @JoinColumn(name="SourceApplication")}, inverseJoinColumns=@JoinColumn(name="PlanTypeCd")) List<PlanType> planTypes = new ArrayList<PlanType>(); //PlanType.java @ManyToMany @JoinTable( name = "AvailOptionPlanTypeAssoc", joinColumns = { @JoinColumn(name = "PlanTypeCd")}, inverseJoinColumns={@JoinColumn(name="OptionId"), @JoinColumn(name="SourceApplication")}) List<AvailableOption> options = new ArrayList<AvailableOption>(); The problem arises when making a select on AvailableOptions it joins back onto itself. Note the following SQL code from the backtrace. The second inner join should be on PlanTypeRef. SELECT t0.OptionId, t0.SourceApplication, t2.PlanTypeCd, t2.EffectiveDate, t2.PlanTypeDesc, t2.SysLstTrxDtm, t2.SysLstUpdtUserId, t2.TermDate FROM dbo.AvailableOptions t0 INNER JOIN dbo.AvailOptionPlanTypeAssoc t1 ON t0.OptionId = t1.OptionId AND t0.SourceApplication = t1.SourceApplication INNER JOIN dbo.AvailableOptions t2 ON t1.PlanTypeCd = t2.PlanTypeCd WHERE (t0.SourceApplication = ? AND t0.OptionType = ?) ORDER BY t0.OptionId ASC, t0.SourceApplication ASC [params=(String) testApp, (String) junit0]}

    Read the article

  • Modelling a manyToMany relationship with attributes

    - by Javi
    Hello, I have a ManyToMany relationship between two classes, for instance class Customer and class Item. A customer can buy several items and an item can be bought by different customers. I need to store extra information in this relationship, for example the day when the item was bought. I wonder how is this usually modelled in JPA, cause I'm not sure how to express this in code. Do I have to create a new class to model all the attributes of the relationship and make a manyToMany relationship between the other classes or is a better way to do this? Thanks

    Read the article

  • Hibernate Bi-Directional ManyToMany Updates with Second Level cache

    - by DD
    I have a bidirectional many-to-many class: public class A{ @ManyToMany(mappedBy="listA") private List<B> listB; } public class B{ @ManyToMany private List<A> listA; } Now I save a listA into B: b.setListA(listA); This all works fine until I turn on second-level caching on the collection a.ListB. Now, when I update the list in B, a.listB does not get updated and remains stale. How do you get around this? Thanks, Dwayne

    Read the article

  • @ManyToMany Duplicate Entry Exception

    - by zp26
    I have mapped a bidirectional many-to-many exception between the entities Course and Trainee in the following manner: Course { ... private Collection<Trainee> students; ... @ManyToMany(targetEntity = lesson.domain.Trainee.class, cascade = {CascadeType.All}, fetch = {FetchType.EAGER}) @Jointable(name="COURSE_TRAINEE", joincolumns = @JoinColumn(name="COURSE_ID"), inverseJoinColumns = @JoinColumn(name = "TRAINEE_ID")) @CollectionOfElements public Collection<Trainee> getStudents() { return students; } ... } Trainee { ... private Collection<Course> authCourses; ... @ManyToMany(cascade = {CascadeType.All}, fetch = {FetchType.EAGER}, mappedBy = "students", targetEntity = lesson.domain.Course.class) @CollectionOfElements public Collection<Course> getAuthCourses() { return authCourses; } ... } Instead of creating a table where the Primary Key is made of the two foreign keys (imported from the table of the related two entities), the system generates the table "COURSE_TRAINEE" with the following schema: I am working on MySQL 5.1 and my App. Server is JBoss 5.1. Does anyone guess why?

    Read the article

  • Django ManyToMany join query

    - by Hanpan
    I'm sure this is really simple, but I can't for the life of me find any documentation explaining how to do this. How do I get the results of a ManyToMany field inside a join as opposed to doing this: {% for tag in article.tags.all %} Which results in an extra query? What I'd like to do is fetch all related tags when I retrieve the initial article, so I could then do something like: {% for tag in article.tags %} Without the .all and the extra query. Thanks!

    Read the article

  • Django Custom Widget For ManyToMany field

    - by John
    Does anyone know of a widget that displays 2 select boxes. One shows a list of all object in a model and the other shows the objects which have been selected. The user can then select an object from the first list, click an button which moves it to the 'selected' list. Then when the form is saved the objects in the selected list are saved in the manytomany field. Thanks

    Read the article

  • What's best practice to check if an object is part of a ManyToMany relationship in Django

    - by PhilGo20
    from an instance of Site with a ManyToMany relationship to Kiosk, i'd like to check if a Kiosk object is part of the relationship. I could do self.apps.get(id=app_id).exists() and check if True or self.apps.get(id=app_id) and catch the ObjectDoesNotExist error or self.apps.filter(id=app_id) and check if True If I have to catch a possible ObjectDoesNotExist error, I may as well use the second one I can do the second but doesnt seem super clean can use the third one but using filter on a unique ID seems wrong to me You can tell me to use whatever works and that'll be a valid answer ;-)

    Read the article

  • Django admin, filter objects by ManyToMany reference

    - by Nick Z
    Hello! There's photologue application, simple photo gallery for django, implementing Photo and Gallery objects. Gallery object has ManyToMany field, which references Photo objects. I need to be able to get list of all Photos for a given Gallery. Is it possible to add Gallery filter to Photo's admin page? If it's possible, how to do it best?

    Read the article

  • Django Initial for a ManyToMany Field

    - by gramware
    I have a form that edits an instance of my model. I would like to use the form to pass all the values as hidden with an inital values of username defaulting to the logged in user so that it becomes a subscribe form. The problem is that the normal initial={'field':value} doesn't seem to work for manytomany fields. how do i go about it? my views.py @login_required def event_view(request,eventID): user = UserProfile.objects.get(pk=request.session['_auth_user_id']) event = events.objects.get(eventID = eventID) if request.method == 'POST': form = eventsSusbcribeForm( request.POST,instance=event) if form.is_valid(): form.save() return HttpResponseRedirect('/events/') else: form = eventsSusbcribeForm(instance=event) return render_to_response('event_view.html', {'user':user,'event':event, 'form':form},context_instance = RequestContext( request )) my forms.py class eventsSusbcribeForm(forms.ModelForm): eventposter = forms.ModelChoiceField(queryset=UserProfile.objects.all(), widget=forms.HiddenInput()) details = forms.CharField(widget=forms.Textarea(attrs={'cols':'50', 'rows':'5'}),label='Enter Event Description here') date = forms.DateField(widget=SelectDateWidget()) class Meta: model = events exclude = ('deleted') def __init__(self, *args, **kwargs): super(eventsSusbcribeForm, self).__init__(*args, **kwargs) self.fields['username'].initial = (user.id for user in UserProfile.objects.filter())

    Read the article

  • Hibernate ManyToMany and superclass mapping problem

    - by Jesus Benito
    Hi all, I need to create a relation in Hibernate, linking three tables: Survey, User and Group. The Survey can be visible to a User or to a Group, and a Group is form of several Users. My idea was to create a superclass for User and Group, and create a ManyToMany relationship between that superclass and Survey. My problem is that Group, is not map to a table, but to a view, so I can't split the fields of Group among several tables -which would happen if I created a common superclass-. I thought about creating a common interface, but mapping to them is not allowed. I will probably end up going for a two relations solution (Survey-User and Survey-Group), but I don't like too much that approach. I thought as well about creating a table that would look like: Survey Id | ElementId | Type ElementId would be the Group or UserId, and the type... the type of it. Does anyone know how to achieve it using hibernate annotations? Any other ideas? Thanks a lot

    Read the article

  • How to add manytomany field to flatpage admin

    - by valya
    Hello! I have a site with Flatpages, and now I need to be able to add galleries (Gallery model) to the page. This is going to be ManyToManyField, so there is no need to change the flatpages table. But I still can't define ManyToManyField in proxy class. I can define ManyToManyField in Gallery model, but it isn't comfortable for the client. How can I change FlatPage Admin to add a ManyToManyField from Galleries model?

    Read the article

  • Django data migration when changing a field to ManyToMany

    - by Ken H
    I have a Django application in which I want to change a field from a ForeignKey to a ManyToManyField. I want to preserve my old data. What is the simplest/best process to follow for this? If it matters, I use sqlite3 as my database back-end. If my summary of the problem isn't clear, here is an example. Say I have two models: class Author(models.Model): author = models.CharField(max_length=100) class Book(models.Model): author = models.ForeignKey(Author) title = models.CharField(max_length=100) Say I have a lot of data in my database. Now, I want to change the Book model as follows: class Book(models.Model): author = models.ManyToManyField(Author) title = models.CharField(max_length=100) I don't want to "lose" all my prior data. What is the best/simplest way to accomplish this? Ken

    Read the article

  • django ManyToMany through help

    - by dotty
    Hay I've got a question about relationships. I want to Users to have Friendships. So a User can be a friend with another User. I'm assuming i'll need to use the ManyToManyField, through a Friendship table. But i cannot get it to work. Any ideas? Here are my models. class User(models.Model): username = models.CharField(max_length=999) password = models.CharField(max_length=999) created_on = models.DateField(auto_now = False, auto_now_add = True) updated_on = models.DateField(auto_now = True, auto_now_add = False) friends = models.ManyToManyField('User', through='Friendship') class Friendship(models.Model): user = models.ForeignKey('User') friend = models.ForeignKey('User') Thanks

    Read the article

  • Inline editing of ManyToMany relation in Django

    - by vorpyg
    After working through the Django tutorial I'm now trying to build a very simple invoicing application. I want to add several Products to an Invoice, and to specify the quantity of each product in the Invoice form in the Django admin. Now I've to create a new Product object if I've got different quantites of the same Product. Right now my models look like this (Company and Customer models left out): class Product(models.Model): description = models.TextField() quantity = models.IntegerField() price = models.DecimalField(max_digits=10,decimal_places=2) tax = models.ForeignKey(Tax) class Invoice(models.Model): company = models.ForeignKey(Company) customer = models.ForeignKey(Customer) products = models.ManyToManyField(Product) invoice_no = models.IntegerField() invoice_date = models.DateField(auto_now=True) due_date = models.DateField(default=datetime.date.today() + datetime.timedelta(days=14)) I guess the quantity should be left out of the Product model, but how can I make a field for it in the Invoice model?

    Read the article

  • Limiting choices from an intermediary ManyToMany junction table in Django

    - by Matthew Rankin
    Background I've created three Django models—Inventory, SalesOrder, and Invoice—to model items in inventory, sales orders for those items, and invoices for a particular sales order. Each sales order can have multiple items, so I've used an intermediary junction table—SalesOrderItems—using the through argument for the ManyToManyField. Also, partial billing of a sales orders is allowed, so I've created a ForeignKey in the Invoice model related to the SalesOrder model, so that a particular sales order can have multiple invoices. Here's where I deviate from what I've normally seen. Instead of relating the Invoice model to the Item model via a ManyToManyField, I've related the Invoice model to the SalesOrderItem intermediary junction table through the intermediary junction table InvoiceItem. I've done this because it better models reality—our invoices are tied to sales orders and can only include items that are tied to that sales order as opposed to any item in inventory. I will admit that it does seem strange having the intermediary junction table of a ManyToManyField related to the intermediary junction table of another ManyToManyField. Question How can I limit the choices available for the invoice_items in the Invoice model to just the sales_order_items of the SalesOrder model for that particular Invoice? (I tried using limit_choices_to= {'sales_order': self.invoice.sales_order}) as part of the item = models.ForeignKey(SalesOrderItem) in the InvoiceItem model, but that didn't work. Am I correct in thinking that limiting the choices for the invoice_items should be handled in the model instead of in a form? Code class Item(models.Model): item_num = models.SlugField(unique=True) default_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True) class SalesOrderItem(models.Model): item = models.ForeignKey(Item) sales_order = models.ForeignKey('SalesOrder') unit_price = models.DecimalField(max_digits=10, decimal_places=2) quantity = models.DecimalField(max_digits=10, decimal_places=4) class SalesOrder(models.Model): customer = models.ForeignKey(Party) so_num = models.SlugField(max_length=40, unique=True) sales_order_items = models.ManyToManyField(Item, through=SalesOrderItem) class InvoiceItem(models.Model): item = models.ForeignKey(SalesOrderItem) invoice = models.ForeignKey('Invoice') unit_price = models.DecimalField(max_digits=10, decimal_places=2) quantity = models.DecimalField(max_digits=10, decimal_places=4) class Invoice(models.Model): invoice_num = models.SlugField(max_length=25) sales_order = models.ForeignKey(SalesOrder) invoice_items = models.ManyToManyField(SalesOrderItem, through='InvoiceItem')

    Read the article

1 2 3 4  | Next Page >